/* Wasett portal — shared styles (same tokens as the operator screen) */
:root{
  --navy:#12305C; --navy-2:#1B4380; --amber:#F5A623; --amber-2:#D98F12; --green:#0A8F5F;
  --blue:#1667B5; --red:#C0392B; --purple:#5B3FA0; --ink:#101828; --muted:#667085;
  --line:#E4E7EC; --bg:#F6F8FB; --card:#fff; --soft:#F9FAFB;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:"Segoe UI",Tahoma,system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--ink);
     font-size:15px;line-height:1.6;min-height:100vh;display:flex;flex-direction:column}
a{color:var(--blue)}
header.top{background:var(--navy);color:#fff;padding:0 24px;display:flex;align-items:center;gap:18px;min-height:62px;
           position:sticky;top:0;z-index:20;box-shadow:0 1px 0 rgba(255,255,255,.06)}
header.top .brand{font-size:21px;font-weight:800;letter-spacing:.2px;white-space:nowrap;text-decoration:none;color:#fff;display:inline-flex;align-items:center;gap:8px}
header.top .brand span{color:var(--amber)}
/* the handshake — the same mark as the deck cover, on every door */
.brand img.logo{height:30px;width:auto;display:inline-block;vertical-align:middle}
.topbar .brand{display:inline-flex;align-items:center;gap:8px}
header.top .role{font-size:12px;opacity:.75;margin-inline-start:-8px;white-space:nowrap}
nav.tabs{display:flex;gap:2px;flex-wrap:wrap;margin-inline-start:auto}
nav.tabs a{color:#fff;text-decoration:none;padding:10px 14px;border-radius:8px;font-size:14px;font-weight:600;opacity:.82}
nav.tabs a:hover{background:rgba(255,255,255,.08);opacity:1}
nav.tabs a.on{background:rgba(255,255,255,.14);opacity:1}
.userbox{display:flex;align-items:center;gap:10px;font-size:13px}
.bell{position:relative;background:none;border:0;color:#fff;cursor:pointer;font-size:18px;padding:6px 8px;border-radius:8px}
.bell:hover{background:rgba(255,255,255,.1)}
.bell .n{position:absolute;top:0;inset-inline-end:0;background:var(--amber);color:#12305C;border-radius:999px;font-size:10px;
         font-weight:800;padding:0 5px;line-height:16px}
main.wrap{max-width:1180px;width:100%;margin:24px auto 60px;padding:0 20px;flex:1}
footer.foot{background:#0E2647;color:#B7C3D6;font-size:12.5px;padding:18px 24px;text-align:center}
footer.foot a{color:#F5A623;text-decoration:none}
h1{font-size:24px;margin:0 0 6px}
h2{font-size:17px;margin:0 0 4px}
h3{font-size:15px;margin:0 0 6px}
.hint{color:var(--muted);font-size:13px;margin:0 0 16px}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:20px 22px;margin-bottom:16px}
.card.tight{padding:14px 16px}
.grid{display:grid;gap:14px}
.g2{grid-template-columns:repeat(2,1fr)} .g3{grid-template-columns:repeat(3,1fr)} .g4{grid-template-columns:repeat(4,1fr)}
@media(max-width:900px){.g2,.g3,.g4{grid-template-columns:1fr} nav.tabs a{padding:8px 10px;font-size:13px}}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.between{justify-content:space-between}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin:0 0 16px}
.stat{background:#fff;border:1px solid var(--line);border-radius:10px;padding:14px 16px}
.stat .k{font-size:12px;color:var(--muted);font-weight:600}
.stat .v{font-size:22px;font-weight:800;margin-top:2px;direction:ltr;text-align:end;font-variant-numeric:tabular-nums}
.stat .v small{font-size:12px;color:var(--muted);font-weight:600}
.stat.accent{border-color:#F3DFB5;background:#FDF6E7}
/* an amount the company is already behind on — the tile a lender reads first */
.stat.bad{border-color:#FDA29B;background:#FEF3F2}
.stat.bad .v{color:#B42318}
.stat.good{border-color:#BFE3D2;background:#EEF8F3}
.stat.blue{border-color:#CADDF0;background:#EAF2FB}
label{display:block;font-size:13px;font-weight:600;margin-bottom:5px;color:#344054}
input,select,textarea{width:100%;padding:9px 11px;border:1px solid #D0D5DD;border-radius:8px;font:inherit;font-size:14px;background:#fff}
textarea{min-height:80px;resize:vertical}
input:focus,select:focus,textarea:focus{outline:2px solid var(--blue);outline-offset:-1px;border-color:var(--blue)}
input[type=checkbox]{width:auto;margin-inline-end:6px}
.field{margin-bottom:12px}
/* Latin digits always: the page is lang="ar" and an Arabic font's `locl`
   feature would otherwise draw 0-9 as ٠-٩, so the same date reads
   ٠١/٠٣/٢٠٢٦ here and 01/03/2026 on the next machine. */
.num,.mono,.dt{font-feature-settings:"locl" 0;font-variant-numeric:lining-nums tabular-nums}
.dt{direction:ltr;unicode-bidi:isolate;white-space:nowrap}
.num{direction:ltr;text-align:start;font-variant-numeric:tabular-nums;white-space:nowrap;unicode-bidi:embed}
[dir=rtl] .num{text-align:left}
button,.btn{font:inherit;font-weight:700;border:0;border-radius:9px;padding:10px 20px;cursor:pointer;background:var(--navy);color:#fff;
            text-decoration:none;display:inline-block;line-height:1.4}
button:hover,.btn:hover{background:var(--navy-2)} button:disabled{opacity:.5;cursor:default}
.btn.ghost,button.ghost{background:#fff;color:var(--navy);border:1.5px solid var(--navy)}
.btn.go,button.go{background:var(--green)} .btn.go:hover,button.go:hover{background:#0b7d54}
.btn.amber,button.amber{background:var(--amber);color:#12305C} .btn.amber:hover,button.amber:hover{background:var(--amber-2)}
.btn.danger,button.danger{background:var(--red)}
.btn.sm,button.sm{padding:6px 12px;font-size:13px;border-radius:7px}
.btn.link,button.link{background:none;color:var(--blue);padding:0;border:0;font-weight:600}
.chip{display:inline-block;padding:3px 11px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap}
.ok{background:#E6F6EF;color:var(--green)} .no{background:#FDECEA;color:var(--red)}
.wait{background:#FEF4E2;color:#B5730F} .info{background:#EAF1FA;color:var(--blue)} .grey{background:#EEF1F5;color:#475467}
.violet{background:#EFEAFA;color:var(--purple)}
table{width:100%;border-collapse:collapse;font-size:13.5px}
th,td{padding:9px 10px;border-bottom:1px solid var(--line);text-align:start;vertical-align:top}
th{background:#F9FAFB;font-size:12px;color:#475467;font-weight:700}
tr.click{cursor:pointer} tr.click:hover td{background:#F5F8FC}
.tablewrap{overflow-x:auto}
.empty{color:var(--muted);text-align:center;padding:28px 10px;font-size:14px}
.flag{background:#FFFBF2;border:1px solid #F4D9A6;border-radius:8px;padding:10px 12px;font-size:13px;color:#7A5310;margin-bottom:12px}
.err{background:#FDECEA;border:1px solid #F5C6C0;color:#8A2318;border-radius:8px;padding:10px 12px;font-size:13px;margin-bottom:12px;line-height:1.7}
.proof{background:#F1FAF6;border:1px solid #A8DCC4;color:#0A6B48;border-radius:8px;padding:10px 12px;font-size:13px;margin-bottom:12px;line-height:1.7}
.note{background:#EAF2FB;border:1px solid #CADDF0;color:#1B4380;border-radius:8px;padding:10px 12px;font-size:13px;margin-bottom:12px;line-height:1.7}
.hide{display:none!important}
.spin{display:inline-block;width:14px;height:14px;border:2px solid rgba(0,0,0,.15);border-top-color:currentColor;border-radius:50%;
      animation:sp .8s linear infinite;vertical-align:-2px;margin-inline-end:6px}
@keyframes sp{to{transform:rotate(360deg)}}
/* stepper */
.steps{display:flex;gap:6px;flex-wrap:wrap;margin:6px 0 18px}
.steps .s{flex:1;min-width:110px;background:#fff;border:1px solid var(--line);border-radius:8px;padding:8px 10px;font-size:12.5px;color:var(--muted);text-align:center}
.steps .s.done{border-color:#A8DCC4;background:#F1FAF6;color:var(--green);font-weight:700}
.steps .s.now{border-color:var(--amber);background:#FDF6E7;color:#7A5310;font-weight:800}
.steps .s.bad{border-color:#F5C6C0;background:#FDECEA;color:var(--red);font-weight:700}
/* documents */
.docs{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px}
/* A checklist has sections, and the screen shows them: the group's name runs
   across the whole grid with its own count beside it, so a contractor can see
   at a glance which of the five are done. */
.docgroup{grid-column:1/-1;display:flex;justify-content:space-between;align-items:baseline;
  margin:10px 0 -4px;padding-bottom:5px;border-bottom:1px solid #E3E8F0}
.docgroup .t{font-weight:800;font-size:13px;color:var(--ink)}
.docgroup:first-child{margin-top:0}
/* The projects list, filled in place of an uploaded spreadsheet. */
.projrow{border:1px solid #E3E8F0;border-radius:10px;padding:14px;margin-bottom:12px;background:#FBFCFE}
.projrow.bad{border-color:#F0C98A;background:#FFFCF6}
.derived{display:flex;flex-wrap:wrap;gap:6px 18px;margin-top:10px;padding-top:10px;
  border-top:1px dashed #D7DEE9;font-size:12.5px;color:var(--muted)}
.derived b{color:var(--ink);font-weight:700}
.derived.bad{border-top-color:#F0C98A}
.drop{border:1.5px dashed #C6CEDA;border-radius:10px;padding:14px;background:#FBFCFE;transition:.15s;position:relative}
.drop.has{border-style:solid;border-color:var(--green);background:#F1FAF6}
.drop.req::after{content:"مطلوب";position:absolute;top:8px;inset-inline-start:10px;font-size:10.5px;font-weight:800;color:#B5730F;background:#FEF4E2;padding:1px 7px;border-radius:999px}
.drop.has.req::after{content:"مستوفٍ";color:var(--green);background:#E6F6EF}
[dir=ltr] .drop.req::after{content:"Required"} [dir=ltr] .drop.has.req::after{content:"Complete"}
.drop .t{font-weight:700;font-size:14px;margin-top:6px} .drop .d{font-size:12px;color:var(--muted);margin-top:3px;min-height:16px}
.drop ul{list-style:none;margin:8px 0 0;padding:0;font-size:12.5px}
.drop li{display:flex;justify-content:space-between;gap:8px;padding:4px 0;border-top:1px dashed #E4E7EC;align-items:center}
.drop li a{color:var(--blue);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.drop input[type=file]{display:none}
.drop .pick{margin-top:8px}
/* لوحةٌ أُجيب عنها: تبقى ظاهرة ليرى العميل ما قاله، وتفقد نبرة السؤال. */
.docwarn.answered{border-color:#BFD8C8;background:#F4FAF6}
.docwarn.answered .t{color:var(--green)}

/* سؤالٌ على صفّ مشروع: ليس خطأً في رقم بل رقمٌ يحتاج سبباً. كهرماني كلوحة
   المستندات، لأنه من جنسها — النظام يسأل والعميل يجيب والملف يمضي. */
.projrow.asked{border-color:#E7B75F;background:#FFFBF3}
/* عقد المشروع، على صفّه — see paintContract */
.pcontract{margin-top:10px;border-top:1px dashed #E4E7EC;padding-top:8px}
.pcontract .t{font-weight:700;font-size:12.5px;color:#475467;margin-bottom:2px}
.pcontract.missing .t{color:#B5730F}
.pcontract ul.pdocs{margin:4px 0 0;padding:0;list-style:none;font-size:12.5px}
.pcontract ul.pdocs li{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:3px 0;border-top:1px dashed #E4E7EC}
.projask{margin-top:10px;border-top:1px dashed #E4E7EC;padding-top:8px}
.projask.hide{display:none}
.projask ul{margin:0 0 6px;padding:0;list-style:none;font-size:12.5px;color:#8A5A0B}
/* علامة الاستفهام تأتي بعد الجملة لا قبلها — فالسؤال يُقرأ ثم يُستفهم عنه،
   وعلامةٌ في أوّل السطر تبدو رمزَ تعداد لا علامةَ سؤال. */
.projask li{padding:2px 0;line-height:1.55}
.projask li::after{content:"\061F";font-weight:800}
/* ملفٌّ لم يُقرأْ منه حرف — لا أخضرَ ولا أحمر. رمادي.
   THE GREEN CARD AND THE GREEN «Complete» BADGE WERE SHOWN OVER AN AUDITED
   FINANCIAL STATEMENT SITTING IN THE COMMERCIAL-REGISTRATION SLOT, because the
   file was an image, nothing could read it, and the verdict said pass. The
   colour is not decoration here: it is the sentence the eye reads first, and
   it was saying «checked» about a file nobody checked.
   Grey is the whole point — the same grey the risk dashboard paints an
   unmeasured appetite line, for the same reason. Green is a claim; grey is the
   absence of one. These rules come BEFORE .warned so that a slot holding both
   an unread file and a questioned one wears the louder badge. */
.drop.has.unverified{border-color:#C6CEDA;background:#FBFCFE}
.drop.has.req.unverified::after{content:"لم يُتحقَّق";color:#4B5563;background:#EEF0F3}
[dir=ltr] .drop.has.req.unverified::after{content:"Not verified"}
.drop .small.unread{color:#4B5563;background:#F3F4F6;border-radius:8px;padding:7px 9px;line-height:1.55}

/* the amber slot badge also covers a slot still owed a partner's articles */
.drop.has.req.warned::after{content:"بحاجة إلى سبب"}
[dir=ltr] .drop.has.req.warned::after{content:"Needs a reason"}
/* …AND A SLOT STILL OWED A DOCUMENT IS A DIFFERENT THING FROM ONE WHOSE FILE
   WAS QUESTIONED. «بحاجة إلى سبب» asks the client to explain what he uploaded;
   «ينقص» tells him something is not there yet. Wearing one badge for both made
   the second unreadable — see the corporate partners on the articles slot. */
.drop.has.req.owing::after{content:"ينقص";color:#8A5A0B;background:#FFF8E6}
[dir=ltr] .drop.has.req.owing::after{content:"Missing"}
.projask textarea{width:100%;font:inherit;font-size:13px;padding:8px 10px;border:1px solid #D6DBE3;border-radius:8px;background:#fff;resize:vertical}
/* المستندات الداعمة لصفّ مشروع — قائمة ملفات لا قائمة شروط */
.projask ul.pdocs{margin:6px 0 0;padding:0;list-style:none;font-size:12.5px}
.projask ul.pdocs li{display:flex;gap:8px;align-items:center;padding:3px 0;border-top:1px dashed #E4E7EC}
.projask ul.pdocs a{color:var(--blue);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.projask .said{font-size:12.5px;color:var(--muted);background:#F7F8FA;border-radius:8px;padding:8px 10px}

/* ما يطلبه النظام من كل مستند، معروضاً للعميل قبل أن يرفع. قائمةُ شروطٍ لا
   قائمةُ ملفات، فلها شكلها الخاص: لا خطّ فاصل بين البنود ولا توزيعٌ على
   الطرفين — وإلا قرأها بوصفها ملفات مرفوعة. */
.drop ul.asks{margin:8px 0 0;padding:0;font-size:12px;color:var(--muted)}
.drop ul.asks li{display:block;border-top:0;padding:2px 0 2px 0;position:relative;padding-inline-start:14px;line-height:1.55}
.drop ul.asks li::before{content:"‹";position:absolute;inset-inline-start:0;color:var(--blue);font-weight:800}
[dir=ltr] .drop ul.asks li::before{content:"›"}

/* timeline */
.tl{list-style:none;margin:0;padding:0;border-inline-start:2px solid var(--line)}
.tl li{position:relative;padding:2px 0 12px 0;padding-inline-start:16px;font-size:13px}
.tl li::before{content:"";position:absolute;inset-inline-start:-7px;top:8px;width:10px;height:10px;border-radius:50%;background:var(--blue);border:2px solid #fff}
.tl .t{color:var(--muted);font-size:11.5px;direction:ltr;display:inline-block}
/* rules */
.rules td:first-child{width:28px}
.rule-ok{color:var(--green);font-weight:800} .rule-no{color:var(--red);font-weight:800}
/* toast + modal */
#toast{position:fixed;bottom:22px;inset-inline-start:22px;z-index:99;display:flex;flex-direction:column;gap:8px}
.toast{background:#101828;color:#fff;padding:11px 16px;border-radius:10px;font-size:13.5px;box-shadow:0 8px 24px rgba(0,0,0,.2);max-width:420px}
.toast.bad{background:var(--red)} .toast.good{background:var(--green)}
.modal-bg{position:fixed;inset:0;background:rgba(16,24,40,.45);z-index:50;display:flex;align-items:center;justify-content:center;padding:20px}
.modal{background:#fff;border-radius:14px;max-width:640px;width:100%;max-height:90vh;overflow:auto;padding:22px 24px;box-shadow:0 20px 60px rgba(0,0,0,.3)}
.verdict{border-radius:12px;padding:18px 22px;margin-bottom:16px;color:#fff}
.verdict.pass{background:var(--green)} .verdict.fail{background:var(--red)} .verdict.awaiting_documents{background:var(--amber);color:#4A3000}
.verdict h2{font-size:22px;margin:0 0 4px;color:inherit} .verdict p{margin:0;opacity:.92;font-size:14px}
.kv{display:grid;grid-template-columns:auto 1fr;gap:6px 16px;font-size:13.5px}
.kv b{color:#475467;font-weight:600}
.copy{font-family:Consolas,monospace;direction:ltr;text-align:left;background:#F2F4F7;border-radius:8px;padding:8px 10px;font-size:13px;word-break:break-all}
.bar{height:8px;background:#EEF1F5;border-radius:999px;overflow:hidden}
.bar i{display:block;height:100%;background:var(--green)}
.pill-list{display:flex;gap:6px;flex-wrap:wrap}
.pill-list label{display:inline-flex;align-items:center;gap:4px;border:1px solid var(--line);border-radius:999px;padding:4px 10px;font-size:12.5px;font-weight:600;cursor:pointer;background:#fff;margin:0}
.pill-list input{margin:0}
.section-title{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:22px 0 10px}
.section-title h2{margin:0}
.muted{color:var(--muted)}
.small{font-size:12.5px}
.mono{font-family:Consolas,monospace;direction:ltr;unicode-bidi:embed}

/* A FILE THE THREE-PAGE SCREEN QUESTIONED — kept, not refused.
   Amber, never red: the upload succeeded and the client is being asked a
   question, not told to go away. See src/policy.js screenUpload. */
.docwarn{margin-top:8px;padding:10px 12px;border-radius:10px;
  background:#FFF8E6;border:1px solid #F0D089;color:#6B4B05;font-size:13px}
.docwarn .t{font-weight:700;margin-bottom:4px}
.docwarn ul{margin:0 0 8px;padding-inline-start:18px}
.docwarn textarea{width:100%;margin:4px 0 6px;font:inherit;padding:6px 8px;
  border:1px solid #E0C78A;border-radius:8px;background:#fff}
/* a slot carrying a questioned file, or still owed a document, is not
   "Complete" — see docwarn and the partner articles on the AOA slot */
