/* ============================================================================
   EVA — shell.css (الإصدار 6): القائمة، الترويسة، الهاتف، الحفظ والبيانات، السجل، التثبيت
   يُحمَّل بعد style.css و theme.css
   ============================================================================ */

/* ---------- أزرار الإغلاق X: واضحة على الخلفيات الداكنة والفاتحة ---------- */
.eva-x, .close-modal, .ocr-x, .esm-x, .dm-x {
    width: 38px !important; height: 38px !important; min-width: 38px; padding: 0 !important; margin: 0 !important;
    border-radius: 50% !important; display: inline-grid !important; place-items: center; flex: 0 0 auto;
    background: #fff !important; color: var(--eva-purple-800) !important; border: 1.5px solid rgba(201, 162, 75, .7) !important;
    box-shadow: 0 6px 16px -6px rgba(20, 8, 46, .55) !important; font-size: 22px !important; font-weight: 800; line-height: 1 !important;
    cursor: pointer; opacity: 1 !important; float: none !important; transition: transform .2s, background .2s, color .2s;
}
.eva-x i, .close-modal i { font-size: 18px; color: inherit !important; }
.eva-x:hover, .close-modal:hover, .ocr-x:hover, .esm-x:hover, .dm-x:hover { background: var(--eva-gold-light, #f3d98b) !important; color: var(--eva-purple-900) !important; transform: rotate(90deg); }
.eva-x:focus-visible, .close-modal:focus-visible { outline: 3px solid var(--eva-gold); outline-offset: 2px; }
.eva-x.is-sm { width: 34px !important; height: 34px !important; min-width: 34px; }
.modal-content { position: relative; }
.modal-content > .close-modal, .help-head > .close-modal { position: absolute !important; top: 12px; left: 12px; z-index: 6; }
.modal-content > .close-modal + .modal-header, .help-head { padding-left: 62px !important; }
#sidebar .sidebar-close-btn { background: #fff !important; color: var(--eva-purple-800) !important; border-color: rgba(201, 162, 75, .7) !important; }

/* ---------- القائمة الجانبية ---------- */
#sidebar .sidebar-content .sidebar-item[hidden], #adminDashboardBtn[hidden], body:not(.is-admin) #adminDashboardBtn { display: none !important; }
#sidebar .sidebar-content { display: flex; flex-direction: column; min-height: calc(100% - 80px); }
.sb-profile { display: flex; gap: 12px; align-items: center; margin: 4px 2px 6px; padding: 12px; border-radius: 16px; background: linear-gradient(135deg, var(--eva-purple-50), #fff); border: 1px solid var(--eva-line); }
.sb-profile[hidden] { display: none !important; }
.sbp-av, .tid-av { flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; font-weight: 800; color: var(--eva-purple-900); background: linear-gradient(135deg, var(--eva-gold-light, #f3d98b), var(--eva-gold)); font-family: 'Tajawal', sans-serif; }
.sbp-av { width: 46px; height: 46px; font-size: 18px; box-shadow: 0 6px 14px -8px rgba(74, 37, 130, .8); }
.sbp-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sbp-main b { color: var(--eva-purple-900); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbp-main small { color: var(--eva-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbp-plan { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: #efe9fb; color: var(--eva-purple-700); margin-top: 2px; }
.sbp-plan.is-admin { background: #fff4d6; color: var(--eva-gold-dark); }
.sbp-plan.is-pro, .sbp-plan.is-official { background: #e5f6ec; color: #1e7a46; }
.sbp-days { font-size: 11px; color: var(--eva-muted); } .sbp-days.is-low { color: var(--eva-bad); font-weight: 800; }
#sidebar .sidebar-content .sidebar-item .si-text { flex: 1; }
.si-dot { width: 10px; height: 10px; border-radius: 50%; background: #f39c12; box-shadow: 0 0 0 4px rgba(243, 156, 18, .18); margin-inline-start: auto; }
.si-dot[hidden] { display: none; }
#sidebar .sidebar-content .sidebar-item.is-install { background: linear-gradient(135deg, #fff9ea, #fdf0cc) !important; border-color: rgba(201, 162, 75, .55) !important; }
#sidebar .sidebar-content .sidebar-item.is-install > i { background: var(--eva-gold); color: var(--eva-purple-900) !important; }
#sidebar .sidebar-content .logout-btn-styled { margin-top: 10px !important; }
.sb-foot { margin-top: auto; padding: 16px 8px 4px; text-align: center; font-size: 11.5px; color: var(--eva-muted); }

/* ---------- الترويسة ---------- */
.header .meta-teacher { gap: 8px !important; padding: 4px 6px 4px 14px !important; }
.tid-av { width: 30px; height: 30px; font-size: 13px; }
.tid-txt { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.tid-txt b { color: #fff; font-size: 14px; }
.tid-txt small { color: var(--eva-gold-light, #f3d98b); font-size: 11.5px; font-weight: 700; }
.hdr-install { position: absolute; top: 12px; left: 12px; z-index: 6; display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 0; cursor: pointer;
    background: var(--eva-gold); color: var(--eva-purple-900); font: 800 13px 'Tajawal', sans-serif; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .45); animation: eva-install-glow 2.6s ease-in-out infinite; }
.hdr-install[hidden] { display: none; }
.hdr-install i { font-size: 15px; }
@keyframes eva-install-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(243, 217, 139, .55); } 50% { box-shadow: 0 0 0 7px rgba(243, 217, 139, 0); } }
body:has(#installBtnHeader:not([hidden])) .header .designer-badge { display: none !important; }
.dash-restore-btn { margin-top: 14px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 14px; border-radius: 14px; cursor: pointer;
    border: 1.5px dashed var(--eva-gold); background: #fffaf0; color: var(--eva-purple-800); font: 700 14px 'Tajawal', sans-serif; }
.dash-restore-btn:hover { background: #fff3d6; }

/* ---------- الهاتف: ترويسة مضغوطة ---------- */
@media (max-width: 640px) {
    #workspaceContainer { padding-top: 0 !important; }
    .header { padding: 10px 10px 10px !important; margin: 0 0 10px !important; border-radius: 0 0 22px 22px !important; }
    .header .designer-badge { display: none !important; }
    .header-menu-zone { top: 10px !important; right: 10px !important; }
    .header-menu-zone .menu-btn { width: 40px; height: 40px; display: grid !important; place-items: center; padding: 0 !important; font-size: 20px !important; }
    .hdr-install { top: 10px; left: 10px; padding: 0; width: 40px; height: 40px; justify-content: center; }
    .hdr-install span { display: none; }
    .header .header-title-row { padding: 2px 52px 0 !important; margin: 0 0 8px !important; min-height: 40px; gap: 8px !important; flex-wrap: nowrap !important; }
    .header #appTitle, .header .header-title-row h1 { font-size: 17px !important; line-height: 1.25 !important; }
    .header .header-logo { width: 30px !important; height: 30px !important; padding: 2px; }
    .header .header-info-bar { flex-wrap: nowrap !important; justify-content: flex-start !important; overflow-x: auto; gap: 6px !important; padding: 2px 2px 4px; margin: 0 -4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
    .header .header-info-bar::-webkit-scrollbar { display: none; }
    .header .header-info-bar > * { flex: 0 0 auto; scroll-snap-align: start; }
    .header .meta-info { margin: 0 !important; padding: 5px 11px !important; font-size: 12px !important; white-space: nowrap; box-shadow: none !important; }
    .header .meta-teacher { padding: 3px 4px 3px 10px !important; }
    .tid-av { width: 26px; height: 26px; font-size: 12px; }
    .tid-txt b { font-size: 12.5px; } .tid-txt small { font-size: 10.5px; }
    #metaSchool { max-width: 62vw; } #metaSchool b { overflow: hidden; text-overflow: ellipsis; }
    .header select, .header .header-dropdown-tri, .transparent-year-select { font-size: 12px !important; padding: 5px 8px !important; height: auto !important; min-width: 0 !important; }
    .header-upload-btn { padding: 6px 10px !important; font-size: 12px !important; white-space: nowrap; }

    /* شريط القسم والوضع: سطر واحد مضغوط */
    #mainContentView .primary-toolbar { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px !important; padding: 0 10px !important; margin-bottom: 8px !important; }
    #mainContentView .primary-toolbar .tool-group { gap: 3px !important; min-width: 0; }
    #mainContentView .primary-toolbar .tool-group label { font-size: 11.5px !important; margin: 0 !important; color: var(--eva-muted) !important; font-weight: 700; }
    #mainContentView #sheetSelector, #mainContentView #gradeMode { height: 44px !important; font-size: 14px !important; padding: 6px 10px 6px 28px !important; background-position: left 8px center !important; }
    #mainContentView #toggleToolsBtn { grid-column: 1 / -1; height: 40px; min-height: 0 !important; padding: 6px 12px !important; font-size: 13.5px !important; border-radius: 12px !important; margin: 0 !important; }
    #reportsBar { margin: 0 10px 8px !important; }
    .dashboard-view { margin-top: 12px !important; }
}

/* ---------- الشريط المصغّر الثابت (القسم + الوضع) ---------- */
.eva-minibar { position: fixed; top: 0; left: 0; right: 0; z-index: 1500; display: none; align-items: center; gap: 8px;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 6px; direction: rtl;
    background: rgba(43, 20, 87, .92); -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3);
    border-bottom: 2px solid var(--eva-gold); box-shadow: 0 8px 20px -10px rgba(20, 8, 46, .7);
    transform: translateY(-110%); opacity: 0; transition: transform .32s cubic-bezier(.2, .8, .2, 1), opacity .25s ease; pointer-events: none; }
.mb-btn { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; cursor: pointer; font-size: 16px; }
.mb-info { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: none; color: #fff; cursor: pointer; font-family: 'Tajawal', sans-serif; padding: 0; }
.mb-class { font-weight: 800; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-mode { flex: 0 1 auto; font-size: 11.5px; font-weight: 800; color: var(--eva-purple-900); background: var(--eva-gold-light, #f3d98b); padding: 2px 9px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46%; }
@media (max-width: 900px) {
    .eva-minibar { display: flex; }
    body.eva-mini .eva-minibar { transform: none; opacity: 1; pointer-events: auto; }
    body:has(#adminAppTab[style*="block"]) .eva-minibar, body:has(#mainContentView[style*="none"]) .eva-minibar { display: none; }
}

/* ---------- زر القائمة العائم (فوق الميكروفون والبحث) ---------- */
.fab-container .fab-nav { display: none; }
@media (max-width: 900px) {
    .fab-container .fab-nav { display: flex; width: 50px !important; height: 50px !important; margin-bottom: 12px; font-size: 21px; color: #fff;
        transform: scale(.2) translateY(30px); opacity: 0; pointer-events: none !important; transition: transform .32s cubic-bezier(.34, 1.56, .64, 1), opacity .2s; }
    body.eva-scrolled .fab-container .fab-nav { transform: none; opacity: 1; pointer-events: auto !important; }
}

/* ---------- نوافذ EVA الحديثة (الحفظ والبيانات، السجل، التثبيت) ---------- */
.st-modal .modal-content, .lg-modal .modal-content, .ig-modal .modal-content {
    max-width: 600px !important; width: calc(100% - 24px) !important; margin: 5vh auto !important; padding: 0 !important; border-radius: 22px !important;
    max-height: 90vh !important; display: flex !important; flex-direction: column; overflow: hidden; text-align: right; direction: rtl; background: #fff !important;
}
.lg-modal .modal-content { max-width: 720px !important; }
.st-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; background: linear-gradient(135deg, var(--eva-purple-900), var(--eva-purple-700)); border-bottom: 3px solid var(--eva-gold); color: #fff; flex: 0 0 auto; }
.st-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.st-title > i { font-size: 30px; color: var(--eva-gold-light, #f3d98b); }
.st-title h3 { margin: 0; font-size: 18px; color: #fff !important; }
.st-title small { display: block; color: #cdbfee; font-size: 12.5px; line-height: 1.5; }
.st-stats, .lg-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px 16px 0; flex: 0 0 auto; }
.st-stat { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; border-radius: 14px; background: var(--eva-purple-50); border: 1px solid var(--eva-line); text-align: center; min-width: 0; }
.st-stat i { font-size: 18px; color: var(--eva-purple-600); }
.st-stat b { font-size: 15px; color: var(--eva-purple-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.st-stat span { font-size: 11px; color: var(--eva-muted); }
.st-stat.is-add b, .st-stat.is-add i { color: #1e8a4c; } .st-stat.is-sub b, .st-stat.is-sub i { color: var(--eva-bad); }
.st-tabs { display: flex; gap: 6px; padding: 12px 16px 0; flex: 0 0 auto; }
.st-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 6px; border-radius: 12px; border: 1.5px solid var(--eva-line); background: #fff; color: var(--eva-purple-800); font: 800 13px 'Tajawal', sans-serif; cursor: pointer; white-space: nowrap; }
.st-tab i { font-size: 17px; }
.st-tab.active { background: var(--eva-purple-800); border-color: var(--eva-purple-800); color: #fff; box-shadow: 0 6px 14px -8px rgba(74, 37, 130, .9); }
.st-body { padding: 12px 16px 16px; overflow: auto; flex: 1 1 auto; }
.st-pane { display: grid; gap: 12px; } .st-pane[hidden] { display: none; }
.st-block { border: 1px solid var(--eva-line); border-radius: 16px; padding: 14px; background: #fff; }
.st-bh { display: flex; gap: 12px; align-items: flex-start; }
.st-bh > i { font-size: 24px; color: var(--eva-purple-600); background: var(--eva-purple-50); border-radius: 12px; padding: 8px; flex: 0 0 auto; }
.st-block h4 { margin: 0 0 3px; font-size: 15px; color: var(--eva-purple-900); }
.st-block p { margin: 0; font-size: 13px; color: var(--eva-muted); line-height: 1.75; }
.st-tag { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--eva-purple-50); color: var(--eva-purple-700); vertical-align: middle; }
.st-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.st-meta { font-size: 12px; color: var(--eva-muted); }
.st-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 15px; border-radius: 12px; border: 1.5px solid var(--eva-line); background: #fff; color: var(--eva-purple-800); font: 800 14px 'Tajawal', sans-serif; cursor: pointer; transition: .15s; }
.st-btn i { font-size: 18px; }
.st-btn:hover:not(:disabled) { border-color: var(--eva-gold); background: var(--eva-purple-50); }
.st-btn:disabled { opacity: .55; cursor: not-allowed; }
.st-btn.is-primary { background: linear-gradient(135deg, var(--eva-purple-700), var(--eva-purple-600)); border-color: transparent; color: #fff; }
.st-btn.is-primary:hover:not(:disabled) { filter: brightness(1.08); background: linear-gradient(135deg, var(--eva-purple-700), var(--eva-purple-600)); }
.st-btn.is-warn { background: #f39c12; border-color: #f39c12; color: #fff; }
.st-btn.is-danger { background: var(--eva-bad); border-color: var(--eva-bad); color: #fff; }
.st-btn.is-on { background: #e5f6ec; border-color: #9fd9b5; color: #1e7a46; }
.st-btn.is-google { background: #fff; border: 1.5px solid #dadce0; color: #1f1f1f; padding: 11px 18px; box-shadow: 0 2px 6px -2px rgba(0, 0, 0, .2); }
.g-logo { width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(from -45deg, #ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); box-shadow: inset 0 0 0 4px #fff; }
.st-block.is-warn { border-color: #f2d199; background: #fffbf2; } .st-block.is-warn .st-bh > i { color: #b26b00; background: #fff1d6; }
.st-block.is-danger { border-color: #f4c7c1; background: #fff8f7; } .st-block.is-danger .st-bh > i { color: var(--eva-bad); background: #fde3df; }
.st-hero { text-align: center; padding: 20px 16px; background: linear-gradient(180deg, var(--eva-purple-50), #fff); }
.st-hero-ic { font-size: 44px; color: var(--eva-purple-600); }
.st-hero h4 { font-size: 16.5px; margin: 6px 0 8px; }
.st-points { list-style: none; margin: 0 auto 16px; padding: 0; display: grid; gap: 7px; max-width: 440px; text-align: right; font-size: 13.5px; color: #4b4566; }
.st-points li { display: flex; gap: 8px; align-items: flex-start; } .st-points i { color: #1e8a4c; margin-top: 3px; }
.st-acc-row { display: flex; align-items: center; gap: 12px; }
.st-avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--eva-purple-50); color: var(--eva-purple-600); font-size: 24px; flex: 0 0 auto; }
.st-acc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-acc-main > b { color: var(--eva-purple-900); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.st-acc-main small { color: var(--eva-muted); font-size: 12.5px; }
.st-ok { color: #1e8a4c; font-weight: 800; } .st-idle { color: #b26b00; font-weight: 700; }
.st-note { margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: #fff8ec; color: #8a5a10; border: 1px solid #f6d9a8; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.st-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--eva-line); font-weight: 800; color: var(--eva-purple-900); font-size: 14px; cursor: pointer; }
.st-switch small { display: block; font-weight: 500; color: var(--eva-muted); font-size: 12px; }
.st-list { margin-top: 12px; display: grid; gap: 6px; max-height: 300px; overflow: auto; }
.st-list[hidden] { display: none; }
.st-file { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--eva-line); background: #fcfbff; }
.st-file > i { font-size: 22px; color: var(--eva-purple-600); }
.st-file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-file-main b { font-size: 13.5px; color: var(--eva-purple-900); } .st-file-main em { font-style: normal; font-size: 10.5px; background: #e5f6ec; color: #1e7a46; padding: 1px 7px; border-radius: 999px; margin-inline-start: 4px; }
.st-file-main small { font-size: 11.5px; color: var(--eva-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-mini { padding: 7px 12px; border-radius: 10px; border: 0; background: var(--eva-purple-700); color: #fff; font: 800 12.5px 'Tajawal', sans-serif; cursor: pointer; }
.st-link { display: block; margin: 12px auto 0; background: none; border: 0; color: var(--eva-muted); font: 700 12.5px 'Tajawal', sans-serif; text-decoration: underline; cursor: pointer; }
.st-empty { padding: 22px 12px; text-align: center; color: var(--eva-muted); font-size: 13.5px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.st-empty i { font-size: 30px; color: var(--eva-purple-600); } .st-empty.is-bad { color: var(--eva-bad); }
.eva-spin { animation: eva-spin 1s linear infinite; display: inline-block; } @keyframes eva-spin { to { transform: rotate(360deg); } }

/* سجل التقييم */
.lg-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 0; flex: 0 0 auto; }
.lg-search { flex: 1 1 180px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1.5px solid var(--eva-line); border-radius: 12px; background: #fff; }
.lg-search i { color: var(--eva-purple-600); }
.lg-search input { flex: 1; border: 0; outline: 0; padding: 9px 2px; font: 600 14px 'Tajawal', sans-serif; background: transparent; min-width: 0; }
.lg-filters select { flex: 0 1 180px; padding: 8px 10px !important; border-radius: 12px !important; border: 1.5px solid var(--eva-line) !important; font: 700 13.5px 'Tajawal', sans-serif !important; min-width: 0 !important; height: auto !important; }
.lg-kinds { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--eva-purple-50); }
.lg-kinds button { border: 0; background: none; padding: 6px 12px; border-radius: 9px; font: 800 12.5px 'Tajawal', sans-serif; color: var(--eva-purple-800); cursor: pointer; }
.lg-kinds button.active { background: #fff; box-shadow: 0 2px 8px -4px rgba(74, 37, 130, .6); }
.lg-list { flex: 1 1 auto; overflow: auto; padding: 10px 16px; display: grid; gap: 6px; align-content: start; min-height: 160px; }
.lg-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--eva-line); background: #fff; }
.lg-amt { flex: 0 0 56px; text-align: center; font-weight: 800; font-size: 15px; padding: 5px 0; border-radius: 10px; direction: ltr; background: var(--eva-purple-50); color: var(--eva-purple-800); }
.lg-row.is-add .lg-amt { background: #e5f6ec; color: #1e7a46; } .lg-row.is-sub .lg-amt { background: #fde8e5; color: var(--eva-bad); }
.lg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lg-main b { font-size: 14px; color: var(--eva-purple-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-main small { font-size: 12px; color: var(--eva-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-row time { flex: 0 0 auto; font-size: 11.5px; color: var(--eva-muted); direction: ltr; }
.lg-foot { display: flex; justify-content: space-between; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--eva-line); background: #fcfbff; flex: 0 0 auto; }

/* دليل التثبيت */
.ig-icon { width: 40px; height: 40px; border-radius: 10px; background: #fff; padding: 2px; }
.ig-body { padding: 14px 16px 18px; overflow: auto; display: grid; gap: 8px; }
.ig-block { border: 1px solid var(--eva-line); border-radius: 14px; background: #fff; overflow: hidden; }
.ig-block[open] { border-color: var(--eva-gold); box-shadow: 0 6px 18px -12px rgba(74, 37, 130, .6); }
.ig-block summary { cursor: pointer; padding: 11px 14px; font-weight: 800; color: var(--eva-purple-900); font-size: 14.5px; list-style: none; display: flex; align-items: center; gap: 8px; }
.ig-block summary::-webkit-details-marker { display: none; }
.ig-block summary::before { content: '›'; font-size: 20px; color: var(--eva-purple-600); transition: transform .2s; display: inline-block; }
.ig-block[open] summary::before { transform: rotate(90deg); }
.ig-block summary em { font-style: normal; font-size: 11px; background: var(--eva-gold); color: var(--eva-purple-900); padding: 1px 8px; border-radius: 999px; }
.ig-block ol { margin: 0; padding: 0 34px 14px 14px; display: grid; gap: 8px; font-size: 14px; color: #3b3554; line-height: 1.8; }
.ig-block ol i { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--eva-purple-50); color: var(--eva-purple-700); vertical-align: middle; font-size: 15px; }
.ig-others { font-size: 12px; font-weight: 800; color: var(--eva-gold-dark); margin: 6px 4px 0; }
.ig-go { width: 100%; margin-top: 6px; }

/* ورقة اقتراح التثبيت */
.install-sheet { position: fixed; z-index: 2500; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-width: 520px; margin: 0 auto; direction: rtl;
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: #fff; border: 1px solid var(--eva-line); border-top: 3px solid var(--eva-gold);
    box-shadow: 0 20px 50px -14px rgba(20, 8, 46, .55); transform: translateY(140%); opacity: 0; transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .3s; }
.install-sheet.show { transform: none; opacity: 1; }
.is-icon { width: 48px; height: 48px; border-radius: 12px; flex: 0 0 auto; }
.is-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.is-text b { color: var(--eva-purple-900); font-size: 15px; } .is-text small { color: var(--eva-muted); font-size: 12px; line-height: 1.5; }
.is-acts { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.is-go { border: 0; border-radius: 11px; padding: 9px 18px; background: linear-gradient(135deg, var(--eva-purple-700), var(--eva-purple-600)); color: #fff; font: 800 14px 'Tajawal', sans-serif; cursor: pointer; }
.is-later { border: 0; background: none; color: var(--eva-muted); font: 700 12px 'Tajawal', sans-serif; cursor: pointer; }

@media (max-width: 640px) {
    .st-modal .modal-content, .lg-modal .modal-content, .ig-modal .modal-content {
        width: 100% !important; max-width: none !important; margin: 0 !important; position: fixed !important; bottom: 0; left: 0; right: 0;
        border-radius: 22px 22px 0 0 !important; max-height: 94vh !important; animation: eva-sheet-up .32s cubic-bezier(.2, .8, .2, 1);
    }
    .st-stats, .lg-sum { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 10px 12px 0; }
    .st-stat { padding: 6px 2px; } .st-stat b { font-size: 13px; } .st-stat span { font-size: 10px; } .st-stat i { font-size: 15px; }
    .st-tabs { padding: 10px 12px 0; } .st-tab { font-size: 12px; padding: 8px 4px; gap: 4px; }
    .st-body { padding: 10px 12px calc(16px + env(safe-area-inset-bottom, 0px)); }
    .st-actions .st-btn { flex: 1 1 auto; }
    .lg-filters { padding: 10px 12px 0; } .lg-filters select { flex: 1 1 45%; } .lg-kinds { flex: 1 1 100%; } .lg-kinds button { flex: 1; }
    .lg-list { padding: 10px 12px; }
    .lg-row time { display: none; }
    .lg-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); } .lg-foot .st-btn { flex: 1; }
    .st-title small { display: none; }
}
@keyframes eva-sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
body.is-standalone .hdr-install, body.is-standalone #installBtnSidebar { display: none !important; }
.mb-ic { flex: 0 0 34px; height: 34px; display: grid; place-items: center; color: var(--eva-gold-light, #f3d98b); font-size: 20px; }
#sidebar .sidebar-content .sb-profile { display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: flex-start !important; text-align: right !important; }
#sidebar .sidebar-content .sb-profile .sbp-main { flex: 1; align-items: flex-start !important; text-align: right !important; }
/* نافذة التثبيت فوق الأزرار العائمة، والأزرار تختفي ولا تلتقط اللمس أثناء ظهورها */
.install-sheet { z-index: 10060 !important; }
body.eva-inst-on .fab-container, body.eva-inst-on .fab-container *, body:has(.install-sheet.show) .fab-container, body:has(.install-sheet.show) .fab-container * { opacity: 0 !important; pointer-events: none !important; transition: opacity .2s; }
/* إخفاء الأزرار العائمة عند فتح أي نافذة */
body:has(.modal[style*="block"]) .fab-container, body:has(.eva-sheet-modal.open) .fab-container, body:has(.ocr-modal.open) .fab-container,
body:has(.modal[style*="block"]) .eva-minibar, body:has(.sidebar.open) .eva-minibar { opacity: 0 !important; pointer-events: none !important; }
/* الاشتراك في بطاقة الأستاذ (لوحة الإدارة) */
.auc-plan { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: #1e7a46; background: #e5f6ec; border-radius: 999px; padding: 3px 10px; margin-top: 2px; }
.auc-plan.is-low { color: var(--eva-bad); background: #fde8e5; }
.acb.acb-plan { background: var(--eva-purple-50) !important; color: var(--eva-purple-800) !important; border: 1px solid var(--eva-line) !important; }
#planModal .st-pane { gap: 8px; } #planModal .st-btn { justify-content: flex-start; width: 100%; }

/* ---------- وضع OCR: زر الكاميرا مكان الميكروفون + قائمة دوّارة ---------- */
#ocrBar { display: none !important; }
body.ocr-mode .fab-container #micBtn { display: none !important; }
.ocr-fabs { display: none; flex-direction: column; align-items: center; margin-bottom: 15px; pointer-events: auto; position: relative; }
body.ocr-mode .ocr-fabs { display: flex; }
.ocr-fab-main { position: relative; pointer-events: auto; overflow: visible !important; }
.ocr-fab-main i { position: absolute; font-size: 28px; transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), opacity .25s; color: #fff; }
.ocr-fab-main .ofm-x { opacity: 0; transform: rotate(-180deg) scale(.4); }
.ocr-fabs.open .ocr-fab-main { transform: rotate(180deg) !important; }
.ocr-fab-main { transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), background .3s !important; }
.ocr-fabs.open .ocr-fab-main .ofm-cam { opacity: 0; transform: scale(.4); }
.ocr-fabs.open .ocr-fab-main .ofm-x { opacity: 1; transform: rotate(180deg) scale(1); }
body.ocr-mode .ocr-fab-main:not(.listening) { background: linear-gradient(135deg, var(--eva-gold), #b8892f) !important; }
body.ocr-mode .ocr-fab-main i { color: var(--eva-purple-900); }
.ocr-fab-items { display: flex; flex-direction: column; align-items: center; gap: 11px; margin-bottom: 12px; pointer-events: none; }
.ocr-fab-item { position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; font-size: 22px;
    background: #fff; color: var(--eva-purple-800); border: 2px solid var(--eva-gold); box-shadow: 0 10px 22px -10px rgba(74, 37, 130, .8);
    opacity: 0; transform: translateY(26px) scale(.3); pointer-events: none;
    transition: transform .38s cubic-bezier(.34, 1.56, .64, 1), opacity .22s; transition-delay: calc((2 - var(--i)) * 40ms); }
.ocr-fab-item.is-scan { width: 54px; height: 54px; font-size: 26px; background: linear-gradient(135deg, var(--eva-purple-700), var(--eva-purple-600)); color: #fff; }
.ocr-fabs.open .ocr-fab-items { pointer-events: auto; }
.ocr-fabs.open .ocr-fab-item { opacity: 1; transform: none; pointer-events: auto; transition-delay: calc(var(--i) * 55ms); }
.ocr-fab-lbl { position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%) translateX(-8px); white-space: nowrap; pointer-events: none;
    background: var(--eva-purple-900); color: #fff; font: 800 12.5px 'Tajawal', sans-serif; padding: 6px 11px; border-radius: 10px; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .5);
    opacity: 0; transition: opacity .25s, transform .25s; direction: rtl; }
.ocr-fabs.open .ocr-fab-item .ocr-fab-lbl { opacity: 1; transform: translateY(-50%); transition-delay: calc(120ms + var(--i) * 55ms); }
.ocr-fab-item.is-scan .ocr-fab-lbl { background: var(--eva-gold); color: var(--eva-purple-900); }
.ofm-hint { transform: translateY(-50%) rotate(0) !important; }
body.ocr-hint .ocr-fabs:not(.open) .ofm-hint { opacity: 1; }
.ocr-fabs.open .ofm-hint { display: none; }
body.ocr-hint .ocr-fabs:not(.open) .ocr-fab-main::after { content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid rgba(201, 162, 75, .7); animation: eva-ocr-ring 1.6s ease-out infinite; }
@keyframes eva-ocr-ring { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.4); opacity: 0; } }
@media (max-width: 600px) { .ocr-fab-item { width: 44px; height: 44px; font-size: 20px; } .ocr-fab-item.is-scan { width: 50px; height: 50px; } }
.ocr-pagepick { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(20, 8, 46, .55); }
.opp-card { background: #fff; border-radius: 18px; padding: 18px; width: min(320px, 86%); text-align: center; display: grid; gap: 8px; direction: rtl; }
.opp-card b { color: var(--eva-purple-900); font-size: 17px; } .opp-card small { color: var(--eva-muted); }
.opp-btns { display: flex; gap: 8px; } .opp-btns button { flex: 1; padding: 12px; border-radius: 12px; border: 0; background: var(--eva-purple-700); color: #fff; font: 800 15px 'Tajawal', sans-serif; cursor: pointer; }
.opp-cancel { border: 0; background: none; color: var(--eva-muted); font: 700 13px 'Tajawal', sans-serif; cursor: pointer; }

/* ---------- لوحة الإدارة: تبويب خادم EVA بعرض تبويب الأساتذة ---------- */
#adminPaneServer:not([hidden]) { display: block; columns: 2 380px; column-gap: 16px; width: 100%; }
#adminPaneServer .admin-panel-card { max-width: none !important; width: 100%; box-sizing: border-box; margin: 0 0 16px !important; break-inside: avoid; page-break-inside: avoid; display: inline-block; }
#adminPaneServer .switch-row { padding: 10px 0; border-bottom: 1px solid #f0ecf6; gap: 12px; }
#adminPaneServer .field-label { margin-top: 12px; }
#adminPaneUsers, #adminPaneServer { min-height: 420px; }
@media (max-width: 860px) { #adminPaneServer:not([hidden]) { columns: 1; } }

/* ---------- رأس القائمة الجانبية: معلومات الأستاذ ---------- */
.sidebar-header .sb-head-prof { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; color: #fff; }
.sb-head-prof .sbp-av { width: 48px; height: 48px; font-size: 18px; border: 2px solid rgba(255, 255, 255, .5); }
.sb-head-prof .sbp-main b { color: #fff; font-size: 16px; }
.sb-head-prof .sbp-main small { color: #d9cdf3; }
.sb-head-prof .sbp-plan { background: rgba(255, 255, 255, .14); color: var(--eva-gold-light, #f3d98b); }
.sb-head-prof .sbp-plan.is-admin { background: var(--eva-gold); color: var(--eva-purple-900); }
.sb-head-prof .sbp-days { color: #cdbfee; }

/* القائمة الجانبية: التمرير داخلها فقط */
#sidebar .sidebar-content { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#sidebar { overscroll-behavior: contain; }
html.eva-sb-lock, html.eva-sb-lock body { overflow: hidden !important; }
.sidebar-overlay { touch-action: none; overscroll-behavior: contain; }

/* ---------- طباعة أوراق OCR: بدون صفحات فارغة ---------- */
@media print {
    html, body.ocr-printing { margin: 0 !important; padding: 0 !important; height: auto !important; min-height: 0 !important; overflow: visible !important; display: block !important; background: #fff !important; }
    body.ocr-printing > *:not(.ocr-print-root) { display: none !important; }
    body.ocr-printing .ocr-print-root { display: block !important; position: static !important; margin: 0 !important; padding: 0 !important; }
    body.ocr-printing .ocr-sheet { margin: 0 !important; padding: 0 !important; }
    body.ocr-printing .ocr-sheet .ocr-page { margin: 0 !important; height: 296mm !important; }
}
.export-issues { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 4px; padding: 10px 12px; border-radius: 12px; background: #fff3f1; border: 1px solid #f4c7c1; color: #8f2a1d; font-size: 13px; line-height: 1.7; }
.export-issues[hidden] { display: none; }
.export-issues i { font-size: 20px; color: var(--eva-bad); flex: 0 0 auto; margin-top: 2px; }
.export-btn.is-blocked, .export-btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.5); }

/* ---------- رأس القائمة الجانبية: معلومات كاملة متكيّفة ---------- */
#sidebar .sidebar-header { position: relative; align-items: flex-start !important; padding: 16px 14px 14px !important; min-height: 0 !important; height: auto !important; }
#sidebar .sidebar-header .sidebar-close-btn { position: absolute !important; top: 12px; left: 12px; }
#sidebar .sidebar-brand.sb-head-prof { align-items: flex-start; padding-left: 46px; width: 100%; box-sizing: border-box; font-family: 'Tajawal', sans-serif; font-size: inherit; }
.sb-head-prof .sbp-main { gap: 4px !important; }
.sb-head-prof .sbp-main > b { white-space: normal !important; overflow: visible !important; line-height: 1.35; font-size: 16.5px !important; }
.sbp-line { display: flex; align-items: flex-start; gap: 6px; color: #e3d9f7; font-size: 12.5px; line-height: 1.5; white-space: normal; word-break: break-word; }
.sbp-line i { color: var(--eva-gold-light, #f3d98b); margin-top: 3px; flex: 0 0 auto; }
.sbp-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; }
.sb-head-prof .sbp-days { background: rgba(255, 255, 255, .12); padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.sb-head-prof .sbp-days.is-low { background: #e74c3c; color: #fff; }

/* شارة الاشتراك في الترويسة */
.header .meta-plan { gap: 6px; }
.header .meta-plan i { color: var(--eva-gold-light, #f3d98b); }
.header .meta-plan.is-low { background: rgba(231, 76, 60, .3) !important; border-color: rgba(255, 140, 120, .7) !important; }
.header .meta-plan.is-admin b { color: var(--eva-gold-light, #f3d98b); }
@media (max-width: 640px) { .header .meta-plan { order: 1; } .header #metaTeacher { order: 0; } #metaSchool { order: 2; } }

/* ---------- نافذة «حول التطبيق» ---------- */
.ab-modal .modal-content { max-width: 440px !important; width: calc(100% - 24px) !important; margin: 5vh auto !important; padding: 0 !important; border-radius: 24px !important; max-height: 90vh !important; overflow: auto !important; display: block !important; text-align: center; background: #fff !important; }
.ab-x { position: absolute !important; top: 12px; left: 12px; z-index: 3; }
.ab-hero { padding: 26px 20px 20px; color: #fff; background: radial-gradient(120% 90% at 50% 0%, var(--eva-purple-600), var(--eva-purple-900) 70%); border-bottom: 3px solid var(--eva-gold); }
.ab-logo { width: 84px; height: 84px; border-radius: 22px; background: #fff; padding: 4px; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .6); }
.ab-hero h3 { margin: 10px 0 2px; font-family: 'Amiri', serif; font-size: 34px; color: #fff !important; letter-spacing: 2px; }
.ab-hero p { margin: 0; color: #d9cdf3; font-size: 13.5px; }
.ab-ver { display: inline-block; margin-top: 10px; padding: 3px 12px; border-radius: 999px; background: var(--eva-gold); color: var(--eva-purple-900); font-weight: 800; font-size: 12.5px; }
.ab-body { padding: 18px 18px 16px; display: grid; gap: 14px; }
.ab-org { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ab-org-row { border: 1px solid var(--eva-line); border-radius: 14px; padding: 10px 8px; background: var(--eva-purple-50); display: flex; flex-direction: column; gap: 2px; }
.ab-org-row small { color: var(--eva-muted); font-size: 11.5px; }
.ab-company, .ab-branch { font-family: 'Tajawal', sans-serif; font-weight: 800; color: var(--eva-purple-900); letter-spacing: 1.2px; font-size: 14px; }
.ab-branch { color: var(--eva-gold-dark); }
.ab-eng { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 4px 0; }
.ab-eng small { color: var(--eva-muted); font-size: 11.5px; letter-spacing: .5px; }
.ab-sign { font-family: 'Amiri', serif; font-style: italic; font-weight: 700; font-size: 30px; line-height: 1.3;
    background: linear-gradient(90deg, var(--eva-gold-dark), var(--eva-gold), var(--eva-purple-700)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ab-sec { font-size: 12px; font-weight: 800; color: var(--eva-gold-dark); display: flex; align-items: center; gap: 8px; }
.ab-sec::before, .ab-sec::after { content: ''; flex: 1; height: 1px; background: var(--eva-line); }
.ab-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; text-align: right; }
.ab-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; border: 1px solid var(--eva-line); background: #fff; text-decoration: none; color: var(--eva-ink); transition: .15s; min-width: 0; }
.ab-link:hover { border-color: var(--eva-gold); transform: translateY(-1px); box-shadow: 0 8px 18px -12px rgba(74, 37, 130, .7); }
.ab-ic { flex: 0 0 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; color: #fff; background: var(--eva-purple-700); }
.ab-link.is-facebook .ab-ic { background: #1877f2; } .ab-link.is-instagram .ab-ic { background: linear-gradient(45deg, #f9a825, #e1306c, #833ab4); }
.ab-link.is-whatsapp .ab-ic { background: #25d366; } .ab-link.is-telegram .ab-ic { background: #229ed9; } .ab-link.is-youtube .ab-ic { background: #ff0000; }
.ab-link.is-linkedin .ab-ic { background: #0a66c2; } .ab-link.is-email .ab-ic { background: var(--eva-purple-600); } .ab-link.is-phone .ab-ic { background: #2e7d32; } .ab-link.is-website .ab-ic { background: var(--eva-gold-dark); }
.ab-txt { display: flex; flex-direction: column; min-width: 0; }
.ab-txt b { font-size: 13px; color: var(--eva-purple-900); } .ab-txt small { font-size: 11.5px; color: var(--eva-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.ab-foot { font-size: 11.5px; color: var(--eva-muted); padding-top: 6px; border-top: 1px dashed var(--eva-line); }
@media (max-width: 640px) { .ab-modal .modal-content { margin: 0 !important; position: fixed !important; bottom: 0; left: 0; right: 0; width: 100% !important; max-width: none !important; border-radius: 24px 24px 0 0 !important; max-height: 94vh !important; } }

/* لوحة الإدارة: حول التطبيق */
#adminPaneAbout:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 14px; align-items: start; }
#adminPaneAbout .admin-panel-card { max-width: none !important; margin: 0 !important; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.about-links { display: grid; gap: 8px; }
.about-link-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 40px; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--eva-line); border-radius: 14px; background: #fcfbff; }
.alr-toggle { width: 40px !important; height: 22px !important; margin: 0 !important; position: relative !important; cursor: pointer; justify-self: end; }
.alr-toggle input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.alr-toggle .toggle-slider { cursor: pointer; }
.alr-toggle .toggle-slider:before { height: 16px; width: 16px; }
.alr-toggle input:checked + .toggle-slider:before { transform: translateX(18px); }
.alr-main input.field-input { width: 100% !important; min-width: 0 !important; box-sizing: border-box; position: static !important; }
.alr-ic { flex: 0 0 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; background: var(--eva-purple-50); color: var(--eva-purple-700); }
.alr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 800; color: var(--eva-purple-900); }
.alr-main .field-input { padding: 8px 10px; font-size: 13.5px; }
@media (max-width: 860px) { #adminPaneAbout:not([hidden]) { grid-template-columns: 1fr; } .about-grid { grid-template-columns: 1fr; } }
.sb-foot b { color: var(--eva-purple-700); letter-spacing: .6px; }
#sidebar { width: min(330px, 88vw) !important; }
#sidebar .sidebar-header { flex: 0 0 auto !important; }
#sidebar .sidebar-content { flex: 1 1 auto !important; min-height: 0 !important; }
/* بطاقة الأستاذ في الترويسة: الاسم + المادة · المؤسسة + مدة الاشتراك */
.tid-txt .tid-sub { color: #e3d9f7 !important; font-weight: 600 !important; white-space: normal; }
.tid-plan { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; align-self: flex-start; font-size: 11px; font-weight: 800; color: var(--eva-purple-900); background: var(--eva-gold-light, #f3d98b); padding: 1px 8px; border-radius: 999px; }
.tid-plan.is-low { background: #e74c3c; color: #fff; }
.header .meta-plan { display: none !important; }
.header .meta-teacher { border-radius: 18px !important; text-align: right; }
@media (max-width: 640px) {
    .header .header-info-bar { flex-wrap: wrap !important; overflow: visible !important; justify-content: center !important; margin: 0 !important; }
    .header #metaTeacher { flex: 1 1 100% !important; justify-content: flex-start; padding: 6px 10px !important; white-space: normal !important; }
    .header #metaTeacher .tid-av { width: 38px; height: 38px; font-size: 14px; }
    .header #metaTeacher .tid-txt b { font-size: 13.5px; } .header #metaTeacher .tid-sub { font-size: 11.5px; line-height: 1.45; }
    .header #metaSchool { display: none !important; }
    .header .header-info-bar > *:not(#metaTeacher) { flex: 0 0 auto; }
}

/* ---------- الهاتف: زر القائمة العائم فوق الميكروفون، وتنزاح الأيقونات بينهما عند فتح البحث ---------- */
.fab-menu { max-height: 0; margin-bottom: 0 !important; transition: max-height .45s cubic-bezier(.2, .8, .2, 1), margin-bottom .45s cubic-bezier(.2, .8, .2, 1), opacity .3s, visibility .3s, transform .35s cubic-bezier(.2, .8, .2, 1); }
.fab-menu.open { max-height: 330px; margin-bottom: 12px !important; }
.fab-container .fab-nav { order: -1; }

/* ---------- النوافذ الكاملة على الهاتف (التصدير، المسح، الطباعة): ظاهرة من الأعلى حتى زر الخروج ---------- */
@media (max-width: 640px) {
    .export-card, .ocr-panel, .ocr-panel-wide, .esm-panel {
        box-sizing: border-box; padding-top: env(safe-area-inset-top, 0px);
        height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh;
    }
    .export-card .close-modal, .ocr-panel .ocr-x, .esm-panel .esm-x { margin-top: env(safe-area-inset-top, 0px); }
    .export-card .close-modal { top: calc(12px + env(safe-area-inset-top, 0px)) !important; }
    .ocr-modal, .eva-sheet-modal, .modal[style*="display: block"] { min-height: 100dvh; }
}
@media (max-width: 640px) and (orientation: landscape) {
    .export-card, .ocr-panel, .ocr-panel-wide, .esm-panel { height: 100dvh; max-height: 100dvh; }
}

/* ---------- أزرار البحث اليدوي والفلاتر (تلاميذ بعلامة صفر · فراغات ونقاط ناقصة · بحث): هوية التطبيق ---------- */
.fab-menu .fab-item { background: #fff !important; border: 1.5px solid rgba(201, 162, 75, .7) !important; box-shadow: 0 10px 22px -12px rgba(74, 37, 130, .75) !important; }
.fab-menu .fab-item i { font-size: 21px; color: var(--eva-purple-700) !important; }
.fab-menu .fab-item:hover { border-color: var(--eva-gold) !important; background: #fffaf0 !important; }
#fabZeroBtn i, #fabResetBtn i { color: var(--eva-purple-800) !important; }
#fabEmptyBtn i { color: var(--eva-gold-dark) !important; }
#fabSearchBtn i, #fabScanBtn i { color: var(--eva-purple-600) !important; }

/* ---------- نافذة طباعة ورقة حجز النقاط على الهاتف: زرا الطباعة والمسح عائمان ---------- */
.ocr-pfabs { display: none; }
@media (max-width: 640px) {
    #ocrPrintModal .ocr-print-side #ocrDoPrint, #ocrPrintModal .ocr-print-side #ocrGoScan { display: none !important; }
    #ocrPrintModal .ocr-print-body { padding-bottom: 88px; }
    #ocrPrintModal .ocr-pfabs { display: flex; position: absolute; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); justify-content: center; gap: 12px; z-index: 30; pointer-events: none; }
    #ocrPrintModal .ocr-pfab { pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--eva-gold); border-radius: 999px; padding: 0 20px; height: 52px; cursor: pointer;
        background: #fff; color: var(--eva-purple-800); font: 800 15px 'Tajawal', sans-serif; box-shadow: 0 14px 28px -12px rgba(74, 37, 130, .85); transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
    #ocrPrintModal .ocr-pfab i { font-size: 22px; color: var(--eva-purple-700); }
    #ocrPrintModal .ocr-pfab.is-main { background: linear-gradient(135deg, var(--eva-purple-700), var(--eva-purple-600)); color: #fff; }
    #ocrPrintModal .ocr-pfab.is-main i { color: var(--eva-gold-light, #f3d98b); }
    #ocrPrintModal .ocr-pfab:active { transform: scale(.94); }
    #ocrPrintModal .ocr-panel { position: relative; }
}

/* ---------- زر إغلاق القائمة الجانبية: دائرة أنيقة مثل زري الكاميرا والميكروفون، والإكس متوسّط تماماً ---------- */
#sidebar .sidebar-close-btn.eva-x, #sidebar .sidebar-header .sidebar-close-btn {
    width: 40px !important; height: 40px !important; min-width: 40px; border-radius: 50% !important; padding: 0 !important; margin: 0 !important;
    display: grid !important; place-items: center !important; line-height: 0 !important; font-size: 0 !important;
    background: linear-gradient(135deg, var(--eva-gold-light, #f3d98b), var(--eva-gold)) !important; color: var(--eva-purple-900) !important;
    border: 2px solid rgba(255, 255, 255, .75) !important; box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .6) !important;
    transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), background .3s, box-shadow .3s !important; overflow: hidden;
}
#sidebar .sidebar-close-btn i { display: block; font-size: 19px !important; line-height: 1 !important; margin: 0 !important; transform: none !important; color: inherit !important; }
#sidebar .sidebar-close-btn:hover, #sidebar .sidebar-close-btn:focus-visible { transform: rotate(90deg) scale(1.06) !important; background: #fff !important; }

/* ---------- نافذة التصدير إلى الرقمنة: الهوية البصرية نفسها لبقية النوافذ ---------- */
#exportModal .export-card { border-radius: 24px !important; border: 0 !important; box-shadow: 0 30px 70px -20px rgba(20, 8, 46, .7) !important; overflow: hidden !important; background: #fff !important; }
#exportModal .ex-head { display: flex !important; align-items: center !important; justify-content: space-between; padding: 15px 62px 14px 18px !important; margin: 0 !important;
    background: linear-gradient(135deg, var(--eva-purple-900), var(--eva-purple-700)) !important; border-bottom: 3px solid var(--eva-gold) !important; color: #fff !important; }
#exportModal .ex-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
#exportModal .ex-title > i { font-size: 30px; color: var(--eva-gold-light, #f3d98b); flex: 0 0 auto; }
#exportModal .ex-title h3 { margin: 0 !important; font-size: 18px !important; font-weight: 800; color: #fff !important; display: block !important; }
#exportModal .ex-title small { display: block; color: #cdbfee; font-size: 12.5px; line-height: 1.5; }
#exportModal .export-card .close-modal { left: 12px !important; }
#exportModal .export-steps { background: var(--eva-purple-50); border-bottom: 1px solid var(--eva-line); padding: 11px 14px; flex-wrap: wrap; }
#exportModal .remark-step { background: #fff; }
#exportModal .rs-lead { color: var(--eva-purple-900); }
#exportModal .export-send { margin: 0; padding: 14px 18px 16px; background: linear-gradient(180deg, #fff, var(--eva-purple-50)); border-top: 1px solid var(--eva-line); }
#exportModal .export-send .field-label { margin-top: 0; }
#exportModal .export-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
#exportModal .export-btn { flex: 1 1 210px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 16px; border-radius: 14px; cursor: pointer; font: 800 14.5px 'Tajawal', sans-serif; transition: transform .2s, filter .2s, box-shadow .2s; }
#exportModal .export-btn i { font-size: 19px; }
#exportModal .export-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
#exportModal .export-btn.is-mail { background: linear-gradient(135deg, var(--eva-purple-700), var(--eva-purple-600)) !important; color: #fff !important; border: 0 !important; box-shadow: 0 12px 22px -12px rgba(74, 37, 130, .9); }
#exportModal .export-btn.is-mail i { color: var(--eva-gold-light, #f3d98b) !important; }
#exportModal .export-btn.is-local { background: #fff !important; color: var(--eva-purple-800) !important; border: 1.5px solid var(--eva-gold) !important; }
#exportModal .export-btn.is-local i { color: var(--eva-gold-dark) !important; }
@media (max-width: 640px) { #exportModal .ex-head { padding: 14px 58px 12px 14px !important; } #exportModal .ex-title > i { font-size: 26px; } }

/* ---------- الفصل والقسم والوضع يبقون في الأعلى عند التمرير: على الحاسوب والهاتف معاً ---------- */
.eva-minibar { display: flex !important; }
body.eva-mini .eva-minibar { transform: none !important; opacity: 1 !important; pointer-events: auto !important; }
body:has(#adminAppTab[style*="block"]) .eva-minibar, body:has(#mainContentView[style*="none"]) .eva-minibar { display: none !important; }
@media (min-width: 901px) {
    .eva-minibar { left: 50%; right: auto; width: min(980px, calc(100% - 40px)); transform: translate(-50%, -110%); border-radius: 0 0 18px 18px; padding-inline: 16px; }
    body.eva-mini .eva-minibar { transform: translate(-50%, 0) !important; }
    .mb-class { font-size: 15px; }
    .mb-mode { font-size: 12.5px; }
}

/* ---------- الهاتف: خيارات OCR تنزاح للأعلى دون مسافة فارغة عند الإغلاق ---------- */
.ocr-fabs { margin-bottom: 0 !important; }
.ocr-fab-items { max-height: 0 !important; margin-bottom: 0 !important; overflow: visible; transition: max-height .45s cubic-bezier(.2, .8, .2, 1), margin-bottom .45s cubic-bezier(.2, .8, .2, 1); }
.ocr-fabs.open .ocr-fab-items { max-height: 260px !important; margin-bottom: 12px !important; }

/* ---------- الحساب والاشتراك + لوحة الإدارة (Supabase) ---------- */
.auth-link { background: none; border: 0; color: var(--eva-purple-600); font: 700 13px 'Tajawal', sans-serif; cursor: pointer; padding: 6px 0 0; text-decoration: underline; text-underline-offset: 3px; justify-self: center; }
.auth-note { display: block; text-align: center; color: var(--eva-muted); font-size: 12px; line-height: 1.6; margin-top: 4px; }
.acc-products { display: grid; gap: 8px; }
.acc-prod { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; border: 1.5px solid var(--eva-line); background: #fff; }
.acc-prod > i { font-size: 28px; color: var(--eva-purple-600); background: var(--eva-purple-50); border-radius: 12px; padding: 8px; flex: 0 0 auto; }
.acc-prod b { display: block; color: var(--eva-purple-900); font-size: 15px; }
.acc-prod small { display: block; color: var(--eva-muted); font-size: 12px; }
.acc-prod span { display: inline-block; margin-top: 4px; font-size: 12.5px; font-weight: 800; padding: 2px 10px; border-radius: 999px; }
.acc-prod.is-on span { background: #e5f6ec; color: #1e7a46; }
.acc-prod.is-low span { background: #fff1d6; color: #9a5b00; }
.acc-prod.is-off span { background: #fdecec; color: #b3261e; }
.acc-prod.is-off { opacity: .85; }
.acc-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.acc-row .acc-code { flex: 1 1 220px; font: 700 16px ui-monospace, monospace; letter-spacing: 1px; text-align: center; text-transform: uppercase; }
.acc-devices { display: grid; gap: 8px; margin-top: 10px; }
.acc-dev { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--eva-line); border-radius: 12px; }
.acc-dev > i { font-size: 24px; color: var(--eva-purple-600); flex: 0 0 auto; }
.acc-dev > div { flex: 1; min-width: 0; }
.acc-dev b { display: block; font-size: 14px; color: var(--eva-purple-900); }
.acc-dev small { color: var(--eva-muted); font-size: 12px; }
.acc-dev.is-me { border-color: var(--eva-gold); background: #fffbf0; }
.acc-dev .st-btn { padding: 7px 10px; font-size: 12.5px; }
.acc-grid, .adm-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; }
.acc-grid label, .adm-form label { display: grid; gap: 4px; }
.acc-modal .st-block h4 { margin: 0 0 6px; }
.auc-plan.is-off { color: #b3261e; }
.adm-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.adm-choice { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border: 1.5px solid var(--eva-line); border-radius: 12px; cursor: pointer; }
.adm-choice:has(input:checked) { border-color: var(--eva-purple-600); background: var(--eva-purple-50); }
.adm-choice input[type=radio] { margin-top: 4px; accent-color: var(--eva-purple-700); }
.adm-choice b { display: block; font-size: 13.5px; color: var(--eva-purple-900); }
.adm-choice small { display: block; font-size: 11.5px; color: var(--eva-muted); }
.adm-choice .field-input { margin-top: 6px; padding: 6px 8px; }
.adm-table-wrap { overflow-x: auto; margin-top: 8px; border: 1px solid var(--eva-line); border-radius: 12px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table th { background: var(--eva-purple-50); color: var(--eva-purple-900); font-weight: 800; padding: 8px 10px; text-align: right; white-space: nowrap; }
.adm-table td { padding: 8px 10px; border-top: 1px solid var(--eva-line); vertical-align: middle; }
.adm-td-act { white-space: nowrap; display: flex; gap: 6px; }
.cg-out .cg-list { width: 100%; font: 700 14px ui-monospace, monospace; margin-top: 10px; resize: vertical; }
#cgResult:not(:empty) { margin-top: 12px; }
#adminSignupCard:empty { display: none; }
@media (max-width: 560px) { .acc-row .st-btn { flex: 1 1 100%; } }
.acc-modal { z-index: 100001 !important; }
.acc-grid .field-input, .adm-form .field-input, .adm-form select.field-input { width: 100% !important; box-sizing: border-box !important; min-width: 0 !important; margin: 0 !important; }
.adm-form label[hidden] { display: none !important; }
.admin-user-card .auc-plan { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; line-height: 1.6; height: auto !important; }

/* ---------- لوحة الإدارة على الهاتف: التبويبات والأزرار تلتف، ولا شيء يتجاوز عرض الشاشة ---------- */
.admin-tabs { max-width: 100%; box-sizing: border-box; flex-wrap: wrap; }
.auc-actions { flex-wrap: wrap; }
.admin-wrap, .admin-panel-card, .admin-user-card { min-width: 0; max-width: 100%; box-sizing: border-box; }
@media (max-width: 640px) {
    .admin-tabs { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 4px !important; }
    .admin-tab { flex-direction: column; justify-content: center; gap: 3px !important; padding: 9px 4px !important; font-size: 12.5px !important; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .admin-tab i { font-size: 20px; }
    .auc-actions .acb { flex: 1 1 calc(50% - 6px); min-width: 0; font-size: 12.5px; padding: 9px 6px; }
    .auc-actions .acb-del { flex: 0 0 46px; }
    body { overflow-x: clip; }
}
/* حقول لوحة الإدارة لا تتجاوز بطاقتها */
.admin-pane input.field-input, .admin-pane select.field-input, .admin-pane textarea.field-input { width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; margin-left: 0 !important; margin-right: 0 !important; min-width: 0 !important; }
.admin-pane label { min-width: 0; max-width: 100%; }
/* v24: نافذة الحفظ والبيانات على الهاتف — كاملة دون قص، والتبويبات في شبكة 2×2 */
.st-modal .st-body{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch}
@media (max-width: 640px){
  .st-modal .modal-content{max-height:92dvh!important;max-height:92svh!important;padding-bottom:env(safe-area-inset-bottom,0px)!important}
  .st-modal .st-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px}
  .st-modal .st-tab{font-size:12.5px;padding:9px 4px}
  .st-modal .st-body{padding-bottom:calc(24px + env(safe-area-inset-bottom,0px))!important}
}
