/* =====================================================================
   الواجهة 3.0 — ألوان ونمط الصورة: كحلي + أزرق + برتقالي + فيروزي
   ===================================================================== */
:root{
  --navy:#0d1b36; --navy2:#13284d; --ink:#123848;
  --g:#2f7fe0; --g2:#5aa9f5; --gl:#e8f1fd;
  --b:#2f7fe0; --b2:#5aa9f5; --bl:#e8f1fd;
  --or:#f28c28; --orl:#fff1e3; --tl:#14b3c4;
  --bg:#eef2f7; --card:#fff; --line:#e3e8f0; --line2:#eef2f7;
  --tx:#14263a; --mut:#6b7a90;
  --sh:0 1px 2px rgba(15,35,70,.05),0 6px 18px -8px rgba(15,35,70,.12);
  --sh2:0 16px 34px -16px rgba(15,35,70,.32);
}
body{background:linear-gradient(180deg,#f3f6fa 0,#eaeff6 100%) fixed!important}

/* ---------- القائمة الجانبية الكحلية ---------- */
.side{background:linear-gradient(180deg,#0f1f3d 0,#0b1730 100%)!important;border-left:0!important;box-shadow:-6px 0 24px -12px rgba(5,15,35,.6)!important}
.side .brand{border-bottom:1px solid rgba(255,255,255,.07)!important}
.side .brand b{color:#fff!important}
.side .brand small{color:#8fa3c4!important}
.side .brand img{box-shadow:0 0 0 1px rgba(255,255,255,.1),0 6px 18px -6px rgba(47,127,224,.8)!important}
.side .grp{color:#5f7398!important}
.side a.nl{color:#c9d6ec!important}
.side a.nl .ic{color:#8fa6cc!important}
.side a.nl:hover{background:rgba(255,255,255,.06)!important}
.side a.nl.on{background:linear-gradient(90deg,rgba(47,127,224,.18),rgba(47,127,224,.42))!important;color:#fff!important;
  box-shadow:inset 0 0 0 1px rgba(90,169,245,.45),0 0 18px -4px rgba(47,127,224,.75)!important}
.side a.nl.on .ic{color:#7fbcff!important}
.side a.nl.on::before{background:#5aa9f5!important;box-shadow:0 0 10px #5aa9f5}
.side a.nl .cnt{background:var(--or)!important;color:#fff!important}
.side .foot{border-top:1px solid rgba(255,255,255,.07)!important;color:#8fa3c4!important}
.side .foot button{color:#b9c9e4}
.side nav::-webkit-scrollbar{width:6px}.side nav::-webkit-scrollbar-thumb{background:#22385f;border-radius:6px}

/* ---------- الشريط العلوي ---------- */
.top{background:rgba(255,255,255,.92)!important}
.top h2{color:var(--ink)}
.userbox .av{background:linear-gradient(135deg,#1e3a8a,#2f7fe0)!important}
.bell .cnt{background:var(--or)!important}
.qs input:focus{border-color:var(--b2);box-shadow:0 0 0 4px rgba(47,127,224,.14)}

/* ---------- ألوان مربعات الأيقونات ---------- */
.tn-g,.tn-e{background:#e6effc;color:#1e4fa3}
.tn-b,.tn-s{background:#e6f0fd;color:#2f7fe0}
.tn-t,.tn-c{background:#e1f6f8;color:#0e9aab}
.tn-a{background:#fff1e3;color:#e57a12}
.tn-i{background:#e9ecfb;color:#1e3a8a}
.tn-r{background:#ffe9e2;color:#e5541b}
.tn-n{background:#edf1f6;color:#4a5b75}

/* ---------- رأس اللوحة ---------- */
.dash-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:2px 2px 18px;flex-wrap:wrap}
.dash-head h1{margin:0;font-size:25px;font-weight:700;color:var(--ink);letter-spacing:-.2px}
.dash-head p{margin:4px 0 0;color:var(--mut);font-size:14px}
.dash-head .btn .si{width:18px;height:18px}
.btn.warn-b{background:var(--orl);border-color:#fbd5ad;color:#c2620b}

/* ---------- صفوف اللوحة ---------- */
.dash-row{display:grid;gap:16px;margin-bottom:16px}
.kps{grid-template-columns:repeat(4,minmax(0,1fr))}
.kps.k3{grid-template-columns:repeat(3,minmax(0,1fr))}.kps.k2{grid-template-columns:repeat(2,minmax(0,1fr))}.kps.k1{grid-template-columns:1fr}
.kp{background:#fff;border:1px solid var(--line);border-radius:18px;padding:16px 18px;box-shadow:var(--sh);transition:transform .2s,box-shadow .2s}
.kp:hover{transform:translateY(-2px);box-shadow:var(--sh2)}
.kh{display:flex;align-items:center;justify-content:space-between;color:#4a5b75;font-size:14px;font-weight:500;margin-bottom:6px}
.kh .ix{width:38px;height:38px;border-radius:11px}.kh .ix .si{width:19px;height:19px}
.kp>b{display:block;font-size:27px;font-weight:700;color:var(--tx);letter-spacing:-.3px;line-height:1.2;margin-bottom:6px}
.tr{display:inline-flex;align-items:center;gap:3px;font-size:12.5px;font-weight:600;color:#16a34a}
.tr svg{width:14px;height:14px}
.tr.dn{color:#e5541b}.tr.nt{color:var(--mut);font-weight:500}
.r2{grid-template-columns:minmax(0,1.6fr) minmax(0,1fr)}
.r3{grid-template-columns:repeat(3,minmax(0,1fr))}
.dash-row .card{margin:0;border-radius:18px;padding:16px 18px}
.dash-row .card>h3,.ch-card .hd h3{font-size:16px!important;color:var(--ink);margin-bottom:10px}
.ch-card .hd{margin-bottom:6px}.ch-card .hd h3{flex:0 1 auto!important}.ch-card .hd .btn{margin-inline-start:auto}
.chart{width:100%;height:230px;display:block}
.chart text{font-size:11px;fill:#7a879c;font-family:inherit}
.chart .gl{stroke:#e8edf4;stroke-width:1}
.donut{display:flex;align-items:center;gap:18px;justify-content:center;flex-wrap:wrap;min-height:200px}
.donut svg{width:170px;height:170px;flex:none}
.donut ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:9px;font-size:13.5px;color:#3b4b63}
.donut li{display:flex;align-items:center;gap:8px}
.donut li i{width:11px;height:11px;border-radius:3px;flex:none}
.donut li small{color:var(--mut);margin-inline-start:4px}
.lr{display:flex;align-items:center;gap:10px;padding:8px 6px;border-radius:11px;text-decoration:none;color:#33445c;font-size:14px;background:#f6f8fc;margin-bottom:7px}
.lr:hover{background:#edf3fc}
.lr .ix{width:30px;height:30px;border-radius:9px}.lr .ix .si{width:16px;height:16px}
.lr>span:not(.ix){flex:1}.lr .ix{flex:none}.lr b{color:var(--tx)}
.emp-card .ec{display:flex;align-items:center;gap:16px;margin:8px 0 14px}
.emp-card .si.big{width:76px;height:76px;color:#2f7fe0;stroke-width:1.4;background:#e8f1fd;border-radius:20px;padding:14px}
.emp-card .ec small{display:block;color:var(--mut);font-size:13px}.emp-card .ec b{font-size:30px;font-weight:700;color:var(--tx)}
.pg{height:8px;background:#e7edf5;border-radius:8px;overflow:hidden;margin-bottom:6px}
.pg i{display:block;height:100%;background:linear-gradient(90deg,#2f7fe0,#5aa9f5);border-radius:8px}
.big-n{display:block;font-size:24px;font-weight:700;color:var(--tx);margin:2px 0 8px}
.mbars{display:flex;align-items:flex-end;gap:5px;height:64px;margin-bottom:6px}
.mbars i{flex:1;background:linear-gradient(180deg,#5aa9f5,#2f7fe0);border-radius:4px 4px 2px 2px;opacity:.55}
.mbars i.last{opacity:1;background:linear-gradient(180deg,#3b8df0,#1e3a8a)}
.mbars i.neg{background:linear-gradient(180deg,#f8b06a,#f28c28)}

/* ---------- بطاقات الأقسام (مثل أسفل الصورة) ---------- */
.sg h3{color:var(--ink)}
.sgrid{grid-template-columns:repeat(auto-fill,minmax(170px,1fr))!important;gap:14px!important}
.sec{flex-direction:column;align-items:center!important;text-align:center;gap:10px!important;padding:20px 12px 16px!important;border-radius:20px!important;border:1px solid var(--line)!important;box-shadow:var(--sh)}
.sec .ix{width:62px!important;height:62px!important;border-radius:18px;background:none!important;color:#123f6b!important}
.sec .ix .si{width:44px;height:44px;stroke-width:1.5}
.sec:nth-child(4n+2) .ix{color:#2f7fe0!important}.sec:nth-child(4n+3) .ix{color:#0e8c9c!important}.sec:nth-child(4n) .ix{color:#e57a12!important}
.sec .sx b{font-size:15.5px!important;font-weight:700!important;color:var(--ink);white-space:normal!important}
.sec .sx small{white-space:normal!important}
.sec .sx small em{color:#e57a12!important}
.sec::after{content:"";width:44px;height:3px;border-radius:3px;background:linear-gradient(90deg,#2f7fe0,#14b3c4);margin-top:2px;transition:width .25s}
.sec:hover::after{width:70px}
.sec .go{display:none!important}
.sec .nb{position:absolute;top:10px;left:10px;background:var(--or)!important;color:#fff!important}
.side-card h3 .si{color:#2f7fe0!important}

/* ---------- عناصر عامة ---------- */
.btn.p{background:linear-gradient(135deg,#2f7fe0,#1f63c4)!important;border-color:#1f63c4!important}
.btn.p:hover{background:#1f63c4!important}
.tabs button.on{color:#1f63c4!important}
.stat .ic{background:#e8f1fd}
.stat.amber .ic{background:var(--orl)}.stat.green .ic{background:#e1f6f8}
.datebox{background:linear-gradient(120deg,#0f1f3d 0%,#1e3a8a 55%,#2f7fe0 100%)!important}
.welcome{background:radial-gradient(600px 300px at 0% 0%,rgba(90,169,245,.45),transparent 60%),linear-gradient(120deg,#0f1f3d 0%,#1e3a8a 55%,#2f7fe0 100%)!important}
.qh .qn{background:linear-gradient(145deg,#2f7fe0,#1e3a8a)!important}
.qr.tot b{color:#1f63c4!important}
.qcard.cur{border-color:#5aa9f5!important}
.tabbar a.on{color:#2f7fe0!important}.tabbar a.on .ti{color:#2f7fe0!important}
.auth-logo img{box-shadow:0 10px 26px rgba(47,127,224,.35)!important}
.auth{background:radial-gradient(800px 420px at 100% 0,#dbe8fb 0,transparent 60%),radial-gradient(800px 420px at 0 100%,#ffe9d4 0,transparent 55%),var(--bg)!important}
.letter .lh{border-bottom-color:#1e3a8a!important}.letter .lh .co b{color:#1e3a8a!important}
.ph-head{border-bottom-color:#1e3a8a}.ph-head .co b{color:#1e3a8a}

/* ---------- المقاسات ---------- */
@media (max-width:1180px){.r2{grid-template-columns:1fr}.r3{grid-template-columns:repeat(2,minmax(0,1fr))}.kps{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media (min-width:701px) and (max-width:1023px){body:not(.nav-open) .side a.nl.on{box-shadow:inset 0 0 0 1px rgba(90,169,245,.45)!important}}
@media (max-width:700px){
  .dash-head h1{font-size:21px}
  .dash-row{gap:10px;margin-bottom:10px}
  .kps{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .kp{padding:12px;border-radius:16px}.kp>b{font-size:19px}.kh{font-size:12.5px}.kh .ix{width:32px;height:32px}
  .r3{grid-template-columns:1fr}
  .chart{height:190px}
  .sgrid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .sec{padding:16px 10px 12px!important}
  .sec .ix{width:50px!important;height:50px!important}.sec .ix .si{width:36px;height:36px}
}

/* ---------- الوضع الداكن ---------- */
html[data-theme=dark]{--bg:#0a1222;--card:#111c30;--line:#1f2d45;--line2:#17233a;--tx:#e3ebf7;--mut:#8b9ab3;--ink:#dbe7f7;--gl:#13284d;--bl:#13284d;--orl:#3a2410}
html[data-theme=dark] body{background:linear-gradient(180deg,#0b1424 0,#0a1120 100%) fixed!important}
html[data-theme=dark] .kp,html[data-theme=dark] .sec{background:var(--card)!important}
html[data-theme=dark] .lr{background:#15223a;color:#c4d1e6}
html[data-theme=dark] .chart .gl{stroke:#1f2d45}
html[data-theme=dark] .pg{background:#1f2d45}
html[data-theme=dark] .sec .ix{color:#7fb2f0!important}
html[data-theme=dark] .emp-card .si.big{background:#13284d}
html[data-theme=dark] .tn-g,html[data-theme=dark] .tn-e,html[data-theme=dark] .tn-i{background:#16264a}
html[data-theme=dark] .tn-b,html[data-theme=dark] .tn-s{background:#13284d}

.dh-act{display:flex;gap:8px;flex-wrap:wrap}

/* ---------- مجلد شؤون الموظفين ---------- */
.sec.folder{background:linear-gradient(160deg,#fff 0,#f2f7ff 100%)!important;border-color:#cfe0f7!important}
.fgrid{width:76px;height:76px;border-radius:20px;background:#e9f1fc;display:grid;grid-template-columns:repeat(3,1fr);gap:4px;padding:7px;box-shadow:inset 0 0 0 1px #d7e5f8}
.fgrid i{border-radius:6px;display:grid;place-items:center}
.fgrid i .si{width:13px;height:13px;stroke-width:2.2}
.sec.folder:hover .fgrid{transform:scale(1.04);transition:transform .2s}
.folder-ov{position:fixed;inset:0;z-index:120;background:rgba(10,22,45,.35);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);display:grid;place-items:center;padding:16px;opacity:0;transition:opacity .22s}
.folder-ov.open{opacity:1}
.folder-box{width:100%;max-width:820px;max-height:88vh;overflow:auto;background:rgba(255,255,255,.96);border-radius:28px;padding:22px;box-shadow:0 30px 70px -20px rgba(5,15,40,.55);transform:scale(.88);transition:transform .32s cubic-bezier(.2,.9,.25,1.15)}
.folder-ov.open .folder-box{transform:none}
.folder-box .fh{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:16px}
.folder-box h2{margin:0;font-size:22px;color:var(--ink)}.folder-box p{margin:4px 0 0;color:var(--mut);font-size:14px}
.folder-box .x{border:0;background:#edf1f6;width:38px;height:38px;border-radius:50%;cursor:pointer;font-size:17px;flex:none}
.fitems{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.side a.nl.fold{cursor:pointer}
.side a.nl.fold .chev{margin-inline-start:auto;color:#6f84a8;transition:transform .2s;display:grid}
.side a.nl.fold .cnt+.chev{margin-inline-start:6px}
.side a.nl.fold .chev .si{width:16px;height:16px}
.side a.nl.fold.open .chev{transform:rotate(-90deg)}
.side .fold-items{display:none;margin:2px 0 6px;padding-inline-start:12px;border-inline-start:1px dashed rgba(143,166,204,.35);margin-inline-start:20px}
.side .fold-items.open{display:block;animation:rise .25s ease}
.side .fold-items a.nl{font-size:14px;padding:7px 10px}
.side .fold-items a.nl.on::before{right:-25px}
@media (min-width:701px) and (max-width:1023px){body:not(.nav-open) .side .fold-items{display:none!important}body:not(.nav-open) .side a.nl.fold .chev{display:none}}
@media (max-width:700px){.fgrid{width:58px;height:58px;border-radius:16px;padding:5px;gap:3px}.fgrid i .si{width:10px;height:10px}.fitems{grid-template-columns:repeat(2,minmax(0,1fr))}.folder-box{padding:18px;border-radius:24px}}
html[data-theme=dark] .sec.folder{background:linear-gradient(160deg,#111c30 0,#13284d 100%)!important;border-color:#1f3a66!important}
html[data-theme=dark] .fgrid{background:#16264a;box-shadow:inset 0 0 0 1px #233a63}
html[data-theme=dark] .folder-box{background:rgba(17,28,48,.97)}
html[data-theme=dark] .folder-box .x{background:#1f2d45;color:#dbe7f7}

/* =====================================================================
   الشريط العلوي للتنقل (بدل الجانبي)
   ===================================================================== */
body.tnav .side,body.tnav .backdrop,body.tnav .top .menu-btn,body.tnav .top .home-btn,body.tnav .tabbar{display:none!important}
body.tnav .main{margin-right:0!important}
body.tnav .content{max-width:1500px;margin:0 auto;padding-bottom:28px}
body.tnav .top{background:linear-gradient(90deg,#0f1f3d 0,#13284d 100%)!important;border-bottom:0!important;color:#fff;padding:8px 22px;min-height:60px;position:sticky;top:0;z-index:50}
.tbrand{display:flex;align-items:center;gap:10px;text-decoration:none;color:#fff;flex:none;margin-inline-end:8px}
.tbrand img{width:38px;height:38px;border-radius:11px;box-shadow:0 0 0 1px rgba(255,255,255,.12),0 6px 16px -6px rgba(47,127,224,.8)}
.tbrand b{display:block;font-size:15px;line-height:1.2}.tbrand small{display:block;font-size:11.5px;color:#8fa3c4}
body.tnav .top h2{color:#dbe7f7!important;font-size:15px;font-weight:500;border-inline-start:1px solid rgba(255,255,255,.15);padding-inline-start:12px;margin:0}
body.tnav .top .qs input{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.14);color:#fff}
body.tnav .top .qs input::placeholder{color:#8fa3c4}
body.tnav .top .qs input:focus{background:#fff;color:var(--tx)}
body.tnav .top .qs>.si{color:#8fa3c4}
body.tnav .top .clock b{color:#fff!important}body.tnav .top .clock{color:#8fa3c4}
body.tnav .top .btn.ic{background:rgba(255,255,255,.08)!important;border-color:rgba(255,255,255,.14)!important;color:#dbe7f7!important}
body.tnav .top .userbox{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.14);color:#fff}
body.tnav .top .userbox small{color:#8fa3c4}
body.tnav .bell .cnt{box-shadow:0 0 0 2px #13284d!important}
.topnav{position:sticky;top:60px;z-index:45;display:flex;gap:4px;align-items:center;padding:8px 22px;background:rgba(255,255,255,.94);backdrop-filter:saturate(180%) blur(16px);-webkit-backdrop-filter:saturate(180%) blur(16px);border-bottom:1px solid var(--line);box-shadow:0 6px 20px -16px rgba(15,35,70,.4)}
.topnav .tn>a,.topnav a.tn,.topnav .tn>button{display:flex;align-items:center;gap:8px;padding:9px 14px;border-radius:12px;text-decoration:none;color:#33445c;font:inherit;font-size:14.5px;font-weight:500;background:none;border:0;cursor:pointer;white-space:nowrap;transition:background .15s,color .15s}
.topnav .si{width:18px;height:18px;color:#6b7f9f}
.topnav .tn:hover>button,.topnav a.tn:hover{background:#f0f4fa}
.topnav .tn.on>button,.topnav a.tn.on{background:#e8f1fd;color:#1f63c4;font-weight:600}
.topnav .tn.on .si{color:#2f7fe0}
.topnav .cv{width:15px!important;height:15px!important;transition:transform .2s}
.topnav .dd.open .cv{transform:rotate(180deg)}
.topnav .cnt{background:var(--or);color:#fff;border-radius:20px;font-size:11px;font-weight:700;min-width:19px;height:19px;display:grid;place-items:center;padding:0 5px}
.dd{position:relative}
.ddm{display:none;position:absolute;top:calc(100% + 8px);right:0;min-width:250px;background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 24px 50px -20px rgba(15,35,70,.45);padding:8px;z-index:60}
.ddm.wide{min-width:480px;display:none;grid-template-columns:1fr 1fr;gap:2px}
.dd.open .ddm{display:block;animation:sheet .18s ease}
.dd.open .ddm.wide{display:grid}
.ddm a{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:11px;text-decoration:none;color:#22344d;font-size:14px;font-weight:500}
.ddm a:hover{background:#f2f6fc}
.ddm a.on{background:#e8f1fd;color:#1f63c4;font-weight:600}
.ddm a .ix{width:34px;height:34px;border-radius:10px}.ddm a .ix .si{width:18px;height:18px}
.ddm a span:not(.ix):not(.cnt){flex:1}
.home-al .alert-list{max-height:none}
@media (max-width:1180px){body.tnav .top .clock{display:none}}
@media (max-width:1023px){
  .topnav{overflow-x:auto;scrollbar-width:none;padding:6px 10px}
  .topnav::-webkit-scrollbar{display:none}
  .ddm,.ddm.wide{position:fixed;top:auto;right:10px;left:10px;min-width:0;margin-top:8px}
  .ddm.wide{grid-template-columns:1fr 1fr}
}
@media (max-width:700px){
  body.tnav .top{padding:8px 10px;gap:8px}
  .tbrand span,body.tnav .top h2{display:none}
  .topnav{top:58px}
  .topnav .tn>a,.topnav a.tn,.topnav .tn>button{padding:8px 11px;font-size:13.5px}
  .ddm.wide{grid-template-columns:1fr}
  .ddm{max-height:65vh;overflow:auto}
  body.tnav .content{padding-bottom:calc(20px + env(safe-area-inset-bottom))}
  #toasts{bottom:calc(14px + env(safe-area-inset-bottom))!important}
}
html[data-theme=dark] .topnav{background:rgba(17,28,48,.95);border-color:var(--line)}
html[data-theme=dark] .topnav .tn>a,html[data-theme=dark] .topnav a.tn,html[data-theme=dark] .topnav .tn>button{color:#c9d6ec}
html[data-theme=dark] .topnav .tn:hover>button,html[data-theme=dark] .topnav a.tn:hover{background:#16233b}
html[data-theme=dark] .topnav .tn.on>button,html[data-theme=dark] .topnav a.tn.on{background:#13284d;color:#7fbcff}
html[data-theme=dark] .ddm{background:#111c30;border-color:var(--line)}
html[data-theme=dark] .ddm a{color:#c9d6ec}html[data-theme=dark] .ddm a:hover{background:#16233b}html[data-theme=dark] .ddm a.on{background:#13284d;color:#7fbcff}
body.tnav .top{min-width:0;overflow:visible}
body.tnav .top .qs{min-width:0;flex:1 1 0;width:auto}
body.tnav .top .qs input{min-width:0}
body.tnav .top>*{flex-shrink:0}body.tnav .top>.qs{flex-shrink:1}
@media (max-width:1023px){
  .topnav{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;background:#fff}
  .ddm,.ddm.wide{top:var(--ddt,120px)!important;max-height:calc(100vh - var(--ddt,120px) - 16px);overflow:auto}
  html[data-theme=dark] .topnav{background:#111c30}
}
.brand-row{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
.brand-row .bm{width:96px;height:96px}
.brand-row .bl{background:#fff;border:1px solid var(--line);border-radius:16px;padding:14px 18px;flex:1;min-width:240px;max-width:380px}
.brand-row .bl.dk{background:#0f1f3d;border-color:#0f1f3d}
.brand-row .bl img{width:100%;display:block}

/* =====================================================================
   الأيقونات الرسمية (بدل الإيموجي)
   ===================================================================== */
.ei{width:1.15em;height:1.15em;vertical-align:-.22em;flex:none;display:inline-block}
.ei-b{color:#2f7fe0}.ei-n{color:#1e3a8a}.ei-o{color:#e57a12}.ei-t{color:#0e9aab}.ei-g{color:#16a34a}.ei-r{color:#dc2626}.ei-m{color:#7a879c}
.btn .ei{width:17px;height:17px}
.btn.p .ei,.btn.b .ei,.btn.o .ei,.toast .ei,.upd .ei,.bd .ei,.btn.warn-b .ei{color:currentColor}
.btn.d .ei{color:#dc2626}
.btn .i{display:inline-flex}
.btn.ic .ei{width:18px;height:18px}
.stat .ic{color:#2f7fe0}
.stat .ic .ei{width:24px;height:24px}
.stat.red .ic .ei{color:#dc2626}.stat.amber .ic .ei{color:#e57a12}.stat.green .ic .ei{color:#0e9aab}.stat.blue .ic .ei{color:#2f7fe0}
.empty .ic{display:grid;place-items:center;margin:0 auto 8px;width:76px;height:76px;border-radius:22px;background:#eef3fa}
.empty .ic .ei{width:38px;height:38px;color:#8aa0bf}
.tabs .ei{width:16px;height:16px;margin-inline-end:5px;vertical-align:-.25em}
.tabs button:not(.on) .ei{color:#7a879c}
h2 .ei,h3 .ei,h4 .ei{width:19px;height:19px;margin-inline-end:4px;vertical-align:-.25em}
.md .mh h3 .ei{width:21px;height:21px}
.alert-list li .ic{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:#eef3fa;flex:none}
.alert-list li .ic .ei{width:18px;height:18px}
.kv .ei,.chk .ei{width:16px;height:16px}
/* أزرار الإجراءات (الخطابات، المالية…): مربعات ملوّنة هادئة بدل التدرجات */
.apps.mini .app .ai{background:#e8f1fd!important;display:grid;place-items:center}
.apps.mini .app .ai:has(.ei-o){background:#fff1e3!important}.apps.mini .app .ai:has(.ei-g){background:#e3f6ec!important}
.apps.mini .app .ai:has(.ei-t){background:#e1f6f8!important}.apps.mini .app .ai:has(.ei-r){background:#fde8e7!important}
.apps.mini .app .ai:has(.ei-n){background:#e9ecfb!important}
.apps.mini .app .ai i{display:grid;place-items:center}
.apps.mini .app .ai .ei{width:20px;height:20px}
.apps.mini .app{padding:9px 14px 9px 12px}
.ph-sum .ei,.calc .ei{width:15px;height:15px}
.side-card h3 .ei{color:#2f7fe0}
.letter .ei{display:none}
html[data-theme=dark] .ei-n{color:#8fb7ef}html[data-theme=dark] .ei-b{color:#6cb2ff}html[data-theme=dark] .ei-m{color:#8b9ab3}
html[data-theme=dark] .empty .ic,html[data-theme=dark] .alert-list li .ic{background:#16233b}
html[data-theme=dark] .apps.mini .app .ai{background:#13284d!important}
html[data-theme=dark] .apps.mini .app .ai:has(.ei-o){background:#3a2410!important}html[data-theme=dark] .apps.mini .app .ai:has(.ei-g){background:#12301f!important}
html[data-theme=dark] .apps.mini .app .ai:has(.ei-t){background:#0f2c2c!important}html[data-theme=dark] .apps.mini .app .ai:has(.ei-r){background:#3a1515!important}
html[data-theme=dark] .apps.mini .app .ai:has(.ei-n){background:#16264a!important}

/* إخفاء مربع المستخدم في الشريط العلوي (الحساب في قائمة الأدوات والنظام) */
body.tnav .top .userbox{display:none!important}
.ddm-sep{height:1px;background:var(--line);margin:6px 4px}

/* 12 زراً في سطر واحد على الكمبيوتر */
@media (min-width:1024px){
  .topnav{gap:2px;padding:7px 14px;flex-wrap:wrap;justify-content:flex-start}
  .topnav .tn>a,.topnav a.tn,.topnav .tn>button{padding:8px 10px;gap:6px;font-size:14px}
  .topnav .si{width:17px;height:17px}
}
@media (min-width:1024px) and (max-width:1420px){
  .topnav .tn>a,.topnav a.tn,.topnav .tn>button{padding:8px 8px;font-size:13.5px}
}

/* =====================================================================
   الرئيسية: مقاسات أصغر وألوان هادئة مريحة للعين
   ===================================================================== */
:root{--ring:#e3e9f2}
html[data-theme=dark]{--ring:#22324d}
.ring-empty{stroke:var(--ring)}
.ch-empty{font-size:13px!important;fill:var(--mut)!important}
.dash-row{gap:12px;margin-bottom:12px}
.kp{padding:12px 14px;border-radius:14px}
.kh{font-size:13px;margin-bottom:2px}
.kh .ix{width:32px;height:32px;border-radius:9px}.kh .ix .si{width:16px;height:16px}
.kp>b{font-size:21px;margin-bottom:2px}
.tr{font-size:12px}
.dash-row .card{padding:12px 14px;border-radius:14px}
.dash-row .card>h3,.ch-card .hd h3{font-size:14.5px!important;margin-bottom:6px}
.ch-card .hd{margin-bottom:2px}.ch-card .hd .btn.sm{min-height:28px;padding:2px 10px;font-size:12.5px}
.chart{height:170px}
.chart text{font-size:10.5px}
.donut{min-height:170px;gap:14px}
.donut svg{width:126px;height:126px}
.donut ul{font-size:12.5px;gap:7px}
.lr{padding:6px 6px;margin-bottom:5px;font-size:13px;border-radius:10px}
.lr .ix{width:26px;height:26px;border-radius:8px}.lr .ix .si{width:14px;height:14px}
.emp-card .ec{gap:12px;margin:4px 0 10px}
.emp-card .si.big{width:54px;height:54px;padding:11px;border-radius:15px}
.emp-card .ec b{font-size:23px}
.pg{height:6px}
.big-n{font-size:20px;margin:0 0 6px}
.mbars{height:46px;gap:4px}
.home-al{padding:12px 14px}
.home-al .alert-list li{padding:7px 2px;font-size:13.5px}
body.tnav .content{max-width:1320px;padding-top:18px}
/* ألوان هادئة للوضع الداكن */
html[data-theme=dark]{--bg:#0d1526;--card:#131d31;--line:#1e2b42;--tx:#dbe4f2;--mut:#8796ae}
html[data-theme=dark] body{background:#0d1526!important}
html[data-theme=dark] .kp,html[data-theme=dark] .dash-row .card{background:#131d31!important;border-color:#1e2b42!important;box-shadow:none}
html[data-theme=dark] .kp>b,html[data-theme=dark] .big-n,html[data-theme=dark] .emp-card .ec b{color:#e6edf8}
html[data-theme=dark] .chart .gl{stroke:#1c2840}
html[data-theme=dark] .chart text{fill:#71809a}
html[data-theme=dark] .lr{background:#18233a}
html[data-theme=dark] .emp-card .si.big{background:#172a4a;color:#6aa6f0}
html[data-theme=dark] .tn-r{background:#3a1d1d;color:#f08a6c}
html[data-theme=dark] .tr{color:#4cc38a}html[data-theme=dark] .tr.dn{color:#f08a6c}
@media (max-width:700px){.kp>b{font-size:18px}.chart{height:150px}.donut svg{width:110px;height:110px}}

/* =====================================================================
   النماذج ونوافذ التسجيل: وضوح وتباين مريح في الوضعين
   ===================================================================== */
.md{background:#fff}
.md .mh{background:linear-gradient(180deg,#f6f9fd,#fff);border-radius:20px 20px 0 0}
.md .mh h3{color:#13284d}
.md .mc{background:#fff}
.md .mf{background:#f8fafd;border-radius:0 0 20px 20px}
label.f>span{color:#3b4b63;font-weight:500;font-size:13.5px}
label.f>span i{color:#e5541b}
.in,input.in,select.in,textarea.in{background:#fbfcfe;border:1px solid #d6dfeb;color:#14263a}
.in:hover{border-color:#bccbdf}
.in:focus{background:#fff;border-color:#2f7fe0;box-shadow:0 0 0 4px rgba(47,127,224,.14)}
.in::placeholder{color:#9aa8bc}
.in[disabled],.in[readonly]{background:#f1f4f9;color:#6b7a90}
small.muted,.f small{color:#6b7a90}
.md .grid{gap:2px 16px}
.chk input{accent-color:#2f7fe0}
/* الوضع الداكن */
html[data-theme=dark] .md{background:#141f34;border-color:#22314d}
html[data-theme=dark] .md .mh{background:#17243c;border-bottom-color:#22314d}
html[data-theme=dark] .md .mh h3{color:#e3ebf7}
html[data-theme=dark] .md .mc{background:#141f34}
html[data-theme=dark] .md .mf{background:#111b2e;border-top-color:#22314d}
html[data-theme=dark] .md .mh .x{background:#22314d;color:#dbe7f7}
html[data-theme=dark] label.f>span{color:#b8c6dc}
html[data-theme=dark] .in,html[data-theme=dark] input.in,html[data-theme=dark] select.in,html[data-theme=dark] textarea.in{background:#0f192b!important;border-color:#2a3b5a!important;color:#e6edf8!important;color-scheme:dark}
html[data-theme=dark] .in:hover{border-color:#36507a!important}
html[data-theme=dark] .in:focus{background:#101d33!important;border-color:#5aa9f5!important;box-shadow:0 0 0 4px rgba(90,169,245,.16)}
html[data-theme=dark] .in::placeholder{color:#62728c}
html[data-theme=dark] .in[disabled],html[data-theme=dark] .in[readonly]{background:#16213a!important;color:#8796ae!important}
html[data-theme=dark] select.in option{background:#141f34;color:#e6edf8}
html[data-theme=dark] small.muted,html[data-theme=dark] .f small{color:#8796ae}
html[data-theme=dark] .calc{background:#132544;color:#dbe4f2}

/* =====================================================================
   التحية والساعة الثابتة في الشريط العلوي
   ===================================================================== */
body.tnav .datebox{display:none!important}
body.tnav .top h2{display:none!important}
body.tnav .top{min-height:68px}
.tgreet{display:flex;flex-direction:column;line-height:1.35;padding-inline-start:14px;border-inline-start:1px solid rgba(255,255,255,.14);flex:none;max-width:360px;overflow:hidden}
.tgreet b{color:#fff;font-size:16px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tgreet small{color:#a9bbd8;font-size:12.5px;white-space:nowrap}
body.tnav .top .clock{display:flex!important;flex-direction:row;align-items:center;margin-inline-start:auto;padding:4px 14px;border-radius:12px;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.1)}
body.tnav .top .clock b{font-size:22px!important;font-weight:700;letter-spacing:.5px;color:#fff!important;font-variant-numeric:tabular-nums}
body.tnav .top .clock span{display:none}
body.tnav .top .qs{max-width:340px}
.topnav{top:68px}
@media (max-width:1180px){.tgreet small{display:none}.tgreet{max-width:230px}body.tnav .top .clock b{font-size:18px!important}}
@media (max-width:1023px){.tgreet{display:none}}
@media (max-width:700px){body.tnav .top{min-height:58px}.topnav{top:58px}body.tnav .top .clock{display:none!important}}

/* =====================================================================
   كثافة مضغوطة لكل الصفحات + صفحة واحدة ثابتة بدون نزول (الكمبيوتر)
   ===================================================================== */
@media (min-width:1024px){
  body{font-size:14px}
  body.tnav .content{padding:12px 18px 12px;max-width:1480px}
  .card{padding:12px 14px;margin-bottom:12px;border-radius:14px}
  .card>h3,.card .hd h3{font-size:14.5px!important;margin-bottom:8px}
  .hd{margin-bottom:8px;gap:8px}
  .stats{grid-template-columns:repeat(auto-fill,minmax(178px,1fr));gap:8px;margin-bottom:10px}
  .stat{padding:8px 10px;gap:10px;border-radius:12px;min-height:0}
  .stat .ic{width:34px;height:34px;border-radius:10px;font-size:17px}
  .stat .ic .ei{width:18px;height:18px}
  .stat .v{font-size:17px;line-height:1.15}
  .stat .l{font-size:12px;line-height:1.3}
  .stat .s{margin-top:1px}.stat .s .bd{font-size:11px;padding:0 7px}
  .btn{min-height:34px;padding:6px 12px;font-size:13.5px}
  .btn.sm{min-height:28px;padding:3px 9px;font-size:12.5px}
  .btn.ic{width:36px;height:36px}
  .in,input.in,select.in,textarea.in{min-height:36px;padding:6px 10px;font-size:13.5px}
  label.f{margin-bottom:8px}label.f>span{font-size:12.5px;margin-bottom:3px}
  .tools{margin-bottom:10px;gap:6px}
  .tabs{margin-bottom:12px}.tabs button{padding:6px 12px;font-size:13.5px}
  table.t{font-size:13px}table.t th{padding:7px 10px;font-size:12.5px}table.t td{padding:6px 10px}
  .av-s{width:30px;height:30px}
  .empty{padding:18px 10px}.empty .ic{width:56px;height:56px;border-radius:16px}.empty .ic .ei{width:26px;height:26px}
  .alert-list li{padding:6px 2px}.alert-list li .ic{width:28px;height:28px}.alert-list li .x b{font-size:13.5px}
  .bars .row{margin-bottom:5px;font-size:13px}.bars .bar{height:9px}
  .ph-sum{margin:6px 0;gap:6px}
  .apps.mini{margin-bottom:12px!important;gap:8px!important}.apps.mini .app{padding:6px 12px 6px 8px}
  .apps.mini .app .ai{width:30px!important;height:30px!important;border-radius:9px!important}.apps.mini .app .ai .ei{width:16px;height:16px}
  .apps.mini .app .an{font-size:13px!important}
  .qcard{padding:10px;gap:3px}.qh .qn{width:34px;height:34px;font-size:17px;border-radius:10px}
  /* الجداول الطويلة تتمرر داخل إطارها والعناوين ثابتة، فالصفحة لا تنزل */
  .content .tw{max-height:calc(100vh - 330px);min-height:160px}
  .content .tw.cards{max-height:calc(100vh - 330px)}
  /* لوحة التحكم: كل شيء في شاشة واحدة */
  .content:has(.datebox) .cols{grid-template-columns:1.25fr 1fr;gap:12px;height:calc(100vh - 68px - 52px - 24px - var(--statsH,180px));min-height:260px}
  .content:has(.datebox) .cols>*{min-height:0;overflow:auto;margin:0}
  .content:has(.datebox) .cols>div{display:flex;flex-direction:column;gap:10px;padding:0}
  .content:has(.datebox) .cols>div>.card{margin:0}
  .content:has(.datebox) .cols>.card .alert-list{max-height:none}
  .content:has(.datebox) .stats{--rows:2}
}
@media (min-width:1024px) and (max-height:760px){
  .stat{padding:6px 9px}.stat .ic{width:30px;height:30px}.stat .v{font-size:16px}
  .content .tw{max-height:calc(100vh - 300px)}
}
@media (min-width:1024px){
  /* الرئيسية: الأرقام فوق، الرسوم والبطاقات يمين، التنبيهات يسار — شاشة واحدة */
  .content:has(.home-al){display:grid;grid-template-columns:minmax(0,1fr) 320px;grid-template-rows:auto minmax(0,1fr) auto;gap:12px;height:calc(100vh - 68px - 52px - 24px);min-height:520px}
  .content:has(.home-al)>*{margin:0!important;min-height:0}
  .content:has(.home-al) .kps{grid-column:1/-1}
  .content:has(.home-al) .r2{grid-column:1;grid-row:2}
  .content:has(.home-al) .r3{grid-column:1;grid-row:3}
  .content:has(.home-al) .home-al{grid-column:2;grid-row:2/4;overflow:auto}
  .content:has(.home-al) .foot-note{display:none}
  .content:has(.home-al) .r2 .card{display:flex;flex-direction:column;min-height:0}
  .content:has(.home-al) .r2 .chart{flex:1;height:auto;min-height:120px}
  .content:has(.home-al) .donut{flex:1;min-height:0}
  .content:has(.home-al) .donut svg{width:min(126px,22vh);height:min(126px,22vh)}
  .content:has(.home-al) .r3 .card{padding:10px 12px}
  .content:has(.home-al) .lr{padding:4px 6px;margin-bottom:4px}
  .content:has(.home-al) .mbars{height:34px}
  /* الإقرار الضريبي: الأرباع مضغوطة والجدول يتمرر داخله */
  .quarters{gap:10px}.qr{font-size:12.5px;padding:1px 0}.qr.tot{padding-top:5px}.qr.tot b{font-size:15px}.qb .btn.sm{min-height:26px}
  .content:has(.quarters) .tw{max-height:calc(100vh - 590px);min-height:110px}
  .content:has(.quarters) .card>p.muted.sm{font-size:11.5px;margin:6px 0 0}
}
@media (min-width:1024px){
  .content:has(.home-al){flex:none;max-height:calc(100vh - 68px - 52px);box-sizing:border-box;height:calc(100vh - 68px - 52px)}
  .content:has(.home-al) .r2{min-height:0;overflow:hidden}
  .content:has(.home-al) .r2>.card{height:100%;overflow:hidden}
  .content:has(.home-al) .r2 .chart{height:100%;max-height:100%}
}
@media (min-width:1024px){
  .content .tw,.content .tw.cards{max-height:calc(100vh - 350px)}
  /* المالية: الجداول أقصر لأن فوقها أرقام وأزرار */
  .content:has(.apps.mini) .tw{max-height:calc(100vh - 490px);min-height:140px}
  /* مطابقة البنك وتبويبات المالية غير «الحركات»: نخفي الأرقام والأزرار العامة المكررة */
  .content:has(.rec2)>.stats,.content:has(.rec2)>.apps.mini,.content:has(tr[data-act=finMonth])>.apps.mini{display:none}
  .content:has(.rec2) .tw{max-height:calc(100vh - 640px);min-height:120px}
  .content:has(tr[data-act=finMonth]) .tw{max-height:calc(100vh - 400px)}
  .rec2{gap:10px}.rec2 .card{margin-bottom:10px!important}
  .rec-sum table.t td{padding:4px 10px}.rec-diff{margin-top:6px;padding:6px 12px;font-size:14px}
  /* الإقرار الضريبي */
  .content:has(.quarters) .stats{margin-bottom:8px}
  .content:has(.quarters) .tw{max-height:calc(100vh - 640px);min-height:100px}
  .qcard{padding:8px 10px}.qh{margin-bottom:0}.qs{margin:2px 0}
  /* الرواتب وحاسبة التاريخ */
  .content .card .grid{gap:0 12px}
}
@media (min-width:1024px){
  .content:has(.rec2)>.apps.mini,.content:has(.rec2)>.stats,.content:has(tr[data-act=finMonth])>.apps.mini{display:none!important}
  /* مطابقة البنك: الكشف والدفاتر يمين، مذكرة التسوية يسار */
  .card:has(>.rec2){display:grid;grid-template-columns:minmax(0,2.1fr) minmax(0,1fr);column-gap:12px;align-items:start}
  .card:has(>.rec2)>*{grid-column:1/-1}
  .card:has(>.rec2)>.rec2{grid-column:1}
  .card:has(>.rec2)>.rec2+.card{grid-column:2;margin:0!important}
  .card:has(>.rec2)>.rec2+.card .rec-sum{grid-template-columns:1fr}
  .content:has(.rec2) .tw{max-height:calc(100vh - 470px)}
  /* الإقرار الضريبي */
  .content:has(.quarters) .card>p.muted.sm{display:none}
  .qcard{gap:1px}.qr{line-height:1.45}.qh small{font-size:11.5px}.qh b{font-size:14.5px}
  .content:has(.quarters) .empty{padding:10px}.content:has(.quarters) .empty .ic{width:40px;height:40px;margin-bottom:4px}
  .content:has(.quarters) .tw{max-height:calc(100vh - 600px)}
  /* حاسبة التاريخ: 4 بطاقات في صف واحد */
  .content>.grid.c2:only-child{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
  .content>.grid.c2:only-child>.card{margin:0}
}
@media (min-width:1024px) and (max-width:1250px){.content>.grid.c2:only-child{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (min-width:1024px){
  .content>.grid.c2:only-child{align-items:start;max-height:calc(100vh - 68px - 52px - 24px)}
  .content>.grid.c2:only-child>.card{max-height:calc(100vh - 68px - 52px - 24px);overflow:auto;padding:10px 12px}
  .content>.grid.c2:only-child label.f{margin-bottom:6px}
}
@media print{
  html,body,body.tnav{background:#fff!important;background-image:none!important}
  #printArea,#printArea *{box-shadow:none!important}
  #printArea .ph-head,#printArea .pdf-doc{background:#fff!important}
}
@media print{
  @page{margin:0}
  @page portrait{size:A4 portrait;margin:0}
  body.printing #printArea{padding:10mm;background:#fff}
  body.portrait.printing #printArea{padding:16mm}
}

/* =====================================================================
   معاينة الطباعة (كل الأجهزة)
   ===================================================================== */
body.pv-open{overflow:hidden}
.pv-ov{position:fixed;inset:0;z-index:300;background:#e9edf3;display:flex;flex-direction:column;opacity:0;transition:opacity .2s}
.pv-ov.open{opacity:1}
.pv-bar{display:flex;align-items:center;gap:10px;padding:10px 16px;padding-top:max(10px,env(safe-area-inset-top));background:linear-gradient(90deg,#0f1f3d,#13284d);color:#fff;flex-wrap:wrap}
.pv-t{flex:1;min-width:160px;line-height:1.35}.pv-t b{display:flex;align-items:center;gap:6px;font-size:15.5px}.pv-t small{display:block;color:#a9bbd8;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pv-t b .ei{color:#fff}
.pv-z,.pv-a{display:flex;gap:6px;align-items:center}
.pv-bar .btn{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.18);color:#fff}
.pv-bar .btn .ei{color:#fff!important}
.pv-bar .btn.p{background:linear-gradient(135deg,#2f7fe0,#1f63c4)!important;border-color:#1f63c4!important}
.pv-bar .btn.sm{min-width:62px;font-variant-numeric:tabular-nums}
.pv-body{flex:1;overflow:auto;padding:24px;-webkit-overflow-scrolling:touch;display:flex;justify-content:center;align-items:flex-start}
.pv-wrap{position:relative;flex:none;margin:0 auto}
.pv-page{position:absolute;top:0;right:0;transform-origin:top right;background:#fff;color:#1f2d3a;box-shadow:0 10px 30px rgba(15,35,70,.22),0 1px 3px rgba(15,35,70,.12);border-radius:2px;box-sizing:border-box;padding:28px}
.pv-page.portrait{padding:0}
.pv-page .letter{min-height:1123px}
.pv-page table.t th{position:static}
@media (max-width:700px){
  .pv-bar{padding:8px 10px;gap:8px}
  .pv-t{flex-basis:100%}
  .pv-z{order:2}.pv-a{order:3;margin-inline-start:auto}
  .pv-a .tx{display:none}
  .pv-body{padding:10px 8px calc(20px + env(safe-area-inset-bottom))}
}
@media print{.pv-ov{display:none!important}}
@media (min-width:1024px) and (max-width:1440px){
  .topnav{gap:1px;padding-left:10px;padding-right:10px}
  .topnav .tn>a,.topnav a.tn,.topnav .tn>button{padding:8px 6px;gap:5px}
}

/* اختيار الموظفين في التقارير */
.ep-btn{display:inline-flex;align-items:center;gap:8px;cursor:pointer;min-width:210px;max-width:280px;font-weight:600;text-align:right}
.ep-btn .t{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ep-btn .cv{color:var(--mut);font-size:11px}
.ep-btn.on{border-color:var(--g)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--g) 18%,transparent);color:var(--g)}
#epOv{position:fixed;inset:0;z-index:900}
#epOv .ep-pop{position:fixed;display:flex;flex-direction:column;background:var(--card);color:var(--tx);border:1px solid var(--line);border-radius:16px;box-shadow:var(--sh2);overflow:hidden;animation:epIn .14s ease-out}
@keyframes epIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
#epOv.sheet{background:rgba(8,16,32,.45)}
#epOv.sheet .ep-pop{left:10px;right:10px;bottom:10px;top:auto;max-height:78vh;border-radius:18px}
.ep-s{position:relative;padding:12px 12px 8px}
.ep-s .i{position:absolute;right:24px;top:50%;transform:translateY(-35%);color:var(--mut);pointer-events:none;display:inline-flex}
.ep-s .in{width:100%;padding-right:38px!important;border-color:var(--g)!important}
.ep-hd{display:flex;align-items:center;justify-content:space-between;padding:6px 14px 8px;border-bottom:1px solid var(--line2)}
.ep-all{display:flex;align-items:center;gap:8px;cursor:pointer}
.ep-cnt{font-size:12px;font-weight:700;padding:3px 10px;border-radius:20px;background:var(--line2);color:var(--mut)}
.ep-cnt.full{background:color-mix(in srgb,#16a37f 14%,transparent);color:#119170}
.ep-ls{flex:1;overflow:auto;padding:6px 8px;min-height:120px}
.ep-it{display:flex;align-items:center;gap:8px;padding:8px 8px;border-radius:10px;cursor:pointer}
.ep-it:hover{background:var(--line2)}
.ep-it .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.ep-only{border:1px solid color-mix(in srgb,var(--g) 35%,transparent);background:color-mix(in srgb,var(--g) 8%,transparent);color:var(--g);font:inherit;font-size:11px;font-weight:700;padding:2px 8px;border-radius:6px;cursor:pointer;opacity:.75}
.ep-it:hover .ep-only{opacity:1}
.ep-it .no{font-size:11px;font-weight:700;color:var(--mut);background:var(--line2);padding:3px 7px;border-radius:6px;direction:ltr;font-variant-numeric:tabular-nums}
#epOv input[type=checkbox]{width:17px;height:17px;accent-color:#16a37f;flex:none;margin:0}
.ep-ft{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-top:1px solid var(--line2)}
.ep-ok{background:#16a37f!important;border-color:#16a37f!important;color:#fff!important}
.ep-ok:disabled{opacity:.5;cursor:not-allowed}
.ep-rst{border:0;background:none;color:#d64545;font:inherit;font-size:13px;font-weight:600;cursor:pointer;padding:6px}
@media print{#epOv{display:none!important}}
.ep-tt{padding:14px 14px 4px;font-weight:700;font-size:14px}
.ep-tt small{display:block;font-weight:500;font-size:11.5px;color:var(--mut);margin-top:3px}
.pc-btn{min-width:180px}
/* إجراءات سطر التقرير */
.rr{display:inline-flex;gap:4px;white-space:nowrap}
.rr .rr-b{width:30px;height:30px;padding:0!important;display:inline-flex;align-items:center;justify-content:center}
.rr .rr-b .ico,.rr .rr-b svg{width:15px;height:15px}
.rr .rr-b.d{color:#d64545}
td.rr-c{width:1%}
@media print{.rr{display:none!important}}
/* اتجاه الطباعة */
.pv-o{display:inline-flex;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.18);border-radius:10px;padding:3px;gap:2px}
.pv-o button{display:inline-flex;align-items:center;gap:6px;border:0;background:none;color:#c9d6ea;font:inherit;font-size:13px;font-weight:600;padding:6px 12px;border-radius:7px;cursor:pointer}
.pv-o button:hover{color:#fff}
.pv-o button.on{background:#fff;color:#13284d;box-shadow:0 1px 3px rgba(0,0,0,.2)}
@media (max-width:700px){.pv-o button{padding:6px 9px}.pv-o button span{display:none}}
@media print{body.portrait #printArea{page:portrait}}
.pt-fit table.t{width:100%!important;table-layout:auto;font-size:8.5px!important}
.pt-fit table.t th,.pt-fit table.t td{padding:3px 4px!important;white-space:normal!important;word-break:break-word;overflow-wrap:anywhere}
.pt-fit table.t .nowrap{white-space:normal!important}
.pv-page .pt-fit{padding:26px 22px}
/* تنبيه ترحيل المصاريف الثابتة */
.fx-bn{display:flex;align-items:center;gap:12px;margin:0 0 10px;padding:10px 14px;border-radius:12px;background:var(--orl);border:1px solid color-mix(in srgb,var(--or) 35%,transparent)}
.fx-bn .i{display:inline-flex;color:var(--or)}
.fx-bn .g{flex:1;min-width:0;line-height:1.45}.fx-bn .g small{display:block;color:var(--mut);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:640px){.fx-bn{flex-wrap:wrap}.fx-bn .g{flex-basis:calc(100% - 40px)}}

/* =====================================================================
   الجوال والآيباد: بدون تمرير يمين/يسار — الشريط العلوي شبكة ظاهرة كاملة
   ===================================================================== */
html,body{max-width:100%;overflow-x:hidden}
@media (max-width:1023px){
  .topnav{overflow:visible!important;flex-wrap:wrap;justify-content:center;gap:4px}
  .tabs{flex-wrap:wrap;overflow:visible!important;gap:4px;border-bottom:0}
  .tabs button{border:1px solid var(--line)!important;border-radius:10px!important;margin:0!important}
  .tools{flex-wrap:wrap}
  .tools>.in,.tools>select.in,.tools>input.in{max-width:100%!important;min-width:0}
  .ph-sum{flex-wrap:wrap}
  img,svg,video,canvas{max-width:100%}
}
@media (max-width:700px){
  .topnav{position:static!important;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;padding:6px!important}
  .topnav>.tn,.topnav>a.tn{min-width:0;width:100%}
  .topnav .tn>a,.topnav a.tn,.topnav .tn>button{flex-direction:column;justify-content:center;gap:3px!important;width:100%;min-width:0;height:100%;padding:6px 2px!important;font-size:10.5px!important;line-height:1.25;text-align:center;white-space:normal;border-radius:10px;position:relative}
  .topnav .tn span:not(.cnt){white-space:normal;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:break-word}
  .topnav .si{width:19px!important;height:19px!important}
  .topnav .si.cv{display:none}
  .topnav .cnt{position:absolute;top:2px;left:4px;min-width:16px;height:16px;font-size:9.5px;padding:0 4px}
  .tabs button{flex:1 1 auto;padding:7px 9px!important;font-size:12.5px!important}
  .tools>.in,.tools>select.in,.tools>input.in,.tools>.ep-btn{flex:1 1 140px;max-width:none!important}
  .tools .search{flex-basis:100%}
  .tools label.sm{flex:none}
  .tools .grow{display:none}
  .card{padding:12px!important}
  .md.wide,.md{max-width:calc(100vw - 16px)!important}
}

/* الآيباد: الجداول بطاقات بعمودين بدل التمرير الجانبي */
@media (min-width:701px) and (max-width:1023px){
  .tw.cards{border:0;background:none;overflow:visible}
  .tw.cards table.t,.tw.cards tbody,.tw.cards tfoot,.tw.cards tr,.tw.cards td{display:block;width:100%}
  .tw.cards thead{display:none}
  .tw.cards tr{background:#fff!important;border:1px solid var(--line);border-radius:12px;margin-bottom:10px;padding:6px 12px;box-shadow:0 1px 3px rgba(16,40,60,.06)}
  .tw.cards td{border:0;padding:6px 0;display:flex;justify-content:space-between;align-items:center;gap:12px;text-align:left;white-space:normal}
  .tw.cards td::before{content:attr(data-th);color:var(--mut);font-size:12.5px;text-align:right;flex:none;max-width:46%;font-weight:400}
  .tw.cards td[data-th=""]::before{display:none}
  .tw.cards td[data-th=""]{justify-content:flex-end}
  .tw.cards td:first-child{border-bottom:1px dashed var(--line);padding-bottom:9px;margin-bottom:3px;justify-content:flex-start;text-align:right}
  .tw.cards td:first-child::before{display:none}
  .tw.cards td .in{max-width:62%}
  .tw.cards td{flex-wrap:wrap;row-gap:6px}
  .tw.cards td>div.nowrap{display:flex;align-items:center;gap:6px;margin:0!important;margin-inline-start:auto!important}
  .tw.cards td input[type=time].in{width:124px;max-width:none}
  .tw.cards td>.nowrap{white-space:normal;display:flex;flex-wrap:wrap;gap:4px;justify-content:flex-end}
  .tw.cards tfoot tr{background:#f5f9fa!important}
  .tw.cards tfoot td{border-top:0}
  .tw.cards tr.click:active{background:#f1f8f7!important}
  html[data-theme=dark] .tw.cards tr{background:var(--card)!important;box-shadow:0 1px 3px rgba(0,0,0,.4)}
  html[data-theme=dark] .tw.cards tfoot tr{background:#1c2733!important}
  html[data-theme=dark] .tw.cards tr.click:active{background:#1f2e3a!important}
  .tw.cards tbody{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .tw.cards tbody tr{margin-bottom:0}
  .tw.cards tfoot tr{margin-top:10px}
}
