:root{--bg:#f4f6f8;--card:#fff;--ink:#1d2733;--muted:#5d6b78;--line:#8a98a6;--accent:#18384f;--ok:#1e7a3c;--bad:#b3261e;--wait:#8a6d00}
*{box-sizing:border-box}
body{margin:0;font-family:Tahoma,Arial,sans-serif;background:var(--bg);color:var(--ink);direction:rtl;text-align:right}
header{background:var(--accent);color:#fff;padding:10px 16px;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px}
header h1{font-size:18px;margin:0}
main{max-width:1100px;margin:0 auto;padding:12px 16px}
.card{background:var(--card);border:1px solid var(--line);border-radius:8px;padding:12px 14px;margin:10px 0}
h2{font-size:16px;margin:0 0 8px}
label{display:inline-flex;flex-direction:column;gap:3px;margin:4px 0 4px 10px;font-size:13px}
input,select,textarea{font:inherit;padding:6px 8px;border:1px solid var(--line);border-radius:6px;min-width:140px;text-align:right}
button{font:inherit;padding:7px 14px;border:0;border-radius:6px;background:var(--accent);color:#fff;cursor:pointer;margin:4px 0 4px 6px}
button.secondary{background:#e6ebf0;color:var(--ink)}
button.danger{background:var(--bad)}
button:disabled{opacity:.5;cursor:default}
table{border-collapse:collapse;width:100%;font-size:13px}
th,td{border-bottom:1px solid var(--line);padding:6px;text-align:right;vertical-align:top}
th{background:#eef2f5}
.muted{color:var(--muted);font-size:12px}
.num{font-variant-numeric:tabular-nums;direction:ltr;unicode-bidi:embed}
.GREEN{color:var(--ok);font-weight:bold}.RED,.INVALID{color:var(--bad);font-weight:bold}.PENDING{color:var(--wait);font-weight:bold}
.banner{max-width:1100px;margin:8px auto;padding:10px 14px;border-radius:8px;background:#fff4d6;border:1px solid #e8cf7a}
.banner.err{background:#fde8e6;border-color:#e3a19b}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:8px}
.kpi{border:1px solid var(--line);border-radius:6px;padding:8px}
.kpi b{display:block;font-size:17px}
tr.dead td{color:var(--muted);text-decoration:line-through}
@media (max-width:600px){label{display:flex;margin-left:0}input{width:100%}}
.kpi.status-good{background:#e6f4ea;border-color:#1e7a3c;color:#1e7a3c}
.kpi.status-alert{background:#fde8e6;border-color:#b3261e;color:#b3261e}
.kpi.status-none{color:var(--muted)}
.kpi.status-good b,.kpi.status-alert b{font-size:18px}
.badge{margin-top:4px;padding:3px 6px;border-radius:5px;font-size:12px;font-weight:bold;text-decoration:none;display:inline-block}
tr.dead td .badge{text-decoration:none}
.badge .muted{font-weight:normal}
.badge-void{background:#fde8e6;color:#b3261e;border:1px solid #e3a19b}
.badge-edit{background:#fff4d6;color:#7a5a00;border:1px solid #e8cf7a}
.badge-pending{background:#e8eefc;color:#1d3f8a;border:1px solid #9fb5e6}
.badge-rejected{background:#eef2f5;color:#5d6b78;border:1px solid #d6dde4}
.named-lines{margin:10px 0}.named-lines h3{font-size:14px;margin:6px 0}
.named-lines input{min-width:110px}

/* قرار المالك: وضوح أكبر لمراعاة النظر — خط أكبر وحدود أوضح للجداول والخانات */
body{font-size:17px;line-height:1.6}
header h1{font-size:21px}
h2{font-size:19px}
h3{font-size:17px}
label{font-size:16px;font-weight:bold;color:#1d2733}
input,select,textarea{font-size:18px;padding:9px 11px;border:2px solid #5d6b78;border-radius:6px;background:#fff;color:#111;min-width:160px}
input:focus,select:focus,textarea:focus{outline:3px solid #f0b400;outline-offset:1px;border-color:#18384f}
input::placeholder{color:#6b7885}
button{font-size:17px;padding:9px 16px;font-weight:bold}
table{font-size:16px;border:2px solid #5d6b78}
th,td{border:1px solid #8a98a6;padding:8px 10px}
th{background:#dfe6ec;color:#111;font-weight:bold}
tr:nth-child(even) td{background:#f7f9fb}
tr.dead td{background:#f1f1f1}
.card{border:2px solid #b7c2cc}
.kpi{border:2px solid #8a98a6;font-size:16px}
.kpi b{font-size:20px}
.muted{font-size:14px;color:#46525e}
.named-lines input{min-width:130px}
.badge{font-size:14px}
@media (max-width:600px){input{min-width:0}}
.named-lines h3{font-size:18px}
tr.visa-row td,tr.visa-row th{background:#eef5fb}
tr.bank-row td,tr.bank-row th{background:#f3f0fa}
.recon-box{margin:8px 0;padding:12px;font-size:18px}
details summary{font-weight:bold;font-size:17px;cursor:pointer;margin:6px 0}
button.checkin{background:#1e7a3c;font-size:19px;padding:12px 22px}
ul.att{margin:6px 0;padding-inline-start:20px;font-size:17px}
.att-absent{color:#b3261e;font-weight:bold}.att-waiting{color:#5d6b78}
.submit-row{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:8px}
.late-box{flex:1;min-width:260px;font-size:17px}

/* الجوال: الجداول تُمرَّر داخل إطارها، والأزرار والخانات بعرض الشاشة */
.tw{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
.tw table{min-width:100%}
.attach-up{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px}
label[hidden]{display:none}
@media (max-width:700px){
  body{font-size:16px}
  main{padding:8px}
  .card{padding:10px;margin:8px 0}
  header h1{font-size:18px}
  h2{font-size:17px}
  th,td{padding:6px 7px;font-size:15px;white-space:nowrap}
  td .badge{white-space:normal}
  label{display:flex;width:100%;margin:4px 0}
  input,select,textarea{width:100%;min-width:0;font-size:17px}
  button{width:100%;margin:5px 0;padding:11px}
  .tw button{width:auto;padding:7px 10px}
  .grid{grid-template-columns:1fr 1fr}
  .kpi b{font-size:18px}
  .submit-row{flex-direction:column;align-items:stretch}
  .late-box{min-width:0}
  .pending-days button{width:auto;display:inline-block;margin:4px}
  #who{font-size:14px}
  #who button{width:auto}
}
@media (max-width:700px){
  table.rev{table-layout:fixed;width:100%}
  table.rev th,table.rev td{white-space:normal;font-size:14px;padding:6px 4px;word-break:break-word}
  table.rev th:first-child,table.rev td:first-child{width:40%}
  table.rev td:not(:first-child),table.rev th:not(:first-child){text-align:center}
  td:first-child,th:first-child{white-space:normal;min-width:90px}
}
.acc-row{border-top:1px solid var(--line);padding-top:8px;margin-top:8px}
.totp-box{border:2px solid #18384f;border-radius:8px;padding:12px;margin-top:10px;background:#f7f9fb}
img.qr{display:block;margin:8px auto;max-width:260px;width:100%;image-rendering:pixelated;background:#fff}
.pr-emp{margin:14px 0;page-break-inside:avoid}
.pr-emp .sign{margin-top:18px}
@media print{
  body.print-report header, body.print-report #banner, body.print-report main > *:not(#payroll), body.print-report .no-print{display:none !important}
  body.print-report #payroll{border:0;margin:0;padding:0}
  body.print-report .tw{overflow:visible}
  body.print-report th, body.print-report td{white-space:normal;font-size:12px}
  .pr-emp{page-break-after:always}
}
