/* حضور الهيثم — ثيم داكن على نمط «منتظرون»: أخضر زمرّدي + ذهبي على خلفية داكنة مخضرّة */
:root {
  color-scheme: dark;
  --bg: #0d1512; --bg2: #0a100e; --card: #16221e; --card2: #1c2b26; --elev: #20302a;
  --line: rgba(255,255,255,.09); --line2: rgba(47,158,143,.22);
  --teal: #2f9e8f; --teal2: #3bbfa9; --teal-soft: rgba(47,158,143,.15);
  --gold: #cba14b; --gold2: #dcb968; --gold-soft: rgba(203,161,75,.16);
  --text: #e9f1ee; --muted: #8ea79f;
  --ok: #33b98a; --bad: #e0625b; --warn: #cba14b; --info: #57a6e6;
  --navy: #e9f1ee;         /* العناوين صارت فاتحة على الداكن */
  --orange: var(--gold); --orange2: var(--gold2);
  --radius: 18px; --radius-sm: 12px;
  --sh1: 0 2px 10px rgba(0,0,0,.35);
  --sh2: 0 14px 34px rgba(0,0,0,.5);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { overflow-x: hidden; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: "Noto Kufi Arabic", "Segoe UI", Tahoma, system-ui, sans-serif; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body { padding-bottom: 92px; min-height: 100vh;
  background-image: radial-gradient(900px 380px at 100% -6%, rgba(47,158,143,.10), transparent 60%),
                    radial-gradient(700px 320px at -10% 4%, rgba(203,161,75,.06), transparent 55%); background-attachment: fixed; }

/* ===== الرأس ===== */
header#top { display: flex; align-items: center; gap: 12px; color: #fff; padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(180deg, #10201b, #0c1613); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line2); box-shadow: 0 4px 18px rgba(0,0,0,.4); }
header .brand { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
header .brand-text { display: flex; flex-direction: column; flex: 1; line-height: 1.3; min-width: 0; }
header .brand-text b { font-size: 14.5px; color: var(--teal2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header small { color: #9fb6ae; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { background: var(--teal-soft); color: var(--teal2); border: 1px solid var(--line2); width: 40px; height: 40px; border-radius: 12px; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: .15s; }
.iconbtn:active { transform: scale(.9); }
.badge { background: rgba(255,255,255,.12); color: #fff; font-size: 12px; padding: 4px 11px; border-radius: 20px; white-space: nowrap; }
.badge.warn { background: var(--gold); color: #201a0a; }
main { padding: 16px 14px; max-width: 940px; margin: 0 auto; animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== الشريط السفلي (٥ عناصر ثابتة، النشط ذهبي) ===== */
nav#nav { position: fixed; bottom: 0; right: 0; left: 0; background: rgba(12,20,17,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line2);
  display: flex; justify-content: space-around; gap: 2px; padding: 7px 6px calc(8px + env(safe-area-inset-bottom)); z-index: 5; }
nav#nav a, nav#nav .navmore { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: 0; color: var(--muted); font: inherit; font-size: 10px; font-weight: 600; padding: 5px 2px; border-radius: 13px; cursor: pointer; text-decoration: none; transition: color .15s; }
nav#nav a .ic, nav#nav .navmore .ic { font-size: 20px; line-height: 1.1; transition: transform .15s; }
nav#nav a .lbl, nav#nav .navmore .lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav#nav a.active { color: var(--gold2); }
nav#nav a.active .ic { transform: translateY(-2px) scale(1.12); filter: drop-shadow(0 3px 6px rgba(203,161,75,.4)); }
nav#nav a .dot { position: absolute; top: 0; left: 50%; margin-left: 4px; background: var(--bad); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }

/* ===== الدرج الجانبي ===== */
#backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 29; backdrop-filter: blur(2px); }
#drawer { position: fixed; top: 0; bottom: 0; right: 0; width: min(84vw, 330px); background: var(--card); z-index: 30; transform: translateX(105%);
  transition: transform .26s cubic-bezier(.4,0,.2,1); box-shadow: -12px 0 44px rgba(0,0,0,.6); display: flex; flex-direction: column; border-left: 1px solid var(--line2); }
#drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px; padding-top: max(18px, env(safe-area-inset-top)); background: var(--bg); border-bottom: 1px solid var(--line2); flex-direction: row-reverse; }
.drawer-head img { width: 44px; height: 44px; border-radius: 12px; }
.drawer-head b { font-size: 17px; color: var(--teal2); } .drawer-head .grow > div { font-size: 12px; color: var(--muted); }
.drawer-list { flex: 1; overflow-y: auto; padding: 10px 6px; }
.drawer-list a { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: 13px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 14.5px; margin-bottom: 2px; }
.drawer-list a .ic { font-size: 20px; width: 26px; text-align: center; color: var(--teal2); }
.drawer-list a.active { background: var(--gold-soft); color: var(--gold2); } .drawer-list a.active .ic { color: var(--gold2); }
.drawer-list a:active { background: var(--elev); }
#logoutLink { color: var(--bad) !important; margin-top: 8px; border-top: 1px solid var(--line); border-radius: 0; padding-top: 16px; }
#logoutLink .ic { color: var(--bad) !important; }

/* ===== شاشة المختصرات ===== */
.launch { display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: 12px; }
.launch a { background: var(--card); border: 1px solid var(--line2); border-radius: 18px; padding: 20px 8px; text-align: center; box-shadow: var(--sh1);
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: var(--text); transition: transform .12s, border-color .18s, box-shadow .18s; position: relative; overflow: hidden; }
.launch a .ic { font-size: 26px; line-height: 1; filter: drop-shadow(0 3px 6px rgba(0,0,0,.4)); }
.launch a b { font-size: 11.5px; font-weight: 700; color: var(--text); }
.launch a:active { transform: scale(.96); border-color: var(--teal); }

/* ===== العناوين والبطاقات ===== */
h1 { font-size: 18px; margin: 4px 0 15px; color: #fff; font-weight: 800; }
h2 { font-size: 14.5px; margin: 18px 0 9px; color: var(--teal2); font-weight: 700; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--sh1); animation: rise .26s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: 13px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 11px 0 5px; font-weight: 600; }

/* ===== الحقول ===== */
input, select, textarea { width: 100%; padding: 13px 14px; border: 1.5px solid var(--line2); border-radius: var(--radius-sm); font: inherit; background: var(--bg2); color: var(--text); transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #6f857e; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
input[type=checkbox] { width: 21px; height: 21px; vertical-align: middle; accent-color: var(--teal); }
select option { background: var(--card); color: var(--text); }
textarea { min-height: 74px; }

/* ===== الأزرار ===== */
button, .btn { font: inherit; border: 0; border-radius: 14px; padding: 12px 18px; background: linear-gradient(135deg, #26584f, #2f7d70); color: #eafffb; cursor: pointer; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: transform .1s, filter .15s, box-shadow .18s; box-shadow: 0 3px 10px rgba(0,0,0,.3); }
button:active, .btn:active { transform: scale(.975); }
button.big { width: 100%; padding: 16px; font-size: 16.5px; margin-top: 12px; border-radius: 16px; }
button.ok, .btn.ok { background: linear-gradient(135deg, #1f9e6f, #2fbf88); color: #04140d; }
button.bad, .btn.bad { background: linear-gradient(135deg, #c94a44, #e0625b); color: #fff; }
button.orange, .btn.orange { background: linear-gradient(135deg, #b98a34, #dcb968); color: #241a05; box-shadow: 0 6px 18px rgba(203,161,75,.3); }
button.ghost, .btn.ghost { background: var(--elev); color: var(--text); font-weight: 700; box-shadow: none; border: 1px solid var(--line2); }
button.sm, .btn.sm { padding: 8px 13px; font-size: 13px; border-radius: 10px; box-shadow: none; }
button:disabled { opacity: .5; cursor: default; box-shadow: none; }

/* ===== البلاطات ===== */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 11px; }
.tile { background: var(--card); border: 1px solid var(--line2); border-radius: var(--radius); padding: 17px 12px; text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; box-shadow: var(--sh1); }
.tile b { display: block; font-size: 24px; color: var(--teal2); line-height: 1.15; margin-bottom: 4px; font-weight: 800; }
.tile.warn b { color: var(--gold2); } .tile.bad b { color: var(--bad); } .tile.ok b { color: var(--ok); }

/* ===== الجداول ===== */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
th { color: var(--teal2); font-weight: 700; font-size: 12px; background: rgba(47,158,143,.08); }
tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; border-radius: var(--radius-sm); }
.tablewrap th, .tablewrap td { white-space: nowrap; }
.tablewrap td:nth-child(2) { white-space: normal; min-width: 150px; }

/* ===== الشارات ===== */
.pill { display: inline-block; padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--elev); color: var(--text); white-space: nowrap; }
.pill.ok { background: rgba(51,185,138,.18); color: #6ee7b0; } .pill.bad { background: rgba(224,98,91,.18); color: #ffa7a2; }
.pill.warn { background: var(--gold-soft); color: var(--gold2); } .pill.info { background: rgba(87,166,230,.18); color: #9dccf5; }
.list .item { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.list .item:last-child { border-bottom: 0; }
a.item:active { background: var(--elev); border-radius: 10px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--elev); flex-shrink: 0; border: 2px solid var(--line2); }

/* ===== الكاميرا ===== */
.cam { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3/4; max-height: 58vh; box-shadow: var(--sh2); border: 1px solid var(--line2); }
.cam video, .cam img, .cam canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam .frame { position: absolute; inset: 12% 18%; border: 3px dashed rgba(255,255,255,.6); border-radius: 50% / 40%; pointer-events: none; }
.cam .hint { position: absolute; bottom: 10px; right: 10px; left: 10px; text-align: center; color: #fff; background: rgba(0,0,0,.55); padding: 8px; border-radius: 12px; font-size: 13px; }

/* ===== الحالة والتنبيهات ===== */
.status { padding: 12px 14px; border-radius: 13px; margin: 9px 0; font-size: 14px; display: flex; gap: 8px; align-items: center; font-weight: 600; border: 1px solid transparent; }
.status.ok { background: rgba(51,185,138,.14); color: #7cf0bb; border-color: rgba(51,185,138,.3); }
.status.bad { background: rgba(224,98,91,.14); color: #ffb0ab; border-color: rgba(224,98,91,.3); }
.status.info { background: rgba(87,166,230,.12); color: #a9d3f7; border-color: rgba(87,166,230,.28); }
.status.warn { background: var(--gold-soft); color: var(--gold2); border-color: rgba(203,161,75,.3); }
#toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); background: #06110d; color: #fff; padding: 13px 22px; border-radius: 14px; border: 1px solid var(--line2);
  max-width: 92vw; z-index: 40; font-size: 15px; box-shadow: var(--sh2); text-align: center; font-weight: 600; animation: fade .2s ease; }
#toast.bad { background: linear-gradient(135deg, #7a2521, #b3423b); border-color: transparent; } #toast.ok { background: linear-gradient(135deg, #12503a, #1f9e6f); border-color: transparent; }

/* ===== الدخول ===== */
.login { max-width: 410px; margin: 34px auto; text-align: center; padding: 30px 24px; border-radius: 24px; background: var(--card); box-shadow: var(--sh2); border: 1px solid var(--line2); }
.login img { width: 108px; border-radius: 26px; margin-bottom: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.login h1 { margin-bottom: 2px; color: var(--teal2); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 11px; }
.photo-grid .card { padding: 8px; }
.photo-grid img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; }
.search { margin-bottom: 10px; }
.alert-item { border-right: 4px solid var(--gold); padding-right: 12px !important; }
.alert-item.seen { border-color: var(--line2); opacity: .6; }

/* ===== الواجهة البطولية (مثل بطاقة «هل تعلم») ===== */
.hero { background: linear-gradient(135deg, #1c6157 0%, #248275 60%, #2f9e8f 100%); color: #fff; border-radius: var(--radius); padding: 20px; margin-bottom: 15px; box-shadow: var(--sh2); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; top: -40%; left: -8%; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.12), transparent 65%); }
.hero .muted { color: #d5efe9; }
.hero b.time { font-size: 25px; display: block; font-weight: 800; }

.switch { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.switch:last-child { border-bottom: 0; }
.switch span { flex: 1; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button, .chips a { border-radius: 20px; padding: 8px 15px; font-size: 13px; }
.emptystate { text-align: center; color: var(--muted); padding: 26px 10px; }
.emptystate .ic { font-size: 42px; display: block; margin-bottom: 8px; opacity: .8; }

@media (hover: hover) {
  .card:hover { box-shadow: var(--sh2); }
  button:hover, .btn:hover { filter: brightness(1.08); }
  nav#nav a:hover { color: var(--teal2); }
  .launch a:hover { transform: translateY(-2px); border-color: var(--teal); box-shadow: var(--sh2); }
  .drawer-list a:hover { background: var(--elev); }
  .iconbtn:hover { background: var(--teal); color: #04140d; }
  a.item:hover { background: var(--elev); border-radius: 10px; }
}
@media (min-width: 700px) { nav#nav a .lbl, nav#nav .navmore .lbl { font-size: 12px; } main { padding: 22px; } .launch { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }
@media print { header, nav, #drawer, #backdrop, button, .noprint, #toast { display: none !important; } body { background: #fff; color: #111; padding: 0; background-image: none; } .card { box-shadow: none; border: 1px solid #ddd; animation: none; } main { animation: none; } }

/* كشف الصرفيات — طباعة على فورمة الشركة (A4) */
.print-root { background: #9aa1ad; padding: 12px 0; }
.a4 { width: 210mm; min-height: 297mm; margin: 0 auto 12px; background: #fff url("/letterhead.jpg") no-repeat center top; background-size: 210mm 297mm; position: relative; box-shadow: 0 6px 24px rgba(0,0,0,.25); color: #111; }
.a4-body { position: absolute; top: 42mm; bottom: 22mm; right: 14mm; left: 14mm; font-size: 11.5px; }
.ptitle { font-size: 17px; font-weight: 700; color: #232d3f; text-align: center; margin: 0 0 8px; border-bottom: 2px solid #d98a15; padding-bottom: 4px; }
table.meta { width: 100%; border-collapse: collapse; margin-bottom: 8px; font-size: 11px; }
table.meta td { border: 1px solid #cfd4dc; padding: 4px 6px; }
table.rep { width: 100%; border-collapse: collapse; margin-bottom: 8px; font-size: 11px; }
table.rep th, table.rep td { border: 1px solid #9aa1ad; padding: 3px 5px; text-align: right; white-space: normal; background: #fff; }
table.rep th { background: #eef1f6; color: #232d3f; }
table.rep tr.tot td { font-weight: 700; background: #fdf0d5; }
table.rep.grand td { font-size: 12px; font-weight: 700; }
.sigs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.sig { border: 1px solid #cfd4dc; border-radius: 6px; padding: 6px; min-height: 52px; text-align: center; font-size: 10.5px; }
.sig-role { font-weight: 700; color: #232d3f; } .sig-name { margin-top: 3px; } .sig-date { color: #6b7484; font-size: 9.5px; }
.paid { margin-top: 10px; text-align: center; font-weight: 700; color: #14653a; border: 2px dashed #1a9c5b; padding: 6px; border-radius: 8px; }
.rgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.rgrid figure { margin: 0; border: 1px solid #cfd4dc; border-radius: 6px; padding: 4px; text-align: center; page-break-inside: avoid; }
.rgrid img { width: 100%; max-height: 100mm; object-fit: contain; }
.rgrid figcaption { font-size: 10px; color: #333; margin-top: 3px; }
@media print {
  @page { size: A4; margin: 0; }
  .print-root { background: none; padding: 0; }
  .a4 { box-shadow: none; margin: 0; page-break-after: always; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .a4:last-child { page-break-after: auto; }
  main { padding: 0; max-width: none; } body { padding: 0; }
}

/* ===== توحيد لون الأيقونات + فواصل الجداول (v25) ===== */
.launch a .ic, .drawer-list a .ic, nav#nav a .ic, nav#nav .navmore .ic, .emptystate .ic { color: transparent; text-shadow: 0 0 0 var(--teal2); filter: none; }
nav#nav a.active .ic, .drawer-list a.active .ic { text-shadow: 0 0 0 var(--gold2); }
#logoutLink .ic { text-shadow: 0 0 0 var(--bad) !important; }
.card table { border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,.10); }
.card table th, .card table td { border: 1px solid rgba(255,255,255,.10); vertical-align: middle; }
.card table th { background: rgba(47,158,143,.13); color: var(--teal2); font-weight: 700; white-space: nowrap; }
.card table tr:nth-child(even) td { background: rgba(255,255,255,.025); }

/* ===== منع تجاوز جداول البطاقات لعرض الشاشة (v26) ===== */
.card table { table-layout: fixed; width: 100%; word-break: break-word; }
.card table th { white-space: normal; }
.tablewrap table { table-layout: auto; word-break: normal; }
.tablewrap th, .tablewrap td { white-space: nowrap; }
main, .card { max-width: 100%; overflow-x: hidden; }

/* ===== أيقونات SVG خطّية بلون واحد (v27) ===== */
.ic svg { width: 1em; height: 1em; display: block; }
.launch a .ic, .drawer-list a .ic, nav#nav a .ic, nav#nav .navmore .ic { color: var(--teal2); text-shadow: none; }
nav#nav a.active .ic, .drawer-list a.active .ic { color: var(--gold2); text-shadow: none; }
#logoutLink .ic { color: var(--bad) !important; text-shadow: none !important; }
.launch a .ic { font-size: 30px; }

/* ===== v28: مسافات البطاقات، فلاتر التقارير، بحث القوائم ===== */
.tiles { margin-bottom: 14px; }
a.tile { text-decoration: none; display: block; cursor: pointer; }
a.tile:active { transform: scale(.98); }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filters .f { flex: 1 1 150px; min-width: 150px; display: flex; flex-direction: column; }
.filters .f label { margin-bottom: 6px; }
.filters .f input, .filters .f button { width: 100%; height: 46px; box-sizing: border-box; margin: 0; }
.filters .f input[type="date"], .filters .f input[type="month"] { min-width: 150px; font-size: 14px; }
input.selsearch { width: 100%; box-sizing: border-box; margin: 4px 0 4px; padding: 9px 12px; font-size: 13px; border-radius: 10px; }
details.card > summary { cursor: pointer; font-weight: 600; }
.sig-name.muted { color: #999; }

/* ===== v30: تبويبات كأزرار، فلاتر التقارير في صف واحد، ثلاث بطاقات ===== */
.chips a, .chips a.sm { text-decoration: none; background: var(--elev); color: var(--text); border: 1px solid var(--line2); font-weight: 700; display: inline-block; }
.chips a.orange { background: linear-gradient(135deg, #b98a34, #dcb968); color: #241a05; border-color: transparent; }
.chips a.ok { background: linear-gradient(135deg, #1f9e6f, #2fbf88); color: #04140d; border-color: transparent; }
.filters { flex-wrap: nowrap; }
.filters .f { flex: 1 1 0; min-width: 0; }
.filters .f input, .filters .f button { height: 44px; padding: 0 8px; font-size: 13px; }
.filters .f input[type="date"], .filters .f input[type="month"] { min-width: 0; }
.tiles.three { grid-template-columns: repeat(3, 1fr); }
.tiles.three .tile { padding: 14px 6px; font-size: 12px; }
.filters .f:first-child { flex: 1.45 1 0; }
.filters .f input[type="date"] { font-size: 12.5px; padding: 0 4px; }
.filters .f label { white-space: nowrap; font-size: 12.5px; }
.filters .f:nth-child(2) { flex: 1.25 1 0; }
.filters .f:last-child { flex: .8 1 0; }
.filters .f input[type="month"] { font-size: 12.5px; padding: 0 4px; }
.filters .f button { white-space: nowrap; padding: 0 4px; font-size: 13px; }
/* ===== v37: نافذة منبثقة (كشف جديد) ===== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: flex-start; justify-content: center; padding: 14px; overflow: auto; z-index: 60; }
.modal .box { background: var(--card); border: 1px solid var(--line2); border-radius: var(--radius); padding: 16px; width: 100%; max-width: 520px; margin: 10px auto 40px; box-shadow: var(--sh1); }
.modal select[size] { height: auto; max-height: 190px; }

/* ===== v38: اختيار أنواع صرف متعددة ===== */
.kinds { display: grid; grid-template-columns: 1fr; gap: 6px; }
.kinds .kind { border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; }
.kinds .kind .switch { margin: 0; }
.kinds .kx { padding: 4px 0 8px; border-top: 1px dashed var(--line); margin-top: 6px; }
label.btn input[type=file] { display: none; }
.kinds .kind .switch { border-bottom: 0; padding: 6px 0; }

/* 0.18.0 شريط بصمة اليوم وسجل الأيام */
.todaybar { display: flex; align-items: center; gap: 12px; margin: 12px 0; padding: 12px 14px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(47,158,143,.22), rgba(47,158,143,.07)); border: 1px solid var(--line2); color: var(--text); text-decoration: none; }
.todaybar .ic { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 12px; background: var(--teal-soft); color: var(--teal2); }
.todaybar.none { background: var(--gold-soft); border-color: rgba(203,161,75,.35); }
.todaybar.none .ic { background: rgba(203,161,75,.2); color: var(--gold2); }
.tb-times { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.tb-times b { color: var(--text); font-size: 17px; }
.weeklog .wk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wk-times { display: flex; gap: 12px; font-size: 13px; color: var(--muted); }
.wk-times b { color: var(--text); }

/* 0.18.0 بطاقات بيانات الموظف بدل الجدول */
.kvgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 720px) { .kvgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kv { min-width: 0; padding: 9px 11px; border-radius: var(--radius-sm); background: var(--card2); border: 1px solid var(--line); }
.kv span { display: block; margin-bottom: 3px; font-size: 11.5px; color: var(--muted); }
.kv b { display: block; font-size: 14px; font-weight: 600; color: var(--text); word-break: break-word; }
.kv.wide { grid-column: 1 / -1; }

/* 0.18.0 بطاقتا نوع الأجر */
.paycards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
button.paycard { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--line); color: var(--text); font-family: inherit; box-shadow: none; cursor: pointer; }
button.paycard b { font-size: 20px; color: var(--teal2); }
button.paycard span { font-size: 12.5px; color: var(--muted); }
button.paycard.active { background: var(--teal-soft); border-color: var(--teal2); }

/* 0.18.2 أقسام مطويّة تُفتح بضغطة زر */
details.fold { margin: 8px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card2); }
details.fold > summary { list-style: none; cursor: pointer; padding: 12px 14px; font-weight: 700; color: var(--teal2); display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "▾"; margin-inline-start: auto; color: var(--muted); transition: transform .2s; }
details.fold[open] > summary::after { transform: rotate(180deg); }
details.fold > .kvgrid { padding: 0 10px 10px; }

/* 0.19.0 الإطار يخضرّ عند استقرار الوجه + نافذة التأكيد */
.cam .frame { transition: border-color .15s; }
.cam .frame.ok { border-color: #3ddc84; border-style: solid; }
.askov { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 16px; }
.askbox { background: var(--card2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; width: 100%; max-width: 420px; box-shadow: var(--sh2); }
.askbox h2 { margin: 0 0 8px; }
.askbox p { margin: 0 0 14px; line-height: 1.9; }
.askbox .row { gap: 8px; }

/* 0.22.0 تنسيق الحاسوب: عرض الصفحات محدود، وصفحة الدخول بطاقة صغيرة في الوسط، وحقول التاريخ بعرض مناسب */
main { max-width: 1120px; }
.login.card { max-width: 420px; width: 100%; margin: 48px auto; }
@media (min-width: 700px) {
  input[type=date], input[type=month], input[type=time] { max-width: 260px; }
  .filters .f input[type=date], .filters .f input[type=month] { max-width: none; }
}
.pl-lead { font-size: 13px; color: var(--text); margin-top: 2px; }
.pl-counts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.readview .rc-img { max-width: 100%; max-height: 520px; display: block; margin: 8px auto; border: 1px solid #ccc; border-radius: 6px; }
@media print { .readview .rc-block { page-break-inside: avoid; } }

/* 0.23.0 تقرير عمل الإداريين — على غرار التقرير المعتمد */
.ar-root { overflow-x: auto; }
.a4.ar .a4-body { top: 40mm; bottom: 24mm; font-size: 12px; }
.ar-tag { width: max-content; margin: 0 auto 6px; background: #1f2a44; color: #fff; padding: 4px 28px; border-radius: 6px; font-weight: 700; font-size: 12px; }
.ar-title { text-align: center; font-size: 19px; font-weight: 800; color: #1f2a44; }
.ar-title::after { content: ""; display: block; width: 120px; height: 3px; background: #e08a1e; margin: 6px auto 10px; }
.ar-meta { background: #fbf3e6; border-right: 4px solid #e08a1e; border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; }
.ar-meta div { display: flex; gap: 18px; padding: 2px 0; }
.ar-meta span { color: #555; min-width: 48px; font-weight: 700; }
.ar-person { margin-bottom: 8px; }
.ar-head { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #ccc; padding-bottom: 3px; margin-bottom: 5px; }
.ar-head b { font-size: 15px; color: #1f2a44; }
.ar-badge { border: 1px solid #e08a1e; color: #c46f0c; border-radius: 5px; padding: 0 8px; font-size: 11px; font-weight: 700; }
.ar-item { display: flex; align-items: center; gap: 8px; border: 1px solid #cfd3da; border-right: 4px solid #1f2a44; border-radius: 6px; padding: 5px 8px; margin: 4px 0; background: rgba(255,255,255,.88); color: #111; }
.ar-num { flex: none; width: 20px; height: 20px; border-radius: 50%; background: #1f2a44; color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.ar-foot { position: absolute; bottom: 0; left: 0; right: 0; color: #111; }
.ar-date { text-align: center; font-weight: 700; margin-bottom: 18px; }
.ar-sigs { display: flex; justify-content: space-around; }
.ar-sigs div { border-top: 1px dashed #888; padding-top: 6px; min-width: 40%; text-align: center; font-weight: 700; }


/* ===== 0.28.0: كشف الرواتب — تمرير أفقي على الشاشة، وطباعة عرضية داخل الإطار ===== */
.card.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card.tablewrap table { table-layout: auto; width: max-content; min-width: 100%; }
.a4.land { width: 297mm; min-height: 210mm; background-size: 297mm auto; background-position: center top; }
.a4.land .a4-body { top: 48mm; bottom: 12mm; right: 10mm; left: 10mm; font-size: 10px; }
.a4.land table.rep { width: 100%; table-layout: fixed; word-break: break-word; }
.a4.land table.rep th, .a4.land table.rep td { padding: 2px 3px; font-size: 9.5px; }
@media print { .a4.land { page: land; } @page land { size: A4 landscape; margin: 0; } }

/* ===== 0.28.0: محاولات التزييف — صورتان متجاورتان وشريط تفاصيل واضح ===== */
.fraud-bar { display: flex; flex-wrap: wrap; gap: 6px 14px; background: #1f2a44; color: #fff; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 700; }
.fraud-detail { margin: 6px 0; padding: 6px 10px; border-right: 4px solid #d98a15; background: rgba(217,138,21,.12); font-size: 13px; }
.fraud-pics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.fraud-pics figure { margin: 0; text-align: center; }
.fraud-pics img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; border: 2px solid rgba(255,255,255,.15); }
.fraud-pics figcaption { font-size: 12px; margin-top: 4px; font-weight: 700; }
.fraud-nopic { width: 100%; aspect-ratio: 3/4; display: grid; place-items: center; border-radius: 10px; border: 2px dashed rgba(255,255,255,.2); font-size: 12px; opacity: .7; }
.fraud-decided { padding: 8px 10px; border-radius: 8px; font-weight: 700; text-align: center; }
.fraud-decided.ok { background: rgba(47,158,143,.2); color: var(--ok); } .fraud-decided.bad { background: rgba(220,60,60,.18); color: var(--bad); }

/* ===== 0.29.0 ===== */
.ot-comp { display: inline-block; padding: 2px 8px; border-radius: 6px; background: rgba(47,158,143,.2); color: var(--ok); font-weight: 700; }
#ratebar input { padding: 6px; }
.tablewrap h3 { font-size: 15px; }
