@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@400;700;800&family=Amiri:wght@400;700&family=Cairo:wght@400;500;600;700;800&family=Changa:wght@400;500;600;700&family=El+Messiri:wght@400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Lateef:wght@400;500;600;700&family=Mada:wght@400;500;600;700&family=Markazi+Text:wght@400;500;600;700&family=Noto+Kufi+Arabic:wght@400;500;600;700&family=Noto+Naskh+Arabic:wght@400;500;600;700&family=Noto+Sans+Arabic:wght@400;500;600;700;800&family=Readex+Pro:wght@400;500;600;700&family=Reem+Kufi:wght@400;500;600;700&family=Tajawal:wght@400;500;700;800&display=swap');
:root{
  --night:#10163c;--navy:#17275d;--blue:#235cbd;--indigo:#3739b9;--violet:#7243db;--pink:#e258aa;
  --ink:#181b31;--muted:#6f7487;--bg:#f4f6fb;--panel:#fff;--line:#e1e5ef;--soft:#f8f9fd;
  --success:#148862;--warning:#b87508;--danger:#cf4056;--radius:22px;--shadow:0 20px 60px rgba(19,24,67,.11);
}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);font-family:"IBM Plex Sans Arabic","Cairo",Tahoma,Arial,sans-serif;font-size:17px}button,input,select,textarea{font:inherit}button{cursor:pointer}img{max-width:100%}.hidden{display:none!important}.span-all{grid-column:1/-1}.wide{width:100%}.small{padding:9px 12px!important;font-size:.8rem!important}.app{min-height:100vh}.eyebrow{display:inline-block;color:var(--violet);font-weight:800;font-size:.82rem}.eyebrow.light{color:#ffb9e1}
.btn{border:0;border-radius:14px;padding:12px 18px;font-weight:800;display:inline-flex;align-items:center;justify-content:center;gap:8px;transition:.2s;white-space:nowrap}.btn img{width:19px;height:19px}.btn:hover{transform:translateY(-1px)}.btn.primary{color:#fff;background:linear-gradient(135deg,var(--blue),var(--indigo) 50%,var(--violet));box-shadow:0 10px 24px rgba(55,57,185,.23)}.btn.secondary{color:var(--navy);background:#fff;border:1px solid #d9deeb}.btn.ghost{color:var(--navy);background:#eef1fa}.btn.glass{color:#fff;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.25)}.btn.danger{color:var(--danger);background:#fff0f3}.icon-button{width:42px;height:42px;border:1px solid var(--line);background:#fff;border-radius:12px;display:grid;place-items:center}.icon-button img{width:19px}
.panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:25px;box-shadow:0 10px 34px rgba(21,28,76,.045)}
label{display:flex;flex-direction:column;gap:7px}label>span{font-size:.82rem;font-weight:800;color:#41475d}input,select,textarea{width:100%;border:1px solid #dce1ec;background:#fbfcff;border-radius:13px;padding:12px 13px;outline:none;color:var(--ink);transition:.18s}input:focus,select:focus,textarea:focus{border-color:#6c52d7;box-shadow:0 0 0 4px rgba(104,76,213,.1);background:#fff}textarea{min-height:118px;resize:vertical;line-height:1.8}input[type=color]{height:51px;padding:5px;background:#fff;cursor:pointer}.form-grid{display:grid;gap:16px}.form-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.form-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.form-grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}.form-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-top:22px}.check-row{display:flex;align-items:flex-start;flex-direction:row;gap:10px;border:1px dashed #cdd3e2;background:#fafbfe;padding:12px 14px;border-radius:14px}.check-row input{width:auto;margin-top:4px}.check-row span{line-height:1.8;color:var(--muted);font-size:.8rem}.check-row button{border:0;background:none;padding:0;color:var(--violet);font-weight:800;text-decoration:underline}.check-row.compact{align-items:center;padding:11px}.check-row.compact input{margin:0}
/* Auth */
.auth-screen{min-height:100vh;display:grid;grid-template-columns:1.05fr .95fr;background:#fff}.auth-visual{position:relative;overflow:hidden;padding:70px clamp(35px,7vw,100px);display:flex;flex-direction:column;justify-content:center;color:#fff;background:radial-gradient(circle at 8% 8%,rgba(226,88,170,.34),transparent 35%),linear-gradient(140deg,#10153b 0%,#213b91 48%,#7044d9 100%)}.auth-orbit{position:absolute;border:1px solid rgba(255,255,255,.13);border-radius:50%}.orbit-one{width:560px;height:560px;left:-260px;bottom:-280px}.orbit-two{width:330px;height:330px;right:-160px;top:-120px}.auth-brand-card{position:relative;z-index:2;display:flex;align-items:center;gap:16px;width:max-content;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.2);border-radius:22px;padding:13px 17px;backdrop-filter:blur(12px)}.auth-brand-card img{width:72px;height:72px;object-fit:contain;background:#fff;border-radius:17px;padding:7px}.auth-brand-card span,.auth-brand-card h1{display:block;margin:0}.auth-brand-card span{color:#dcdffe;font-size:.75rem}.auth-brand-card h1{font-size:1.65rem}.auth-visual>h2{position:relative;z-index:2;font-size:clamp(2.4rem,4.6vw,5rem);line-height:1.35;margin:34px 0 15px}.auth-visual>h2 em{font-style:normal;color:#ffb8e1}.auth-visual>p{position:relative;z-index:2;max-width:650px;color:#dde2ff;line-height:2;margin:0}.auth-pills{display:flex;gap:10px;flex-wrap:wrap;margin-top:25px;position:relative;z-index:2}.auth-pills span{padding:8px 12px;border:1px solid rgba(255,255,255,.22);background:rgba(255,255,255,.07);border-radius:99px;font-size:.73rem}.auth-form-side{display:grid;place-items:center;padding:36px;background:linear-gradient(180deg,#fff,#f8f9fd)}.auth-card{width:min(650px,100%)}.auth-tabs{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:5px;background:#eef0f7;border-radius:17px;margin-bottom:20px}.auth-tab{border:0;background:transparent;padding:12px;border-radius:12px;font-weight:800;color:#696d80}.auth-tab.active{background:#fff;color:var(--indigo);box-shadow:0 7px 22px rgba(29,34,80,.09)}.auth-form{display:none;gap:15px}.auth-form.active{display:grid}.auth-title h2{font-size:2rem;margin:0 0 6px}.auth-title p{margin:0;color:var(--muted)}.auth-demo{display:block;color:var(--muted);line-height:1.8;background:#f5f6fb;border-radius:12px;padding:10px 12px}
/* Topbar / Sidebar */
.topbar{height:84px;position:sticky;top:0;z-index:70;background:rgba(255,255,255,.95);backdrop-filter:blur(18px);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:15px;padding:0 24px}.menu-button{width:48px;height:48px;border:1px solid #dce1ec;border-radius:15px;background:#fff;display:grid;place-items:center;box-shadow:0 6px 18px rgba(18,24,66,.06)}.menu-button img{width:22px}.topbar-separator{width:1px;height:35px;background:#dfe3ec}.topbar-brand{display:flex;align-items:center;gap:12px}.brand-logo-box{width:52px;height:52px;display:grid;place-items:center;background:#fff;border:1px solid #e0e4ed;border-radius:15px;padding:6px;box-shadow:0 7px 17px rgba(21,27,70,.06)}.brand-logo-box img{width:100%;height:100%;object-fit:contain}.topbar-brand b,.topbar-brand span{display:block}.topbar-brand b{font-size:1.06rem}.topbar-brand span{font-size:.7rem;color:var(--muted)}.topbar-actions{margin-right:auto;display:flex;align-items:center;gap:10px}.subscription-badge{padding:8px 12px;border-radius:99px;background:#eaf7f1;color:var(--success);font-size:.72rem;font-weight:800}.subscription-badge.expired{background:#fff0f2;color:var(--danger)}.subscription-badge.warning{background:#fff7e7;color:var(--warning)}
.sidebar{position:fixed;right:0;top:0;bottom:0;width:320px;padding:18px 20px 22px;background:linear-gradient(180deg,#11163c 0%,#202d79 56%,#6337c3 100%);z-index:130;color:#fff;transform:translateX(103%);transition:.28s;box-shadow:-28px 0 68px rgba(17,20,61,.32);display:flex;flex-direction:column}.sidebar.open{transform:translateX(0)}.sidebar-brand-wrap{padding-bottom:16px;border-bottom:1px solid rgba(255,255,255,.18);margin-bottom:9px}.sidebar-brand-card{background:#fff;color:var(--night);border-radius:21px;padding:12px 14px;display:flex;align-items:center;gap:12px;box-shadow:0 14px 34px rgba(0,0,0,.2)}.sidebar-logo-box{width:60px;height:60px;background:#fff;border:1px solid #e3e5ed;border-radius:16px;padding:6px;display:grid;place-items:center}.sidebar-logo-box img{width:100%;height:100%;object-fit:contain}.sidebar-brand-card b,.sidebar-brand-card span{display:block}.sidebar-brand-card b{font-size:1.05rem}.sidebar-brand-card span{font-size:.7rem;color:#686d80}.sidebar-nav{display:flex;flex-direction:column;overflow:auto;padding:2px 0}.nav-item{border:0;border-bottom:1px solid rgba(255,255,255,.13);background:transparent;color:#e9eaff;padding:14px 10px;display:flex;align-items:center;gap:13px;text-align:right;position:relative;transition:.18s}.nav-item:first-child{border-top:1px solid rgba(255,255,255,.13)}.nav-item img{width:21px;height:21px;filter:brightness(0) invert(1);opacity:.73}.nav-item:hover,.nav-item.active{background:linear-gradient(90deg,rgba(226,88,170,.22),rgba(255,255,255,.04));color:#fff;padding-right:15px}.nav-item.active:after{content:"";position:absolute;right:0;width:4px;height:58%;border-radius:5px;background:linear-gradient(#ff88cc,#fff)}.nav-item.locked{opacity:.48}.sidebar-legal{margin-top:auto;padding-top:14px;display:flex;align-items:center;gap:10px}.sidebar-legal button{border:0;background:none;color:#dce0ff;padding:0;font-size:.7rem}.sidebar-legal i{width:1px;height:15px;background:rgba(255,255,255,.25)}.sidebar-version{margin-top:10px;font-size:.65rem;color:#bbbff3}.overlay{position:fixed;inset:0;background:rgba(11,13,42,.5);z-index:120;opacity:0;visibility:hidden;transition:.2s}.overlay.show{opacity:1;visibility:visible}
/* Main */
.main{max-width:1520px;margin:auto;padding:32px clamp(14px,3vw,46px) 88px}.view{display:none}.view.active{display:block;animation:viewIn .24s}@keyframes viewIn{from{opacity:0;transform:translateY(8px)}}.page-heading{margin:3px 0 25px}.page-heading.split{display:flex;justify-content:space-between;align-items:flex-end;gap:20px}.page-heading h2{font-size:clamp(2rem,3vw,2.75rem);margin:7px 0}.page-heading p{margin:0;color:var(--muted)}
.hero-card{min-height:470px;border-radius:34px;overflow:hidden;background:radial-gradient(circle at 12% 10%,rgba(226,88,170,.25),transparent 35%),linear-gradient(135deg,#10163c,#203e95 52%,#7041d7);color:#fff;display:grid;grid-template-columns:1.08fr .92fr;align-items:center;padding:55px clamp(30px,5vw,78px);box-shadow:var(--shadow);position:relative}.hero-card:after{content:"";position:absolute;top:0;right:0;left:0;height:5px;background:linear-gradient(90deg,#2a75df,#8b57e8,#ef70bd)}.hero-content{position:relative;z-index:2}.hero-card h1{font-size:clamp(2.5rem,4.6vw,5rem);line-height:1.3;margin:12px 0 18px}.hero-card h1 em{font-style:normal;color:#ffb9e1}.hero-card p{color:#dfe5ff;line-height:2;max-width:650px}.hero-actions{display:flex;gap:11px;flex-wrap:wrap;margin-top:28px}.hero-card>img{max-height:350px;justify-self:center;filter:drop-shadow(0 24px 34px rgba(0,0,0,.28))}.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:17px;margin-top:20px}.stats-grid article{background:#fff;border:1px solid var(--line);border-radius:21px;padding:20px 22px}.stats-grid span,.stats-grid b,.stats-grid small{display:block}.stats-grid span{color:var(--violet);font-size:.72rem;font-weight:800}.stats-grid b{font-size:2rem;margin:4px 0}.stats-grid small{color:var(--muted)}.access-notice{margin-top:18px;background:#fff6e8;border:1px solid #f0d29a;border-radius:19px;padding:18px 20px;display:flex;align-items:center;justify-content:space-between;gap:18px}.access-notice b,.access-notice p{display:block;margin:0}.access-notice p{color:#805e2b;margin-top:4px}
/* Profile */
.profile-panel{padding:28px}.profile-assets-title{margin:28px 0 14px;padding-top:22px;border-top:1px solid var(--line)}.profile-assets-title h3,.profile-assets-title p{margin:0}.profile-assets-title p{color:var(--muted);font-size:.8rem;margin-top:4px}.fixed-assets-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.fixed-asset-card{border:1px solid var(--line);border-radius:18px;padding:12px;background:#fafbfe;display:grid;gap:10px}.asset-preview{height:125px;border:1px dashed #cad0df;border-radius:13px;background:#fff;display:grid;place-items:center;position:relative;overflow:hidden}.asset-preview img{max-width:90%;max-height:85px;object-fit:contain;display:none}.asset-preview img.has-image{display:block}.asset-preview span{position:absolute;bottom:8px;font-size:.68rem;color:#83879a}.upload-mini{position:relative;display:block}.upload-mini input{position:absolute;inset:0;opacity:0;cursor:pointer}.upload-mini span{display:block;text-align:center;padding:9px 11px;border-radius:11px;background:#eef1fb;color:var(--navy);font-weight:800;font-size:.75rem}.profile-check{margin-top:17px}
/* Wizard */
.wizard-shell{max-width:1200px;margin:auto}.wizard-steps{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-bottom:18px}.wizard-step{background:#e8eaf2;color:#717589;padding:12px 8px;border-radius:14px;text-align:center;font-size:.76rem;font-weight:800;position:relative}.wizard-step.active,.wizard-step.done{color:#fff;background:linear-gradient(135deg,var(--blue),var(--indigo),var(--violet));box-shadow:0 9px 22px rgba(57,56,184,.16)}.wizard-step.done:after{content:"✓";margin-right:5px}.wizard-form{padding:31px}.wizard-page{display:none;min-height:455px}.wizard-page.active{display:block}.section-head{display:flex;align-items:center;gap:14px;margin-bottom:24px;padding-bottom:18px;border-bottom:1px solid var(--line)}.section-head>b{width:54px;height:54px;border-radius:17px;display:grid;place-items:center;background:linear-gradient(135deg,var(--blue),var(--indigo),var(--violet));color:#fff}.section-head h3,.section-head p{margin:0}.section-head h3{font-size:1.35rem}.section-head p{color:var(--muted);font-size:.78rem;margin-top:3px}.wizard-nav{display:flex;align-items:center;justify-content:space-between;margin-top:28px;padding-top:18px;border-top:1px solid var(--line)}.wizard-nav span{color:var(--muted);font-size:.78rem}.upload-zone{border:2px dashed #c7cde0;border-radius:20px;background:#fafbff;padding:35px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;margin-top:22px}.upload-zone:hover{border-color:#7456d7;background:#f7f4ff}.upload-zone img{width:40px}.upload-zone span{font-size:.75rem;color:var(--muted)}.image-editor{display:grid;grid-template-columns:repeat(3,1fr);gap:13px;margin-top:16px}.image-card{border:1px solid var(--line);border-radius:16px;overflow:hidden;background:#fff;position:relative}.crop-box{aspect-ratio:4/3;overflow:hidden;position:relative;cursor:grab;background:#eef1f8;touch-action:none}.crop-box img{width:100%;height:100%;object-fit:cover;transform-origin:center}.image-card .remove{position:absolute;z-index:4;top:7px;left:7px;width:31px;height:31px;border:0;border-radius:9px;background:rgba(16,22,60,.86);color:#fff}.crop-toolbar{padding:8px;display:flex;align-items:center;gap:8px}.crop-toolbar input{padding:0;border:0}.image-card>input{border:0;border-top:1px solid var(--line);border-radius:0}.final-summary{text-align:center;padding:58px 20px;border:1px dashed #c8cede;border-radius:21px;background:linear-gradient(180deg,#fdfdff,#f7f6ff)}.final-icon{width:70px;height:70px;border-radius:50%;display:grid;place-items:center;margin:auto;background:linear-gradient(135deg,#208cb5,#32bc91);color:#fff;font-size:2rem}.final-summary h3{font-size:1.6rem;margin:14px 0 6px}.final-summary p{margin:0;color:var(--muted)}.final-actions{display:flex;justify-content:center;gap:12px;margin-top:20px}
/* Lists / Tables */
.cards-list{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.report-card{background:#fff;border:1px solid var(--line);border-radius:20px;padding:20px}.report-card .tag{display:inline-block;background:#eee9ff;color:#6334bd;border-radius:99px;padding:5px 9px;font-size:.68rem;font-weight:800}.report-card h3{margin:12px 0 5px}.report-card p{margin:3px 0;color:var(--muted);font-size:.76rem}.card-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:16px}.empty-state{grid-column:1/-1;text-align:center;background:#fff;border:1px dashed #c9cfdd;border-radius:20px;padding:55px 20px;color:var(--muted)}.two-col{display:grid;grid-template-columns:395px 1fr;gap:18px}.asset-form{display:grid;gap:14px}
.signature-board{border:1px dashed #c8cedd;border-radius:16px;background:#fafbfe;padding:11px}.signature-board-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:9px}.signature-board canvas{width:100%;height:180px;background:#fff;border:1px solid #dce1eb;border-radius:12px;touch-action:none;display:block}.signature-board small{display:block;margin-top:7px;color:var(--muted);font-size:.7rem}.asset-list{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.asset-card{border:1px solid var(--line);border-radius:16px;padding:10px;text-align:center;position:relative}.asset-card img{width:100%;height:105px;object-fit:contain}.asset-card b,.asset-card small{display:block}.asset-card small{color:var(--muted);font-size:.68rem}.asset-card button{position:absolute;top:6px;left:6px;border:0;border-radius:8px;background:#fff0f3;color:var(--danger)}.inline-form{display:grid;grid-template-columns:180px 1fr 220px auto;gap:12px;margin-bottom:16px}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;min-width:780px}th,td{padding:13px;border-bottom:1px solid var(--line);text-align:right;vertical-align:middle}th{font-size:.75rem;color:#555a6e;background:#fafbfe}td{font-size:.8rem}.table-actions{display:flex;gap:5px;flex-wrap:wrap}.table-actions button{padding:7px 9px;border:0;border-radius:9px;font-size:.67rem;font-weight:800}.action-edit{background:#edf2ff;color:#2550a2}.action-plan{background:#eaf8f3;color:#147756}.action-trial{background:#fff5e6;color:#9a6307}.action-suspend{background:#fff0f2;color:#b73549}.status-pill{display:inline-block;border-radius:99px;padding:5px 9px;font-size:.68rem;font-weight:800;background:#eef0f6;color:#686d80}.status-pill.active{background:#e8f8f1;color:#117653}.status-pill.trial{background:#eef4ff;color:#2456a8}.status-pill.expired{background:#fff0f2;color:#b6364a}.status-pill.pending{background:#fff5e5;color:#9b650b}
/* Schedule */
.schedule-settings{margin-bottom:18px}.schedule-print-area{position:relative;isolation:isolate;overflow:hidden;background:#fff;font-family:var(--schedule-font,"Cairo")}.schedule-watermark{position:absolute;inset:0;z-index:5;display:none;align-items:center;justify-content:center;pointer-events:none;overflow:hidden}.schedule-watermark.has-image{display:flex}.schedule-watermark img{display:block;width:min(38%,360px);max-width:360px;max-height:72%;object-fit:contain;opacity:.11;filter:saturate(.75);user-select:none}.schedule-print-header{position:relative;z-index:2;text-align:center;margin-bottom:13px}.schedule-print-header h2{margin:0;font-size:1.55rem;font-family:var(--schedule-font,"Cairo")}.schedule-grid{position:relative;z-index:2;display:grid;grid-template-columns:86px repeat(8,minmax(68px,1fr));width:100%;border:1px solid #bac7dd;border-radius:15px;overflow:hidden}.schedule-cell{min-height:58px;border-left:1px solid #c7d1df;border-bottom:1px solid #c7d1df;background:var(--schedule-cell,#fff);color:var(--schedule-cell-text,#111);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:5px;font-family:var(--schedule-font,"Cairo");font-size:var(--schedule-size,11px)}button.schedule-cell{border-top:0;border-right:0}.schedule-cell.head{min-height:42px;color:var(--schedule-head-text,#fff);background:var(--schedule-head,#173f78);font-weight:800}.schedule-cell.day{background:var(--schedule-day,#e9f2ff);color:var(--schedule-day-text,#111);font-weight:800}.schedule-cell span{font-size:.67em;color:inherit;opacity:.72}.schedule-signatures{position:relative;z-index:2;display:flex;justify-content:space-between;margin-top:16px;padding:0 25px;font-family:var(--schedule-font,"Cairo")}.schedule-signatures>div{min-width:230px;text-align:center}.schedule-signatures b,.schedule-signatures span{display:block}.schedule-signatures span{margin-top:5px}.teacher-sign{text-align:right!important}.principal-sign{text-align:left!important}
/* Plans */
.plans-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.plans-grid article{background:#fff;border:1px solid var(--line);border-radius:25px;padding:30px;text-align:center;position:relative}.plans-grid article.featured{border-color:#8054dc;box-shadow:0 22px 48px rgba(101,61,198,.16);transform:translateY(-8px)}.plans-grid article>span{display:inline-block;background:#eee9ff;color:#6635bf;padding:5px 9px;border-radius:99px;font-size:.69rem;font-weight:800}.plans-grid h3{font-size:1.6rem}.plans-grid b{display:block;font-size:2.1rem;margin:13px}.plans-grid b small{font-size:.75rem}.plan-request-status{margin-top:20px;text-align:center;color:var(--muted)}
/* Admin */
.admin-top-grid{display:grid;grid-template-columns:1fr 1.25fr;gap:18px;margin-bottom:18px}.admin-top-grid form{display:grid;gap:14px}.admin-stats{display:grid;grid-template-columns:repeat(3,1fr);align-items:center}.admin-stats article{text-align:center}.admin-stats b,.admin-stats span{display:block}.admin-stats b{font-size:2.1rem}.admin-stats span{color:var(--muted)}.admin-section{margin-bottom:18px}.section-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.section-bar h3,.section-bar p{margin:0}.section-bar p{color:var(--muted);font-size:.75rem;margin-top:3px}.admin-users-table{min-width:1120px}
/* Modal / Toast / Mobile dock */
.modal{position:fixed;inset:0;background:rgba(11,14,47,.64);z-index:300;display:none;align-items:center;justify-content:center;padding:18px}.modal.open{display:flex}.modal-dialog{width:min(900px,100%);max-height:92vh;background:#fff;border-radius:22px;overflow:hidden}.modal-dialog.small{width:min(460px,100%)}.modal-head{height:68px;display:flex;align-items:center;justify-content:space-between;padding:0 20px;border-bottom:1px solid var(--line)}.modal-head h3{margin:0}.modal-body{padding:22px;overflow:auto;max-height:calc(92vh - 68px)}.legal-body{line-height:2;color:#454a60}.legal-body h4{margin-bottom:5px}.toast{position:fixed;left:25px;bottom:25px;background:#11183f;color:#fff;padding:13px 18px;border-radius:13px;opacity:0;transform:translateY(15px);transition:.2s;z-index:500;box-shadow:0 12px 30px rgba(16,22,60,.25)}.toast.show{opacity:1;transform:none}.mobile-dock{display:none}
/* Report document */
.report-paper{width:794px;height:1123px;background:#fff;position:relative;overflow:hidden;font-family:var(--report-font,"Cairo")}.report-bg{position:absolute;inset:0;width:100%;height:100%;object-fit:fill}.report-meta{position:absolute;top:59px;right:329px;width:178px;color:#fff;display:flex;flex-direction:column;align-items:stretch;text-align:right;direction:rtl;gap:2px;font-size:13px;font-weight:700;line-height:1.45}.report-meta span{width:100%;text-align:right}.report-school{position:absolute;top:137px;right:50%;transform:translateX(50%);width:430px;min-height:52px;border:1px solid rgba(255,255,255,.96);border-radius:16px;background:#103b4b;color:#fff;display:grid;place-items:center;font-weight:800;padding:7px 14px;text-align:center}.report-content{position:absolute;top:216px;right:30px;left:30px;bottom:72px;width:auto;max-width:calc(100% - 60px);overflow:visible;transform-origin:top center}.report-title{text-align:center;color:var(--title-color,#171940);font-size:calc(var(--report-size,12px) + 12px);font-weight:800;margin-bottom:8px}.report-table{display:table;width:100%!important;max-width:100%!important;margin:0 auto;border-collapse:collapse;table-layout:fixed;font-size:var(--report-size,12px);line-height:1.55;box-sizing:border-box;direction:rtl}.report-table th,.report-table td{border:1px solid #222b38;padding:6px 7px;vertical-align:top;overflow-wrap:anywhere;word-break:normal;box-sizing:border-box}.report-table th{width:16%;background:var(--col,#173f78);color:var(--col-text,#fff);text-align:right}.report-table td{background:var(--row,#fff);color:var(--row-text,#111)}.report-gallery{display:grid;gap:10px;justify-content:center;align-items:start;margin:14px auto 0;width:100%;max-width:100%}.report-gallery.c1{grid-template-columns:minmax(300px,360px)}.report-gallery.c2{grid-template-columns:repeat(2,minmax(230px,285px))}.report-gallery.c3{grid-template-columns:repeat(3,minmax(185px,215px))}.report-photo{width:100%;max-width:100%;border:1px solid #263142;overflow:hidden;background:#fff}.report-photo .window{aspect-ratio:4/3;overflow:hidden;max-height:220px}.report-photo img{width:100%;height:100%;object-fit:cover;transform-origin:center}.report-photo figcaption{text-align:center;font-size:10px;padding:5px;border-top:1px solid #263142;line-height:1.35}.report-approvals{display:grid;grid-template-columns:1fr 1fr .7fr 1fr;gap:8px;margin-top:12px;padding-top:8px;border-top:1px solid #bcc7d2;direction:rtl}.approval{text-align:center;font-size:10px;min-height:70px}.approval b,.approval span{display:block}.approval img{height:42px;max-width:115px;object-fit:contain;margin-top:4px}
.approval.stamp img{height:55px}.print-root{display:none}
/* Responsive */
@media(max-width:1100px){.auth-screen{grid-template-columns:1fr}.auth-visual{display:none}.hero-card{grid-template-columns:1fr}.hero-card>img{display:none}.two-col{grid-template-columns:1fr}.fixed-assets-grid{grid-template-columns:repeat(2,1fr)}.cards-list{grid-template-columns:repeat(2,1fr)}.form-grid.four,.form-grid.three{grid-template-columns:repeat(2,1fr)}.admin-top-grid{grid-template-columns:1fr}}
@media(max-width:720px){body{font-size:16px}.topbar{height:75px;padding:0 11px}.topbar-separator,.topbar-brand span,.subscription-badge{display:none}.topbar-brand b{font-size:.93rem}.brand-logo-box{width:45px;height:45px}.main{padding:18px 11px 94px}.page-heading h2{font-size:1.8rem}.hero-card{min-height:430px;padding:38px 24px;border-radius:25px}.hero-card h1{font-size:2.4rem}.stats-grid,.cards-list,.asset-list,.image-editor,.plans-grid{grid-template-columns:1fr}.form-grid.two,.form-grid.three,.form-grid.four{grid-template-columns:1fr}.fixed-assets-grid{grid-template-columns:1fr}.inline-form{grid-template-columns:1fr}.wizard-steps{grid-template-columns:repeat(2,1fr)}.wizard-form{padding:18px}.wizard-page{min-height:500px}.page-heading.split{display:block}.page-heading.split>.btn{margin-top:12px}.sidebar{width:min(88vw,330px)}.schedule-print-area{overflow:auto}.schedule-grid{min-width:850px}.admin-stats{grid-template-columns:1fr}.mobile-dock{position:fixed;right:12px;left:12px;bottom:10px;z-index:80;background:rgba(255,255,255,.96);border:1px solid var(--line);border-radius:20px;box-shadow:0 16px 36px rgba(20,25,68,.16);display:grid;grid-template-columns:repeat(4,1fr);padding:6px;backdrop-filter:blur(14px)}.mobile-dock button{border:0;background:transparent;border-radius:13px;padding:7px 4px;display:flex;flex-direction:column;align-items:center;gap:3px;color:#74788a}.mobile-dock button.active{background:#eef1fb;color:var(--indigo)}.mobile-dock img{width:19px;height:19px}.mobile-dock span{font-size:.62rem}.toast{left:12px;right:12px;bottom:92px;text-align:center}.schedule-signatures>div{min-width:150px}}
/* Print */
@page{size:A4 portrait;margin:0}
@media print{
  *{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;
    }
  body.print-report{margin:0!important;background:#fff!important}
  body.print-report>*:not(.print-root){display:none!important}
  body.print-report .print-root{display:block!important;position:fixed!important;inset:0!important;width:210mm!important;height:297mm!important;overflow:hidden!important;background:#fff!important;z-index:99999!important}
  body.print-report .print-sheet{width:210mm!important;height:297mm!important;overflow:hidden!important;display:block!important}
  body.print-report .report-paper{width:794px!important;height:1123px!important;max-width:794px!important;margin:0!important;overflow:hidden!important;box-sizing:border-box!important}
  body.print-report.multi-page .print-root{position:absolute!important;height:auto!important;overflow:visible!important}
  body.print-report.multi-page .print-sheet{height:auto!important;overflow:visible!important}
  body.print-report.multi-page .report-paper{height:auto!important;min-height:1123px!important;overflow:visible!important}
  body.print-schedule{margin:0!important;background:#fff!important;width:297mm!important;height:210mm!important;overflow:hidden!important}
  body.print-schedule .auth-screen,body.print-schedule .topbar,body.print-schedule .sidebar,body.print-schedule .overlay,body.print-schedule .mobile-dock,body.print-schedule .main>*:not(#view-schedule),body.print-schedule #view-schedule>*:not(#schedulePrintArea),body.print-schedule .toast,body.print-schedule .modal{display:none!important}
  body.print-schedule #view-schedule{display:block!important}
  body.print-schedule #schedulePrintArea{display:block!important;position:fixed!important;inset:0!important;width:297mm!important;height:210mm!important;margin:0!important;padding:7mm 8mm!important;border:0!important;border-radius:0!important;box-shadow:none!important;overflow:hidden!important}

  body.print-schedule .schedule-watermark{display:none!important}
  body.print-schedule .schedule-watermark.has-image{display:flex!important;z-index:5!important}
  body.print-schedule .schedule-watermark img{width:92mm!important;max-width:92mm!important;max-height:118mm!important;opacity:.10!important}
  body.print-schedule .schedule-print-header{margin-bottom:4mm!important}
  body.print-schedule .schedule-print-header h2{font-size:17px!important}
  body.print-schedule .schedule-grid{grid-template-columns:23mm repeat(8,1fr)!important;width:100%!important;min-width:0!important;border-radius:8px!important}
  body.print-schedule .schedule-cell{min-height:24mm!important;padding:3px!important;font-size:9px!important}
  body.print-schedule .schedule-cell.head{min-height:11mm!important;font-size:9.5px!important}
  body.print-schedule .schedule-signatures{margin-top:5mm!important;padding:0 8mm!important;font-size:11px!important}
}
/* Natural multi-page report when one-page fitting is disabled */
.report-paper.natural-report{height:auto;min-height:1123px;overflow:visible;background-image:url('../assets/report-bg-a4.png');background-size:794px 1123px;background-repeat:repeat-y;background-position:top center;padding:216px 22px 72px}
.report-paper.natural-report>.report-bg{display:none}
.report-paper.natural-report>.report-content{position:relative;top:auto;right:auto;left:auto;bottom:auto;transform:none!important}
.report-paper.natural-report>.report-meta,.report-paper.natural-report>.report-school{position:absolute}
@media print{body.print-report.multi-page .report-paper.natural-report{height:auto!important;min-height:297mm!important;overflow:visible!important}body.print-report.multi-page .print-root{position:absolute!important;inset:auto!important;top:0!important;right:0!important;width:210mm!important;height:auto!important;overflow:visible!important}body.print-report.multi-page .print-sheet{height:auto!important;overflow:visible!important}}

/* ===== إصدار الخرافية: النماذج والفوتر والطباعة متعددة الصفحات ===== */
.profile-section-card{margin:24px 0;padding:22px;border:1px solid #dce6e3;border-radius:22px;background:linear-gradient(135deg,#f7fbfa,#fff)}
.normal-profile-section{border-right:5px solid #00533D}.footer-profile-section{border-right:5px solid #9d7a20}
.template-choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-bottom:24px}.template-choice{position:relative}.template-choice input{position:absolute;opacity:0}.template-choice span{display:block;padding:22px;border:2px solid #e1e7ec;border-radius:20px;background:#fff;transition:.2s}.template-choice b,.template-choice small{display:block}.template-choice b{font-size:1.05rem;margin-bottom:6px}.template-choice small{color:#6b7782}.template-choice input:checked+span{border-color:#00533D;box-shadow:0 0 0 5px rgba(0,83,61,.09);background:#f2faf7}
.template-fields{padding:20px;border:1px solid #e2e9e7;border-radius:20px;background:#fbfdfc}
.footer-fields-editor{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.footer-field-edit{display:grid;grid-template-columns:1fr;gap:8px;padding:14px;border:1px solid #e0e7e5;border-radius:16px;background:#fff}.footer-field-edit b{font-size:.8rem;color:#334b45}.footer-report-settings{margin:20px 0;padding:18px;border-radius:18px;background:#f7faf9;border:1px solid #dce7e4}.footer-report-settings h4{margin:0 0 14px}
.view-report-icon{width:42px;height:42px;border:0;border-radius:12px;background:#edf7f3;color:#00533D;font-size:19px}.admin-reports-table small{display:block;color:#74827e;margin-top:3px}
.report-form .wizard-page{min-height:520px}.wizard-page .section-head h3{font-size:1.55rem}.wizard-page label>span{font-size:.92rem}.wizard-page input,.wizard-page textarea,.wizard-page select{font-size:1rem}

/* صفحات التقرير */
.print-root{display:none}
.report-print-page{position:relative;width:793px;height:1122px;overflow:hidden;background:#fff;color:#111;font-family:var(--report-font,Arial,sans-serif);page-break-after:always;break-after:page;box-sizing:border-box}.report-print-page:last-child{page-break-after:auto;break-after:auto}
.report-print-page .report-bg{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;z-index:0}
.report-print-page .report-meta{
  position:absolute;
  top:57px;
  right:332px;
  width:245px !important;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  text-align:right;
  direction:rtl;
  gap:3px;color:#fff;
  font-size:13px;
  font-weight:700;
  line-height:1.35;
  z-index:2}
  .report-print-page .report- span{
    width: 100%;
    white-space: nowrap !important;
    text-align: right;
    }

  .report-print-page .report-school{position:absolute;top:138px;right:50%;transform:translateX(50%);width:430px;min-height:51px;padding:8px 16px;display:flex;align-items:center;justify-content:center;background:#103b4b;color:#fff;border:1px solid rgba(255,255,255,.95);border-radius:16px;font-weight:800;z-index:2}
.report-page-content{position:absolute;top:220px;right:36px;left:36px;bottom:74px;z-index:2;overflow:hidden;box-sizing:border-box;min-width:0}.continuation-page .report-page-content{top:78px}.plain-template.first-page .report-page-content{top:190px}
.report-title{text-align:center;font-size:calc(var(--report-size) + 12px);line-height:1.3;color:var(--title-color);margin:0 0 13px;font-weight:800}
.report-table{display:table;width:calc(100% - 2px)!important;max-width:calc(100% - 2px)!important;min-width:0!important;margin:0 auto!important;border-collapse:collapse!important;border-spacing:0!important;table-layout:fixed!important;direction:rtl!important;font-size:var(--report-size)!important;line-height:1.65;box-sizing:border-box}.report-table col.label-col{width:17%}.report-table col.value-col{width:33%}.report-table th,.report-table td{border:1px solid #202c2e;padding:7px 8px;vertical-align:top;overflow-wrap:anywhere;word-break:break-word;box-sizing:border-box;min-width:0;max-width:100%}.report-table th{background:var(--col,#00533D)!important;color:var(--col-text,#fff)!important;text-align:right}.report-table td{background:var(--row,#fff)!important;color:var(--row-text,#111)!important}.text-lines{white-space:pre-line}
.continuation-header{position:absolute;top:0;right:0;left:0;height:58px;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:16px;z-index:3}.continuation-header.plain{color:#fff}
.plain-report-header{height:166px;display:grid;grid-template-columns:1fr 150px 1fr;align-items:center;padding:18px 36px;border-bottom:4px solid #00533D;background:#fff;position:relative;z-index:2;box-sizing:border-box}.plain-meta{display:flex;flex-direction:column;align-items:flex-start;text-align:right;direction:rtl;font-size:13px;line-height:1.5;font-weight:700}.plain-meta span{width:100%;text-align:right}.plain-center-logo{text-align:center;display:flex;align-items:center;justify-content:center}.plain-center-logo img{max-width:110px;max-height:82px;object-fit:contain}
.plain-left-logos{display:flex;justify-content:flex-end;align-items:center;gap:14px;min-width:0}
.plain-left-logos img{
  width:72px;
  height:72px;
  object-fit:contain}
.report-gallery{margin-top:14px;display:flex;flex-direction:column;gap:12px;width:100%;max-width:100%;align-items:center}.report-gallery.image-only{justify-content:center;height:100%;margin-top:0}.report-image-row{display:grid;gap:10px;justify-content:center;width:100%;max-width:100%;align-items:start}.report-image-row.count-1{grid-template-columns:minmax(0,350px)}.report-image-row.count-2{grid-template-columns:repeat(2,minmax(0,270px))}.report-image-row.count-3{grid-template-columns:repeat(3,minmax(0,215px))}.report-image-row.count-4{grid-template-columns:repeat(4,minmax(0,162px))}.report-photo{margin:0;border:1px solid #687a76;background:#fff;overflow:hidden;min-width:0;max-width:100%;break-inside:avoid;page-break-inside:avoid}.report-photo .window{aspect-ratio:1/1;position:relative;overflow:hidden;background:#eef2f1}.report-photo img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transform-origin:center;display:block!important;opacity:1!important}
.report-photo figcaption{font-size:9.5px;padding:5px;text-align:center;border-top:1px solid #687a76;min-height:25px;box-sizing:border-box}
.report-approvals{position:absolute;right:0;left:0;bottom:0;display:grid;grid-template-columns:1fr 1fr .72fr 1fr;gap:8px;padding-top:10px;border-top:1px solid #b8c7c3;direction:rtl}.approval{text-align:center;min-height:70px;font-size:10.5px}.approval b,.approval span{display:block}.approval img{max-width:105px;height:40px;object-fit:contain;margin-top:4px}.approval.stamp img{height:52px}
.report-page-footer{position:absolute;right:0;left:0;bottom:0;height:50px;display:grid;grid-template-columns:1fr 1fr 1fr;align-items:center;padding:0 28px;font-family:Arial,sans-serif;font-size:10.5px;z-index:4}.identity-footer{background:linear-gradient(90deg,#178fd2,#13be83);color:#fff}.plain-footer{background:#f1f3f3;border-top:2px solid #00533D;color:#4b5351}.footer-item{display:flex;flex-direction:row;align-items:center;gap:6px;min-width:0;direction:ltr}.footer-item.center{justify-content:center}.footer-item.left{justify-content:flex-end}.footer-item svg{width:16px;height:16px;flex:0 0 auto;order:0}.footer-item span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;direction:rtl;text-align:right;order:1}.page-number{position:absolute;bottom:53px;left:14px;color:#7d8986;font-size:9px;z-index:4}

@media(max-width:760px){.template-choice-grid,.footer-fields-editor{grid-template-columns:1fr}.plain-report-header{grid-template-columns:1fr 120px 1fr}.report-image-row.count-4{grid-template-columns:repeat(2,1fr)}}

@media print{
  @page{size:A4 portrait;margin:0}
  html,body{margin:0!important;padding:0!important;background:#fff!important}
  body.print-report>*:not(.print-root){display:none!important}
  body.print-report .print-root{display:block!important;position:static!important;width:210mm!important;height:auto!important;margin:0!important;padding:0!important}
  body.print-report .report-print-page{display:block!important;width:209.5mm!important;height:296.8mm!important;margin:0 auto!important;box-shadow:none!important;overflow:hidden!important;page-break-after:always!important;break-after:page!important;box-sizing:border-box!important}
  body.print-report .report-print-page:last-child{page-break-after:auto!important;break-after:auto!important}
  body.print-report .report-table{width:calc(100% - 2px)!important;max-width:calc(100% - 2px)!important;margin-inline:auto!important}body.print-report .report-image-row.count-1{grid-template-columns:minmax(0,350px)!important}body.print-report .report-image-row.count-2{grid-template-columns:repeat(2,minmax(0,270px))!important}body.print-report .report-image-row.count-3{grid-template-columns:repeat(3,minmax(0,215px))!important}body.print-report .report-image-row.count-4{grid-template-columns:repeat(4,minmax(0,162px))!important}body.print-report .report-photo img{display:block!important;opacity:1!important}
}


/* النسخة النارية — معالجة ذكية لتعبئة صفحات التقرير */
.print-root.measure-root{
  display:block!important;position:absolute!important;top:0!important;left:-20000px!important;
  width:794px!important;height:auto!important;visibility:hidden!important;overflow:visible!important;
}
.report-page-content{top:204px!important;right:28px!important;left:28px!important;bottom:56px!important;overflow:hidden!important}
.continuation-page .report-page-content{top:58px!important}
.plain-template.first-page .report-page-content{top:176px!important}
.report-table{width:100%!important;max-width:100%!important;margin:0!important;font-size:var(--report-size)!important;line-height:1.45!important}
.report-table th,.report-table td{padding:5px 7px!important}
.report-gallery{margin-top:9px!important;gap:8px!important}
.window{height:105px!important;aspect-ratio:auto!important}
.report-photo figcaption{padding:3px 4px!important;min-height:20px!important;font-size:8.8px!important}
.report-approvals{margin-top:8px!important;padding-top:6px!important;min-height:62px!important}
.approval{min-height:58px!important}.approval img{height:36px!important}.approval.stamp img{height:46px!important}
@media print{
  body.print-report .print-root{visibility:visible!important}
  body.print-report .report-print-page{width:210mm!important;height:297mm!important;margin:0!important}
}

/* Print button feedback */
.btn.is-loading{opacity:.82;cursor:wait;pointer-events:none}
.button-spinner{width:17px;height:17px;border:2px solid rgba(255,255,255,.42);border-top-color:#fff;border-radius:50%;display:inline-block;animation:print-spin .7s linear infinite}
@keyframes print-spin{to{transform:rotate(360deg)}}

/* ==================================================
   الصور المربعة — التعديل النهائي
   ================================================== */

/* صورة التعديل قبل الطباعة */
.crop-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden;
  background: #eef2f1;
  cursor: grab;
  touch-action: none;
  user-select: none;
  border-radius: 12px 12px 0 0;
}

.crop-box:active {
  cursor: grabbing;
}

.crop-box img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: 50% 50%;
  transform-origin: center center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* الصور في التقرير النهائي */
.report-photo {
  width: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #687a76;
  break-inside: avoid;
  page-break-inside: avoid;
}

.report-photo .window {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: hidden;
  background: #eef2f1;
}

.report-photo .window img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  display: block !important;
  object-fit: cover !important;
  transform-origin: center center;
}

/* إبقاء الصور مربعة عند الطباعة */
@media print {
  .report-photo .window {
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    max-height: none !important;
  }


  .report-photo .window img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
}

.crop-box.is-dragging {
  cursor: grabbing;
  outline: 3px solid rgba(0, 83, 61, 0.22);
}

.crop-help {
  padding: 8px 10px 2px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #536965;
  background: #f8fbfa;
}

.crop-toolbar {
  display: grid !important;
  grid-template-columns: auto minmax(100px, 1fr) auto;
  align-items: center;
  gap: 10px !important;
  padding: 9px 10px !important;
  background: #f8fbfa;
}

.crop-toolbar > span {
  font-size: 12px;
  font-weight: 700;
  color: #405651;
}

.crop-toolbar input[type="range"] {
  width: 100%;
}

.report-image-row {
  display: grid;
  width: 100%;
  gap: 8px;
  justify-content: center;
  align-items: start;
}

/* صورة واحدة */
.report-image-row.count-1 {
  grid-template-columns: 260px !important;
}

/* صورتان */
.report-image-row.count-2 {
  grid-template-columns: repeat(2, 230px) !important;
}

/* ثلاث صور */
.report-image-row.count-3 {
  grid-template-columns: repeat(3, 205px) !important;
}

/* أربع صور */
.report-image-row.count-4 {
  grid-template-columns: repeat(4, 160px) !important;
}

/* ==================================================
   تثبيت الصور بشكل مربع — النسخة النهائية
   ================================================== */

.report-photo {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* نافذة الصورة داخل التقرير */
.report-photo .window {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  background: #eef3f2 !important;
  box-sizing: border-box !important;
}

/* الصورة نفسها */
.report-photo .window img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  display: block !important;
  transform-origin: center center !important;
}

/* مربع تعديل الصورة قبل الطباعة */
.crop-box {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  background: #eef3f2 !important;
  cursor: grab !important;
  touch-action: none !important;
  box-sizing: border-box !important;
}

.crop-box:active {
  cursor: grabbing !important;
}

.crop-box img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  pointer-events: none !important;
  transform-origin: center center !important;
}

/* المحافظة على المربع عند الطباعة */
@media print {
  .report-photo .window {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
  }

  .report-photo .window img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
}

/* تثبيت جميع الصور كمربعات مهما كان عددها */
.report-photo .window,
.crop-box {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.report-photo .window img,
.crop-box img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  transform-origin: center center !important;
}

/* ==================================================
   النسخة الذهبية — التقويم الهجري والميلادي
   ================================================== */
.calendar-preference-field{
  grid-column:span 2;
  padding:14px 16px!important;
  border:1px solid #c9ddd5!important;
  border-radius:16px!important;
  background:linear-gradient(135deg,rgba(0,83,61,.09),rgba(255,255,255,.98))!important;
}
.calendar-preference-field>span{color:#00533d!important;font-weight:900!important}
.calendar-preference-field small{display:block;margin-top:7px;color:#647872;font-size:12px;line-height:1.7}
.calendar-preference-field select{border-color:#aac9bd!important;background:#fff!important;font-weight:800!important;color:#173f34!important}
.report-date-field{position:relative}
.date-picker-trigger{
  width:100%;min-height:50px;padding:0 14px;border:1px solid #cbd8d4;border-radius:13px;background:#fff;color:#183b32;
  display:flex;align-items:center;justify-content:space-between;gap:10px;font:inherit;font-weight:800;cursor:pointer;text-align:right;
  transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease
}
.date-picker-trigger:hover{border-color:#00533d;box-shadow:0 8px 22px rgba(0,83,61,.09)}
.date-picker-trigger:focus-visible{outline:none;border-color:#00533d;box-shadow:0 0 0 4px rgba(0,83,61,.13)}
.date-picker-trigger i{width:34px;height:34px;border-radius:10px;background:#e5f2ed;color:#00533d;display:grid;place-items:center;font-style:normal;font-size:21px;flex:none}
.report-date-field>small{display:block;margin-top:6px;color:#62756f;font-size:12px;font-weight:700}
.date-picker-modal{position:fixed;inset:0;z-index:2000;display:none;align-items:center;justify-content:center;padding:18px}
.date-picker-modal.open{display:flex}
.date-picker-backdrop{position:absolute;inset:0;background:rgba(5,22,18,.56);backdrop-filter:blur(5px)}
.date-picker-card{position:relative;width:min(520px,100%);border-radius:25px;background:#fff;box-shadow:0 30px 90px rgba(0,0,0,.28);overflow:hidden;animation:goldCalendarIn .2s ease}
@keyframes goldCalendarIn{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}
.date-picker-head{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:20px 22px;background:linear-gradient(135deg,#003f30,#00654a);color:#fff}
.date-picker-head h3{margin:5px 0 0;font-size:24px;line-height:1.2}.date-picker-type{display:inline-flex;padding:5px 10px;border-radius:99px;background:rgba(255,255,255,.15);font-size:12px;font-weight:800}
.date-picker-close{width:38px;height:38px;border:1px solid rgba(255,255,255,.25);border-radius:12px;background:rgba(255,255,255,.1);color:#fff;font-size:25px;cursor:pointer}
.date-picker-nav{display:grid;grid-template-columns:52px 1fr 52px;gap:10px;padding:14px 18px;border-bottom:1px solid #e4ece9;background:#f7fbf9}
.date-picker-nav button{min-height:42px;border:1px solid #d2e1dc;border-radius:12px;background:#fff;color:#00533d;font:inherit;font-weight:900;cursor:pointer}
.date-picker-nav button:hover{background:#eaf5f1;border-color:#8bb5a6}
.date-picker-weekdays,.date-picker-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;padding-inline:18px}
.date-picker-weekdays{padding-top:14px;padding-bottom:8px;color:#61736d;font-size:12px;font-weight:900;text-align:center}
.date-picker-weekdays span:last-child{color:#b34444}
.date-picker-days{padding-bottom:17px;min-height:284px;align-content:start}
.date-empty{aspect-ratio:1/1}
.date-day{position:relative;aspect-ratio:1/1;border:1px solid transparent;border-radius:13px;background:#f5f8f7;color:#273d37;font:inherit;font-weight:800;cursor:pointer;display:grid;place-items:center;transition:.16s ease}
.date-day:hover{background:#e3f1ec;border-color:#9fc4b7;transform:translateY(-1px)}
.date-day.friday{color:#b13d3d;background:#fff5f5}.date-day.saturday{color:#1a5f92;background:#f3f8fd}
.date-day.today{border:2px solid #d0a52c;background:#fff9e8}.date-day.today::after{content:"اليوم";position:absolute;bottom:2px;font-size:7px;color:#8a6812}
.date-day.selected{background:#00533d!important;color:#fff!important;border-color:#00533d!important;box-shadow:0 8px 18px rgba(0,83,61,.27)}
.date-picker-footer{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center;padding:15px 18px;background:#f7faf9;border-top:1px solid #e0eae6}
.date-picker-selection{text-align:center;color:#24463c;font-size:13px;font-weight:900;line-height:1.5}
.date-picker-footer button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:620px){.calendar-preference-field{grid-column:1/-1}.date-picker-modal{padding:8px;align-items:flex-end}.date-picker-card{border-radius:24px 24px 0 0}.date-picker-head{padding:17px}.date-picker-head h3{font-size:20px}.date-picker-weekdays,.date-picker-days{gap:4px;padding-inline:10px}.date-picker-days{min-height:245px}.date-day{border-radius:10px}.date-picker-footer{grid-template-columns:1fr 1fr}.date-picker-selection{grid-column:1/-1;grid-row:1}.date-picker-footer button{width:100%}}
@media print{.date-picker-modal{display:none!important}}


/* تبديل نوع التقويم داخل التقرير السابق أو الجديد */
.date-picker-calendar-switch{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  padding:12px 18px 0;
  background:#f7fbf9;
}
.date-picker-calendar-switch button{
  min-height:42px;
  border:1px solid #c9ddd5;
  border-radius:12px;
  background:#fff;
  color:#31544a;
  font:inherit;
  font-weight:900;
  cursor:pointer;
  transition:.18s ease;
}
.date-picker-calendar-switch button:hover{
  border-color:#6ca28f;
  background:#edf7f3;
}
.date-picker-calendar-switch button.active{
  border-color:#00533d;
  background:#00533d;
  color:#fff;
  box-shadow:0 7px 18px rgba(0,83,61,.18);
}
@media(max-width:620px){
  .date-picker-calendar-switch{padding-inline:10px}
  .date-picker-calendar-switch button{font-size:13px}
}


/* ==================================================
   إصلاح ألوان التقرير وتفعيل معاينة الخطوط
   ================================================== */
.font-preview-card{grid-column:1/-1;margin-top:2px;padding:16px 18px;border:1px solid #d7e1dd;border-radius:16px;background:linear-gradient(135deg,#f7fbf9,#fff)}
.font-preview-card span{display:block;margin-bottom:7px;color:#5f716b;font-size:12px;font-weight:800}
.font-preview-card p{margin:0;color:#183b32;font-size:20px;line-height:1.8;font-weight:600}
.report-color-status{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.report-color-chip{display:flex;align-items:center;gap:9px;padding:10px 12px;border:1px solid #e0e7e4;border-radius:13px;background:#fff;font-size:12px;font-weight:800;color:#465b55}
.report-color-chip i{width:28px;height:28px;border-radius:9px;border:1px solid rgba(0,0,0,.12);box-shadow:inset 0 0 0 2px rgba(255,255,255,.5)}
@media(max-width:720px){.report-color-status{grid-template-columns:1fr}.font-preview-card p{font-size:18px}}


/* ===== الاحتفاظ بالتقرير الأصلي والحفظ قبل الطباعة ===== */
.keep-original-option{max-width:820px;margin:18px auto 0}
.keep-original-check{position:relative;display:grid;grid-template-columns:auto 48px minmax(0,1fr) auto;align-items:center;gap:13px;padding:15px 17px;border:1px solid #d6e3df;border-radius:18px;background:linear-gradient(135deg,#f5fbf8,#fff);cursor:pointer;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}
.keep-original-check:hover{border-color:#79ad9d;box-shadow:0 10px 26px rgba(0,83,61,.09);transform:translateY(-1px)}
.keep-original-check>input{width:22px;height:22px;margin:0;accent-color:#00533d;cursor:pointer}
.keep-original-icon{width:48px;height:48px;border-radius:14px;display:grid;place-items:center;background:#e4f3ed;border:1px solid #c8e1d8}
.keep-original-icon img{width:23px;height:23px}
.keep-original-copy{min-width:0}
.keep-original-copy b,.keep-original-copy small{display:block}
.keep-original-copy b{color:#123f33;font-size:.98rem}
.keep-original-copy small{margin-top:3px;color:#63756f;line-height:1.7;font-size:.74rem}
.keep-original-status{padding:7px 10px;border-radius:999px;background:#edf3f1;color:#698078;white-space:nowrap;font-size:.7rem;font-weight:800}
.keep-original-check:has(input:checked){border-color:#168562;background:linear-gradient(135deg,#eaf8f2,#fff);box-shadow:0 0 0 4px rgba(22,133,98,.1)}
.keep-original-check:has(input:checked) .keep-original-status{background:#168562;color:#fff}
.save-action-note{max-width:820px;margin:14px auto 0;padding:11px 14px;border-radius:13px;background:#f6f7fb;color:#646a7d;text-align:center;line-height:1.8;font-size:.73rem}
.save-action-note b{color:#30384f}
@media(max-width:720px){.keep-original-check{grid-template-columns:auto 42px minmax(0,1fr);padding:13px}.keep-original-icon{width:42px;height:42px}.keep-original-status{grid-column:2/-1;justify-self:start}.final-actions{flex-direction:column}.final-actions .btn{width:100%;justify-content:center}}


/* ==================================================
   تحسينات النسخة الألماسية: الترحيب، رسالة اليوم، المشاركة والفوتر
   ================================================== */
.profile-welcome{color:#2554a4!important;font-weight:900!important}
.profile-welcome::before{content:"👋";margin-left:7px}
.motivation-stat-card{position:relative;overflow:hidden;text-align:center;background:linear-gradient(145deg,#fff,#f7f4ff)!important}
.motivation-stat-card::after{content:"";position:absolute;width:105px;height:105px;border-radius:50%;left:-48px;bottom:-55px;background:radial-gradient(circle,rgba(114,67,219,.18),transparent 68%)}
.motivation-stat-card .motivation-stat-icon{width:42px;height:42px;margin:6px auto!important;border-radius:14px;display:grid!important;place-items:center;background:linear-gradient(135deg,rgba(35,92,189,.12),rgba(226,88,170,.14));color:#7243db;font-size:1.25rem!important}
.motivation-stat-card #dailyMotivation{position:relative;z-index:1;min-height:42px;color:#3e4965;font-size:.78rem;line-height:1.8;font-weight:700}
.card-actions [data-share-report] img{width:16px;height:16px}
.file-upload-status{display:block;margin-top:7px;padding:7px 9px;border-radius:10px;background:#f2f4f9;color:#72788b;font-size:.7rem;font-weight:700;line-height:1.5}
.file-upload-status.active{background:#e8f7f1;color:#117657;border:1px solid #c6e7da}
.site-footer{position:relative;overflow:hidden;margin-top:12px;color:#fff;background:radial-gradient(circle at 12% 18%,rgba(226,88,170,.25),transparent 30%),linear-gradient(125deg,#10163c 0%,#203e95 54%,#7041d7 100%)}
.site-footer::before{content:"";position:absolute;inset:0;background-image:linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px);background-size:34px 34px;pointer-events:none}
.site-footer-glow{position:absolute;border-radius:50%;filter:blur(5px);pointer-events:none}.site-footer-glow-one{width:260px;height:260px;right:-100px;top:-135px;background:rgba(45,202,190,.18)}.site-footer-glow-two{width:250px;height:250px;left:-90px;bottom:-150px;background:rgba(255,111,190,.14)}
.site-footer-inner{position:relative;z-index:1;width:min(1120px,calc(100% - 32px));margin:auto;padding:36px 0 18px}
.site-footer-heading{text-align:center;margin-bottom:22px}.site-footer-heading>span{display:inline-block;padding:5px 10px;border-radius:99px;background:rgba(255,255,255,.11);color:#ffd0e9;font-size:.7rem;font-weight:800}.site-footer-heading h2{margin:7px 0 2px;font-size:1.8rem}.site-footer-heading p{margin:0;color:#dbe1ff;font-size:.78rem}
.site-footer-contacts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;max-width:920px;margin:auto}
.site-footer-contact{display:flex;align-items:center;gap:12px;min-height:86px;padding:14px 16px;border:1px solid rgba(255,255,255,.18);border-radius:19px;background:rgba(255,255,255,.08);color:#fff;text-decoration:none;box-shadow:inset 0 1px rgba(255,255,255,.1),0 14px 34px rgba(5,9,42,.16);backdrop-filter:blur(10px);transition:.2s}
.site-footer-contact:hover{transform:translateY(-2px);background:rgba(255,255,255,.14);border-color:rgba(255,255,255,.34)}
.site-footer-icon{flex:0 0 44px;width:44px;height:44px;display:grid;place-items:center;border-radius:14px;background:rgba(255,255,255,.12);font-size:1.2rem}.site-footer-contact span:last-child{min-width:0}.site-footer-contact small,.site-footer-contact b{display:block}.site-footer-contact small{color:#cfd7ff;font-size:.68rem;font-weight:700;margin-bottom:4px}.site-footer-contact b{color:#fff;font-size:.83rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.site-footer-meta{
  display:grid;grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:18px;margin-top:22px;
  padding-top:16px;
  border-top:1px solid rgba(255,255,255,.16)}
  .site-footer-meta p{margin:0;color:#d9dfff;font-size:.7rem;line-height:1.8}.site-footer-meta p:nth-child(2){text-align:center;white-space:nowrap}.site-footer-meta p:last-child{text-align:left}.site-footer-meta i{font-style:normal;color:rgba(255,255,255,.4);padding:0 5px}
@media(max-width:850px){.site-footer-contacts{grid-template-columns:1fr;max-width:540px}.site-footer-meta{grid-template-columns:1fr;gap:4px;text-align:center}.site-footer-meta p,.site-footer-meta p:last-child{text-align:center}}
@media(max-width:520px){.site-footer-inner{width:calc(100% - 22px);padding-top:29px}.site-footer-contact{min-height:76px;padding:12px 13px}.site-footer-meta i{display:none}.site-footer-meta p:first-child{display:flex;flex-direction:column}}
@media print{.site-footer{display:none!important}}

.site-footer-icon img{width:22px;height:22px;display:block}
@media(max-width:720px){.site-footer{padding-bottom:78px}}

.forgot-password-btn {
  display: block;
  width: auto;
  margin: 14px auto 0;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: #2563eb;
  font: inherit;
  cursor: pointer;
}

.forgot-password-btn:hover {
  text-decoration: underline;
}

.forgot-password-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.auth-support {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 20px;
  background:
    radial-gradient(
      circle at top right,
      rgba(37, 99, 235, 0.08),
      transparent 45%
    ),
    rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(10px);
}

.auth-support-heading {
  margin-bottom: 14px;
  text-align: right;
}

.auth-support-heading span {
  display: block;
  margin-bottom: 4px;
  color: #1d4ed8;
  font-size: 15px;
  font-weight: 800;
}

.auth-support-heading p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.7;
}

.auth-support-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.auth-support-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.86);
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.auth-support-link:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 9px 22px rgba(37, 99, 235, 0.1);
}

.auth-support-icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.12),
    rgba(99, 102, 241, 0.08)
  );
}

.auth-support-icon img {
  width: 19px;
  height: 19px;
  object-fit: contain;
}

.auth-support-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.auth-support-text small {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.auth-support-text b {
  overflow: hidden;
  color: #172554;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 850px) {
  .auth-support-links {
    grid-template-columns: 1fr;
  }
}

/* ==================================================
   تحسينات أغسطس 2026 — الهوية، التقارير، المناسبات والإدارة
   ================================================== */

/* هيدر متناسق مع الفوتر */
.topbar{
  min-height:88px;height:88px;color:#fff;border-bottom:0;
  background:radial-gradient(circle at 14% -55%,rgba(226,88,170,.34),transparent 38%),linear-gradient(125deg,#10163c 0%,#203e95 56%,#7041d7 100%);
  box-shadow:0 14px 34px rgba(16,22,60,.2);backdrop-filter:blur(18px);
}
.topbar::after{content:"";position:absolute;right:0;left:0;bottom:0;height:3px;background:linear-gradient(90deg,#2dcabe,#7ea7ff,#e258aa)}
.topbar .menu-button{border-color:rgba(255,255,255,.24);background:rgba(255,255,255,.12);box-shadow:inset 0 1px rgba(255,255,255,.12)}
.topbar .menu-button img{filter:brightness(0) invert(1)}
.topbar-separator{background:rgba(255,255,255,.25)}
.topbar-brand b{color:#fff}.topbar-brand span{color:#dce3ff}
.topbar .brand-logo-box{border-color:rgba(255,255,255,.36);box-shadow:0 9px 25px rgba(5,9,42,.22)}
.topbar .btn.ghost{color:#fff;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.2)}
.topbar .btn.ghost:hover{background:rgba(255,255,255,.2)}
.topbar .subscription-badge{background:rgba(255,255,255,.94);color:#176d5a;box-shadow:0 7px 19px rgba(5,9,42,.16)}
.topbar .subscription-badge.expired{color:#bd3149}.topbar .subscription-badge.warning{color:#9a6307}

/* الاعتمادات والختم — توزيع متساوٍ وختم 4 سم دون عمود رابع */
.report-page-content.has-approvals{padding-bottom:158px!important}
.report-approvals{
  position:absolute!important;
  right:0!important;
  left:0!important;
  bottom:0!important;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-template-areas:"principal deputy executor"!important;
  align-items:start!important;
  min-height:96px!important;
  gap:0!important;
  padding:8px 0 0!important;
  border-top:1px solid #b8c7c3!important;
  direction:ltr!important;
  overflow:visible!important;
}
.report-approvals .approval{min-width:0!important;min-height:82px!important;padding:0 8px!important;text-align:center!important;direction:rtl!important;box-sizing:border-box!important}
.report-approvals .approval.executor{grid-area:executor!important}
.report-approvals .approval.deputy{grid-area:deputy!important}
.report-approvals .approval.principal{grid-area:principal!important}
.report-approvals .approval:not(.stamp) img{width:auto!important;height:36px!important;max-width:105px!important;object-fit:contain!important;margin:4px auto 0!important}
.report-approvals .approval.stamp{
  position:absolute!important;
  left:33.333333%!important;
  bottom:0!important;
  transform:translateX(-50%)!important;
  width:4cm!important;
  height:4cm!important;
  min-width:0!important;
  min-height:0!important;
  padding:0!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:flex-end!important;
  pointer-events:none!important;
  z-index:2!important;
  direction:rtl!important;
}
.report-approvals .approval.stamp b{font-size:10px!important;line-height:1.1!important;margin:0 0 2px!important}
.report-approvals .approval.stamp img{display:block!important;width:auto!important;height:auto!important;max-width:4cm!important;max-height:calc(4cm - 14px)!important;object-fit:contain!important;margin:0 auto!important}

/* تجهيز PDF داخل مساحة مرئية خلف شاشة الانتظار لمنع الصفحة البيضاء */
.pdf-capture-stage{position:fixed!important;top:0!important;left:0!important;width:793px!important;height:1122px!important;display:block!important;visibility:visible!important;opacity:1!important;overflow:hidden!important;background:#fff!important;z-index:2147483600!important;pointer-events:none!important;direction:rtl!important}
.pdf-capture-mask{position:fixed;inset:0;z-index:2147483640;display:grid;place-items:center;background:rgba(16,22,60,.88);backdrop-filter:blur(8px)}
.pdf-capture-message{min-width:260px;padding:25px 28px;border:1px solid rgba(255,255,255,.2);border-radius:22px;background:rgba(255,255,255,.12);color:#fff;text-align:center;box-shadow:0 22px 60px rgba(0,0,0,.3)}
.pdf-capture-message .button-spinner{display:block;width:30px;height:30px;margin:0 auto 13px}.pdf-capture-message b,.pdf-capture-message small{display:block}.pdf-capture-message small{margin-top:5px;color:#dbe1ff;font-size:.75rem}
.pdf-ready-panel{position:fixed;inset:0;z-index:2147483630;display:grid;place-items:center;padding:18px;background:rgba(10,14,45,.62);backdrop-filter:blur(8px)}
.pdf-ready-card{position:relative;width:min(520px,100%);display:grid;grid-template-columns:70px 1fr;gap:16px;align-items:center;padding:25px;border-radius:24px;background:#fff;box-shadow:0 30px 80px rgba(6,10,42,.3)}
.pdf-ready-card>div>b,.pdf-ready-card>div>small{display:block}.pdf-ready-card>div>small{margin-top:5px;color:var(--muted);line-height:1.7}.pdf-ready-icon{width:66px;height:66px;display:grid;place-items:center;border-radius:18px;background:linear-gradient(135deg,#fff0f3,#ffe1e7);color:#c6304c;font-weight:900}
.pdf-ready-actions{grid-column:1/-1;display:flex;gap:10px;flex-wrap:wrap}.pdf-ready-close{position:absolute;top:10px;left:12px;width:34px;height:34px;border:0;border-radius:10px;background:#f0f2f8;color:#596077;font-size:21px}

/* كروت التقارير المحفوظة */
.cards-list{grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.pro-report-card{position:relative;overflow:hidden;display:flex;flex-direction:column;min-height:330px;padding:22px;border:1px solid #dfe4f1;border-radius:24px;background:linear-gradient(155deg,#fff 0%,#fbfcff 66%,#f4f1ff 100%);box-shadow:0 16px 42px rgba(22,29,78,.08);transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease}
.pro-report-card:hover{transform:translateY(-4px);border-color:#bfc8e7;box-shadow:0 23px 55px rgba(22,29,78,.14)}
.report-card-accent{position:absolute;top:0;right:0;left:0;height:5px;background:linear-gradient(90deg,#2dcabe,#235cbd,#7243db,#e258aa)}
.report-card-top{display:flex;align-items:center;justify-content:space-between;gap:10px}.report-type-badge{display:inline-flex;align-items:center;padding:6px 11px;border-radius:99px;background:#eee9ff;color:#6032b7;font-size:.7rem;font-weight:900}.report-order{color:#9aa0b3;font-size:.72rem;font-weight:800}
.report-card-title-row{display:grid;grid-template-columns:52px minmax(0,1fr);gap:12px;align-items:center;margin:17px 0}.report-card-icon{width:52px;height:52px;display:grid;place-items:center;border-radius:16px;background:linear-gradient(135deg,#e9f3ff,#f3eaff);border:1px solid #dae2f4}.report-card-icon img{width:24px;height:24px}.pro-report-card h3{margin:0;color:#18204d;font-size:1.08rem;line-height:1.55}.report-card-updated{margin:4px 0 0!important;font-size:.68rem!important}
.report-card-meta{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-bottom:18px}.report-card-meta>div{min-width:0;padding:11px;border:1px solid #e7eaf3;border-radius:14px;background:rgba(255,255,255,.76)}.report-card-meta span,.report-card-meta b{display:block}.report-card-meta span{color:#858b9d;font-size:.65rem;font-weight:700}.report-card-meta b{margin-top:4px;color:#3e455f;font-size:.73rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.report-card-actions{
  margin-top:auto;
  padding-top:15px;
  border-top:1px solid #e5e8f1}
  .report-card-actions .btn{flex:1 1 auto}.report-card-actions .share-action{color:#fff;background:linear-gradient(135deg,#188a75,#2f66bd);box-shadow:0 8px 20px rgba(35,92,189,.17)}.reports-empty-state .empty-state-icon{display:grid;place-items:center;width:66px;height:66px;margin:0 auto 12px;border-radius:20px;background:#f0ecff;color:#6840c7;font-size:30px}.reports-empty-state .btn{margin-top:12px}

/* المناسبات */
.occasions-heading{padding:22px 25px;border:1px solid #dce2f1;border-radius:24px;background:radial-gradient(circle at 8% 15%,rgba(226,88,170,.1),transparent 27%),linear-gradient(135deg,#fff,#f5f7ff)}
.occasion-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:17px}.occasion-stats article{position:relative;overflow:hidden;padding:18px 20px;border:1px solid #e0e5f0;border-radius:20px;background:#fff;box-shadow:0 10px 28px rgba(20,27,75,.055)}.occasion-stats article::after{content:"";position:absolute;width:74px;height:74px;left:-25px;bottom:-32px;border-radius:50%;background:rgba(35,92,189,.08)}.occasion-stats article.local::after{background:rgba(20,136,98,.1)}.occasion-stats article.global::after{background:rgba(114,67,219,.1)}.occasion-stats b,.occasion-stats span{display:block}.occasion-stats b{font-size:1.8rem;color:#20275b}.occasion-stats span{color:var(--muted);font-size:.74rem}
.occasion-form{grid-template-columns:180px minmax(240px,1fr) 220px auto;align-items:end}.occasion-add-btn{height:51px}.occasions-panel{padding:0;overflow:hidden}.occasions-panel>.section-bar{padding:20px 22px 13px;margin:0}.occasion-legend{display:flex;align-items:center;gap:14px;color:#6d7386;font-size:.7rem;font-weight:800}.occasion-legend span{display:flex;align-items:center;gap:6px}.occasion-legend i,.occasion-dot{display:inline-block;width:9px;height:9px;border-radius:50%}.occasion-legend .local,.occasion-dot.local{background:#20a279}.occasion-legend .global,.occasion-dot.global{background:#7651d5}.occasions-table{min-width:880px}.occasions-table thead th{padding:13px 18px;background:#f5f7fc;color:#4f5670}.occasions-table td{padding:15px 18px}.occasion-row{transition:background .18s}.occasion-row:hover{background:#fafbff}.occasion-row.soon{background:#fffdf6}.occasion-name-cell{display:flex;align-items:center;gap:11px}.occasion-name-cell .occasion-dot{flex:0 0 auto;width:12px;height:12px;box-shadow:0 0 0 5px rgba(35,92,189,.06)}.occasion-name-cell b,.occasion-name-cell small,.occasion-date b,.occasion-date small{display:block}.occasion-name-cell small,.occasion-date small{margin-top:3px;color:#8a90a1;font-size:.65rem}.occasion-type,.occasion-countdown{display:inline-flex;align-items:center;border-radius:99px;padding:6px 10px;font-size:.68rem;font-weight:900}.occasion-type.local{background:#e9f8f2;color:#127758}.occasion-type.global{background:#f0ebff;color:#6540bf}.occasion-countdown.future{background:#eef3ff;color:#315ca8}.occasion-countdown.soon{background:#fff1d9;color:#9b6407}.occasion-countdown.past{background:#f2f3f6;color:#777d8d}.occasion-delete{display:inline-flex;align-items:center;gap:6px;padding:8px 10px;border:0;border-radius:10px;background:#fff0f3;color:#ba354b;font-size:.68rem;font-weight:900}.occasion-delete img{width:15px;height:15px}.occasion-empty{display:grid;justify-items:center;gap:4px;padding:42px 15px;color:#73798c}.occasion-empty>span{font-size:30px;color:#7851d3}.occasion-empty small{font-size:.7rem}

/* بحث وترقيم لوحة المدير */
.admin-section-bar{gap:18px;align-items:flex-end}.admin-search-box{width:min(430px,100%);flex:0 1 430px}.admin-search-box span{color:#59617a}.admin-search-box input{padding-right:42px;background-color:#fbfcff;background-image:url('../icons/search.svg');background-repeat:no-repeat;background-position:right 13px center;background-size:18px}
.admin-cell-sub{display:block;margin-top:4px;color:#7b8193}.admin-empty{padding:28px;text-align:center;color:#777e91}.admin-pagination{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:15px 3px 0;border-top:1px solid #edf0f6;margin-top:9px}.pagination-summary{color:#777e91;font-size:.72rem;font-weight:700}.pagination-buttons{display:flex;align-items:center;gap:8px}.pagination-buttons button{width:38px;height:38px;border:1px solid #dce1ed;border-radius:11px;background:#fff;color:#26356f;font-size:22px;line-height:1}.pagination-buttons button:hover:not(:disabled){background:#eef2ff;border-color:#bfc9eb}.pagination-buttons button:disabled{opacity:.38;cursor:not-allowed}.pagination-buttons span{min-width:105px;text-align:center;color:#59617a;font-size:.72rem;font-weight:800}

@media(max-width:1100px){.occasion-form{grid-template-columns:1fr 1fr}.occasion-add-btn{grid-column:1/-1}.admin-section-bar{align-items:stretch;flex-direction:column}.admin-search-box{width:100%;flex-basis:auto}}
@media(max-width:720px){.topbar{height:78px;min-height:78px}.occasion-stats{grid-template-columns:1fr}.occasion-form{grid-template-columns:1fr}.report-card-meta{grid-template-columns:1fr}.pdf-ready-card{grid-template-columns:54px 1fr;padding:20px}.pdf-ready-icon{width:52px;height:52px}.pdf-ready-actions{flex-direction:column}.pdf-ready-actions .btn{width:100%}.admin-pagination{align-items:stretch;flex-direction:column}.pagination-buttons{justify-content:space-between;width:100%}}
@media print{.pdf-capture-stage,.pdf-capture-mask,.pdf-ready-panel{display:none!important}}

/* ==================================================
   إصلاح توافق كروت التقارير المحفوظة مع الجوال
   ================================================== */
@media (max-width: 720px) {
  .main {
    padding: 28px 14px 150px !important;
    overflow-x: hidden;
  }

  .page-heading {
    margin: 8px 0 20px !important;
  }

  .page-heading h2 {
    margin: 0 0 8px !important;
    font-size: 1.68rem !important;
    line-height: 1.25 !important;
  }

  .page-heading p {
    font-size: .92rem;
    line-height: 1.7;
  }

  .cards-list {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    width: 100%;
    min-width: 0;
  }

  .pro-report-card {
    width: 100%;
    min-width: 0;
    min-height: 0 !important;
    padding: 18px 16px !important;
    border-radius: 20px !important;
    overflow: hidden;
  }

  .report-card-top {
    gap: 8px;
  }

  .report-type-badge {
    max-width: calc(100% - 48px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .report-card-title-row {
    grid-template-columns: 48px minmax(0, 1fr) !important;
    gap: 11px !important;
    margin: 14px 0 !important;
  }

  .report-card-icon {
    width: 48px !important;
    height: 48px !important;
    border-radius: 14px !important;
  }

  .pro-report-card h3 {
    font-size: 1rem !important;
    line-height: 1.55 !important;
    overflow-wrap: anywhere;
  }

  .report-card-updated {
    font-size: .7rem !important;
    line-height: 1.65 !important;
  }

  .report-card-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
  }

  .report-card-meta > div {
    padding: 10px !important;
    border-radius: 13px !important;
  }

  .report-card-meta span {
    font-size: .66rem !important;
  }

  .report-card-meta b {
    font-size: .74rem !important;
    line-height: 1.55;
  }

  .report-card-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px !important;
    padding-top: 13px !important;
  }

  .report-card-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    margin: 0 !important;
    padding: 10px 8px !important;
    justify-content: center;
    font-size: .82rem !important;
  }

  .report-card-actions .btn img {
    width: 18px;
    height: 18px;
  }

  .report-card-actions .danger {
    grid-column: 1 / -1;
  }
}

@media (max-width: 390px) {
  .main {
    padding-right: 10px !important;
    padding-left: 10px !important;
  }

  .pro-report-card {
    padding: 16px 13px !important;
  }

  .report-card-meta {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  body.print-schedule-only > *:not(.schedule-print-root) {
    display: none !important;
  }

  body.print-schedule-only {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .schedule-print-root {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    direction: rtl;
  }

  .schedule-print-root table {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
    font-size: 10px !important;
  }

  .schedule-print-root th,
  .schedule-print-root td {
    border: 1px solid #333 !important;
    padding: 5px 3px !important;
    text-align: center !important;
    vertical-align: middle !important;
    overflow-wrap: anywhere;
  }

  .schedule-print-root button,
  .schedule-print-root .no-print {
    display: none !important;
  }
}


/* ===== الاعتمادات النهائية — صفحة واحدة عند المحتوى القليل ===== */
.report-page-content.has-approvals{padding-bottom:158px!important}
.report-approvals{grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-areas:"principal deputy executor"!important;min-height:96px!important;gap:0!important;direction:ltr!important;overflow:visible!important}
.report-approvals .approval.executor{grid-area:executor!important}
.report-approvals .approval.deputy{grid-area:deputy!important}
.report-approvals .approval.principal{grid-area:principal!important}
.report-approvals .approval.stamp{position:absolute!important;left:33.333333%!important;bottom:0!important;transform:translateX(-50%)!important;width:4cm!important;height:4cm!important;min-width:0!important;min-height:0!important;z-index:2!important}
.report-approvals .approval.stamp img{width:auto!important;height:auto!important;max-width:4cm!important;max-height:calc(4cm - 14px)!important;object-fit:contain!important}
@media print{
  body.print-report .report-page-content.has-approvals{padding-bottom:158px!important}
  body.print-report .report-approvals{min-height:96px!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-areas:"principal deputy executor"!important;gap:0!important;overflow:visible!important}
  body.print-report .report-approvals .approval.stamp{width:4cm!important;height:4cm!important;left:33.333333%!important}
  body.print-report .report-approvals .approval.stamp img{max-width:4cm!important;max-height:calc(4cm - 14px)!important}
}

/* ===== تثبيت الختم بين الوكيل والمدير دون تغطية البيانات ===== */
.report-page-content.has-approvals{
  padding-bottom:158px!important;
}
.report-approvals{
  min-height:150px!important;
  align-items:stretch!important;
  overflow:visible!important;
}
.report-approvals .approval:not(.stamp){
  min-height:150px!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:flex-end!important;
  align-items:center!important;
  padding:0 8px 6px!important;
  position:relative!important;
  z-index:3!important;
}
.report-approvals .approval.stamp{
  left:33.333333%!important;
  top:2px!important;
  bottom:auto!important;
  transform:translateX(-50%)!important;
  width:4cm!important;
  height:4cm!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:flex-start!important;
  z-index:2!important;
}
.report-approvals .approval.stamp b{
  order:0!important;
  margin:0 0 2px!important;
}
.report-approvals .approval.stamp img{
  order:1!important;
  max-width:4cm!important;
  max-height:calc(4cm - 14px)!important;
  object-fit:contain!important;
  margin:0 auto!important;
}
@media print{
  body.print-report .report-page-content.has-approvals{
    padding-bottom:158px!important;
  }
  body.print-report .report-approvals{
    min-height:150px!important;
    align-items:stretch!important;
  }
  body.print-report .report-approvals .approval:not(.stamp){
    min-height:150px!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:flex-end!important;
    align-items:center!important;
    padding-bottom:6px!important;
  }
  body.print-report .report-approvals .approval.stamp{
    left:33.333333%!important;
    top:2px!important;
    bottom:auto!important;
    width:4cm!important;
    height:4cm!important;
  }
}

/* حذف الخط فوق منطقة الاعتمادات نهائيًا */
.report-approvals,
.report-approvals::before,
.report-approvals::after {
  border-top: none !important;
  box-shadow: none !important;
}

/* تثبيت الاعتمادات: المدير يسار، الوكيل وسط، المنفذ يمين */
.report-approvals {
  position: absolute !important;
  right: 0 !important;
  left: 0 !important;
  bottom: 0 !important;

  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-template-areas: "principal deputy executor" !important;

  align-items: center !important;
  gap: 0 !important;
  padding: 0 !important;
  border-top: none !important;
  overflow: visible !important;
  direction: ltr !important;
}

.report-approvals .approval.principal {
  grid-area: principal !important;
}

.report-approvals .approval.deputy {
  grid-area: deputy !important;
}

.report-approvals .approval.executor {
  grid-area: executor !important;
}

/* الختم بين المدير والوكيل دون أن يؤثر على الأعمدة */
.report-approvals .approval.stamp {
  position: absolute !important;

  /* الحد الفاصل بين عمود المدير وعمود الوكيل */
  left: 43% !important;


  /* نفس المستوى الرأسي للاعتمادات */
  top: 95% !important;

  transform: translate(-50%, -50%) !important;

  width: 40mm !important;
  height: 40mm !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  z-index: 5 !important;
  pointer-events: none !important;
}

/* حذف كلمة الختم وأي نص داخل خانته */
.report-approvals .approval.stamp b,
.report-approvals .approval.stamp span,
.report-approvals .approval.stamp label {
  display: none !important;
}

/* صورة الختم */
.report-approvals .approval.stamp img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 40mm !important;
  max-height: 40mm !important;
  object-fit: contain !important;
  margin: 0 !important;
}


/* حذف كلمة الختم من أسفل التقرير */
.report-approvals .approval.stamp b,
.report-approvals .approval.stamp span,
.report-approvals .approval.stamp label {
  display: none !important;
}

.report-approvals .approval.stamp {
  font-size: 0 !important;
}

.report-approvals .approval.stamp img {
  font-size: initial !important;
}

/* ===== إصلاح نهائي: منع صفحة ثانية مخصصة للاعتمادات عند إمكان احتوائها ===== */
/* تُطبّق هذه المستويات من app.js فقط عند اكتشاف تجاوز حقيقي بعد إضافة الاعتمادات. */
.report-print-page.report-fit-level-1 .report-page-content{
  top:198px!important;
}
.report-print-page.plain-template.report-fit-level-1 .report-page-content{
  top:170px!important;
}
.report-print-page.report-fit-level-1 .report-title{
  margin-bottom:9px!important;
}
.report-print-page.report-fit-level-1 .report-table{
  line-height:1.38!important;
}
.report-print-page.report-fit-level-1 .report-table th,
.report-print-page.report-fit-level-1 .report-table td{
  padding-top:4px!important;
  padding-bottom:4px!important;
}
.report-print-page.report-fit-level-1 .report-gallery{
  margin-top:7px!important;
  gap:6px!important;
}

.report-print-page.report-fit-level-2 .report-page-content.has-approvals{
  padding-bottom:150px!important;
}
.report-print-page.report-fit-level-2 .report-title{
  margin-bottom:6px!important;
  line-height:1.22!important;
}
.report-print-page.report-fit-level-2 .report-table{
  line-height:1.30!important;
  font-size:calc(var(--report-size) - .35px)!important;
}
.report-print-page.report-fit-level-2 .report-table th,
.report-print-page.report-fit-level-2 .report-table td{
  padding-top:3px!important;
  padding-bottom:3px!important;
}
.report-print-page.report-fit-level-2 .report-gallery{
  margin-top:5px!important;
  gap:5px!important;
}
.report-print-page.report-fit-level-2 .report-photo figcaption{
  min-height:18px!important;
  padding-top:2px!important;
  padding-bottom:2px!important;
}

@media print{
  body.print-report .report-print-page.report-fit-level-1 .report-page-content{top:198px!important}
  body.print-report .report-print-page.plain-template.report-fit-level-1 .report-page-content{top:170px!important}
  body.print-report .report-print-page.report-fit-level-2 .report-page-content.has-approvals{padding-bottom:150px!important}
}
