/* Innovita ERpro mobile — refine-claude Light tokens (D-26). Phone first: 360–430px. */
:root{
  --navy:#16306f; --navy-2:#1c398e; --blue:#2960dc; --blue-h:#2253c4; --sky:#1e88e5; --orange:#f08a24;
  --ink:#16213a; --ink-2:#475467; --ink-3:#5b6779;           /* ink-3 darkened from #7a8699 for AA on white */
  --bg:#f3f6fa; --surface:#ffffff; --surface-2:#f9fbfd;
  --line:#e4e9f1; --line-2:#eef2f7;
  --tint-blue:#eef3fe; --tint-sky:#e8f3fd; --tint-green:#e9f7ef; --tint-amber:#fff4e5; --tint-red:#fdecec;
  --green:#127a46; --amber:#8a4f06; --red:#b42318;
  --r-sm:10px; --r-md:12px; --r-lg:16px;
  --sh-1:0 1px 2px rgba(16,24,40,.04);
  --sh-2:0 1px 2px rgba(16,24,40,.04),0 6px 16px -6px rgba(22,48,111,.10);
  --sh-3:0 1px 2px rgba(16,24,40,.05),0 18px 40px -16px rgba(22,48,111,.18);
  --font:"Inter","IBM Plex Sans Arabic",system-ui,sans-serif;
  --focus:0 0 0 3px #fff,0 0 0 5px var(--blue);
  --tabs-h:64px; --top-h:58px; --maxw:480px;
}
html[dir=rtl]{--font:"IBM Plex Sans Arabic","Inter",system-ui,sans-serif}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);font-size:15px;line-height:1.55;overflow-x:hidden;
  padding-bottom:calc(var(--tabs-h) + 24px + env(safe-area-inset-bottom))}
body.is-sub{padding-bottom:24px}
body.is-sub.has-actbar{padding-bottom:calc(var(--actbar-h,calc(76px + env(safe-area-inset-bottom))) + 20px)}
body.sheet-open{overflow:hidden}
h1,h2,h3,p{margin:0}
a{color:var(--blue)}
button,input,select,textarea{font:inherit;color:inherit}
.num,bdi.num{font-family:"Inter",sans-serif;font-variant-numeric:tabular-nums;letter-spacing:0}
.sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;margin:-1px}
.grow{flex:1 1 auto;min-width:0}
.muted{color:var(--ink-3)} .small{font-size:13px}
.neg{color:var(--red)} .pos{color:var(--green)} .ok{color:var(--green)}
.pad{padding:12px 16px}
svg.i{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
html[dir=ltr] svg.i.flip{transform:scaleX(-1)}

/* focus: always visible for keyboard users */
:focus-visible{outline:none;box-shadow:var(--focus);border-radius:var(--r-sm)}
.in:focus-visible,.in:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px rgba(41,96,220,.28)}
main:focus{outline:none;box-shadow:none}

.skip{position:fixed;top:-60px;inset-inline-start:8px;z-index:60;background:var(--navy);color:#fff;border:0;border-radius:8px;padding:12px 16px;min-height:48px}
.skip:focus{top:8px}

.app{max-width:var(--maxw);margin:0 auto}

/* ---------- header ---------- */
.top{position:sticky;top:0;z-index:30;background:rgba(255,255,255,.96);backdrop-filter:saturate(1.4) blur(8px);border-bottom:1px solid var(--line);
  padding-top:env(safe-area-inset-top)}
.top-in{max-width:var(--maxw);margin:0 auto;display:flex;align-items:center;gap:8px;min-height:var(--top-h);padding:4px 12px}
.logo{display:flex;align-items:center;min-height:48px;padding:0 2px;border-radius:8px}
.logo img{display:block;height:26px;width:auto}
.top-title{font-size:17px;font-weight:700;color:var(--navy);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1 1 auto}
.sp{flex:1 1 auto}
.top-in.is-sub .sp{flex:0 0 0}
.icon-btn{min-width:48px;min-height:48px;display:inline-grid;place-items:center;border:0;background:transparent;border-radius:12px;color:var(--navy);cursor:pointer;text-decoration:none;flex:none}
.icon-btn:hover{background:var(--tint-blue)}
.icon-btn.danger{color:var(--red)} .icon-btn.danger:hover{background:var(--tint-red)}
.lang{font-weight:700;font-size:14px;border:1px solid var(--line);min-width:48px}
.net{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:48px;min-width:48px;padding:0 12px;border-radius:999px;border:1px solid var(--line);background:var(--surface);font-size:13px;font-weight:600;cursor:pointer;flex:none;
  position:relative}

.net .dot{width:9px;height:9px;border-radius:50%;background:var(--green)}
.net.on{color:var(--green)}
.net.off{color:var(--amber);background:var(--tint-amber);border-color:#f5d7ad}
.net.off .dot{background:var(--orange)}
@media(max-width:400px){.top-in.is-sub .net-l{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)} .top-in.is-sub .net{padding:0 14px}}

.offline-b{display:flex;gap:10px;align-items:center;margin:10px 12px 0;padding:12px 14px;background:var(--tint-amber);color:var(--amber);border:1px solid #f5d7ad;border-radius:var(--r-md);font-size:13.5px}
.offline-b b{display:block;color:#6e3d03}
.offline-b .q{white-space:nowrap;font-weight:700;color:#6e3d03;min-height:48px;display:inline-flex;align-items:center}

main{display:block;padding:14px 14px 8px}
main>*+*{margin-top:14px}

/* ---------- cards ---------- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--sh-2)}
.card-h{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:12px 16px;border-bottom:1px solid var(--line)}
.card-h.flat{padding:0;border:0}
.card-h h2,.fh{font-size:15px;font-weight:700;color:var(--ink)}
.card-f{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-top:1px solid var(--line);font-weight:700}
.link{display:inline-flex;align-items:center;gap:2px;min-height:48px;font-weight:600;text-decoration:none}
.link svg.i{width:18px;height:18px}
.chip-ic{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:var(--tint-blue);color:var(--blue);flex:none}
.chip-ic.sm{width:34px;height:34px;border-radius:10px} .chip-ic.sm svg.i{width:18px;height:18px}
.sec-h{font-size:14px;font-weight:700;color:var(--ink-2);margin:4px 2px 8px}
.sec-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.cnt{display:inline-block;min-width:22px;padding:0 6px;border-radius:999px;background:var(--line-2);color:var(--ink-2);font-size:12px;text-align:center}
.lead{color:var(--ink-2);font-size:14px}
.stack{display:grid;gap:10px}
.hello h2{font-size:20px;color:var(--navy)}
.hello p{font-size:13.5px}

/* KPI */
.kpis{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.kpi{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto auto;column-gap:10px;padding:14px;text-decoration:none;color:inherit;min-width:0}
.kpi:first-child{grid-column:1/-1}
.kpi .chip-ic{grid-row:1/3;width:36px;height:36px}
.kpi-l{font-size:13px;color:var(--ink-2);font-weight:500;align-self:center}
.kpi-v{grid-column:1/-1;font-size:20px;font-weight:700;margin-top:8px;min-width:0;overflow-wrap:anywhere}
.kpi:first-child .kpi-v{grid-column:2;margin-top:0;font-size:22px}
.kpi-s{grid-column:1/-1;font-size:12.5px;color:var(--ink-3)}
.kpi:first-child .kpi-s{grid-column:2}
.amt{white-space:nowrap;font-weight:inherit}
.amt small{display:inline;font-size:.78em;color:var(--ink-3);font-weight:500}

.list{list-style:none;margin:0;padding:0}
.row{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--line-2);min-height:56px}
.list .row:last-child{border-bottom:0}
.grow small{display:block;color:var(--ink-3);font-size:12.5px}
.row .amt{font-weight:700}

.alert{display:flex;align-items:center;gap:12px;padding:14px 16px;text-decoration:none;color:var(--ink);background:var(--tint-amber);border-color:#f5d7ad;box-shadow:none}
.alert>svg.i:first-child{color:var(--orange);width:26px;height:26px}
.alert small{display:block;color:#6e3d03;font-size:12.5px}

/* tiles */
.tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:96px;padding:12px 6px;text-align:center;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--r-lg);box-shadow:var(--sh-2);color:var(--ink);text-decoration:none;font-size:13px;font-weight:600;line-height:1.3}
.tile:active{transform:scale(.98)}
.tile-i{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;background:var(--tint-blue);color:var(--blue)}
.act{display:flex;align-items:center;gap:12px;padding:14px 16px;min-height:72px;text-decoration:none;color:var(--ink);width:100%;text-align:start;cursor:pointer}
.act b{display:block} .act small{color:var(--ink-3)}
.act>svg.i:last-child{color:var(--ink-3)}

/* ---------- forms ---------- */
.form{padding:14px 14px 4px}
.form>.fld,.form>.sw-row,.form>.subbox,.form>.g2,.form>.g3,.form>.note,.form>.hint,.form>.radios,.form>.chips2,.form>.alloc,.form>.lbl{margin-bottom:12px}
.fld{min-width:0}
.fld.card{padding:14px}
.lbl{display:flex;align-items:center;justify-content:space-between;gap:6px;min-height:28px;margin-bottom:4px}
.lbl label,.lbl-t{font-size:13.5px;font-weight:600;color:var(--ink-2)}
.opt{font-weight:400;color:var(--ink-3);font-size:12px}
.in{display:block;width:100%;min-height:48px;padding:10px 12px;border:1px solid #d3dbe7;border-radius:var(--r-sm);background:var(--surface);font-size:16px;color:var(--ink);min-width:0}
.in::placeholder{color:#6b7789}
.in.big{font-size:22px;font-weight:700;min-height:56px}
.in.num{text-align:start}
html[dir=rtl] .in.num{text-align:right}
select.in{appearance:none;-webkit-appearance:none;padding-inline-end:34px;background-image:linear-gradient(45deg,transparent 50%,var(--ink-2) 50%),linear-gradient(135deg,var(--ink-2) 50%,transparent 50%);
  background-size:6px 6px;background-repeat:no-repeat;background-position:left 16px center,left 10px center;text-overflow:ellipsis}
html[dir=ltr] select.in{background-position:right 10px center,right 16px center}
textarea.in{resize:vertical;min-height:64px}
.in.ro{background:var(--surface-2);border-style:dashed;display:flex;align-items:center;gap:.3em;font-weight:700;color:var(--navy)}
.in.need{border-color:var(--orange);background:#fffaf3}
.in[aria-invalid=true]{border-color:var(--red);box-shadow:0 0 0 3px rgba(180,35,24,.15)}
.pick{display:flex;align-items:center;gap:8px;text-align:start;cursor:pointer}
.pick .pick-l{flex:1;min-width:0}
.pick .pick-v{display:block;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pick.ph .pick-v{color:#6b7789;font-weight:400}
.pick small{display:block;font-size:12.5px;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pick svg.i{color:var(--ink-3)}
.g2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.g3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.g2>.fld,.g3>.fld{margin:0}
.hint{font-size:12.5px;color:var(--ink-3)}
.hint:empty{display:none}
.amt-row{display:flex;align-items:flex-end;gap:8px;margin-bottom:12px}
.amt-row .btn{margin-bottom:4px}
.subbox{padding:12px;margin:-4px 0 12px;border-radius:var(--r-md);background:var(--surface-2);border:1px solid var(--line-2)}
.subbox>.fld+.fld{margin-top:10px}
.subbox.g2>.fld+.fld{margin-top:0}

/* help ⓘ: small visual, 44px hit area */
.help{position:relative;width:24px;height:24px;flex:none;border-radius:50%;border:1.5px solid var(--blue);background:var(--surface);color:var(--blue);font:700 13px/1 "Inter",sans-serif;
  display:inline-grid;place-items:center;cursor:pointer;padding:0;margin:0 4px;vertical-align:middle}
.help::after{content:"";position:absolute;inset:-12px}   /* 24px visual, 48px hit area */
.help:hover{background:var(--tint-blue)}

/* switch rows */
.sw-row{display:flex;align-items:center;gap:6px}
.sw{flex:1;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:56px;padding:8px 12px;border:1px solid var(--line);border-radius:var(--r-md);background:var(--surface);cursor:pointer;text-align:start}
.sw-t b{display:block;font-weight:600;font-size:14.5px}
.sw-t small{display:block;font-size:12.5px;color:var(--ink-3)}
.sw-k{position:relative;width:46px;height:28px;border-radius:999px;background:#c4ccd8;flex:none;transition:background .15s}
.sw-k::after{content:"";position:absolute;top:3px;inset-inline-start:3px;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:inset-inline-start .15s}
.sw[aria-checked=true]{border-color:#bcd0f7;background:var(--tint-blue)}
.sw[aria-checked=true] .sw-k{background:var(--blue)}
.sw[aria-checked=true] .sw-k::after{inset-inline-start:21px}
.form .sw-row{margin-bottom:10px}

/* segmented + chips */
.seg{display:flex;gap:4px;padding:4px;border-radius:var(--r-md);background:var(--line-2);border:1px solid var(--line)}
.seg button{flex:1 1 0;min-height:48px;border:0;border-radius:9px;background:transparent;font-weight:600;font-size:14px;color:var(--ink-2);cursor:pointer;padding:6px 8px;line-height:1.25}
.seg button.on{background:var(--surface);color:var(--navy);box-shadow:var(--sh-1),0 0 0 1px var(--line)}
.seg.wrap{flex-wrap:wrap}
.seg.wrap button{flex:1 1 30%}
.chips2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.ctile{min-height:52px;padding:8px 10px;border:1px solid var(--line);border-radius:var(--r-md);background:var(--surface);font-weight:600;font-size:14px;cursor:pointer;color:var(--ink);line-height:1.3}
.ctile.on{border-color:var(--blue);background:var(--tint-blue);color:var(--navy);box-shadow:inset 0 0 0 1px var(--blue)}
.radios{display:grid;gap:8px}
.rcard{display:flex;align-items:center;gap:10px;width:100%;min-height:56px;padding:10px 14px;border:1px solid var(--line);border-radius:var(--r-md);background:var(--surface);cursor:pointer;text-align:start}
.rcard b{display:block}
.rcard.on{border-color:var(--blue);background:var(--tint-blue);box-shadow:inset 0 0 0 1px var(--blue)}
.rcard .amt{font-weight:700}
.rcard>svg.i{color:var(--blue)}

/* line items */
.line{padding:12px}
.line+.line{margin-top:10px}
.line-h{display:flex;align-items:flex-end;gap:8px;margin-bottom:10px}
.line-h .fld{margin:0}
.ln{width:26px;height:26px;border-radius:8px;background:var(--navy);color:#fff;display:grid;place-items:center;font:700 12px "Inter",sans-serif;flex:none;margin-bottom:11px}
.line-f{display:flex;justify-content:space-between;align-items:center;margin-top:10px;padding-top:10px;border-top:1px dashed var(--line);font-size:14px;color:var(--ink-2)}
.line-f b{color:var(--ink);font-size:16px}
.line .g3 .in{padding-inline:8px}

/* totals */
.totals{padding:6px 16px}
.tr{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 0;color:var(--ink-2);font-size:14px}
.tr b{color:var(--ink);font-weight:600}
.tr.grand{border-top:1px solid var(--line);margin-top:4px;padding-top:12px;font-size:17px;color:var(--ink);font-weight:700}
.tr.grand b{font-weight:800;color:var(--navy)}

/* notes */
.note{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border-radius:var(--r-md);background:var(--surface-2);border:1px solid var(--line);font-size:13.5px;color:var(--ink-2)}
.note>svg.i{margin-top:1px;width:20px;height:20px}
.note.info{background:var(--tint-sky);border-color:#cfe5fb;color:#174a86}
.note.warn{background:var(--tint-amber);border-color:#f5d7ad;color:#6e3d03}
.note.warn>svg.i{color:var(--orange)}
.note.ok{background:var(--tint-green);border-color:#c7ead6;color:var(--green)}
.note.muted{background:transparent;border-style:dashed}

/* sticky action bar (forms) */
.actbar{position:fixed;inset-inline:0;bottom:0;z-index:25;max-width:var(--maxw);margin:0 auto;display:flex;align-items:center;gap:10px;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--line);box-shadow:0 -8px 24px -12px rgba(22,48,111,.18);flex-wrap:wrap;row-gap:8px}
.ab-tot{flex:1 1 auto;min-width:auto;max-width:100%}
.ab-tot>small{display:block;font-size:12px;color:var(--ink-3)}
.ab-tot b{display:block;font-size:17px;font-weight:800;color:var(--navy);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ab-btns{display:flex;gap:8px;flex:1 0 auto;justify-content:flex-end}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:48px;padding:10px 16px;border-radius:12px;border:1px solid transparent;font-weight:700;font-size:15px;cursor:pointer;text-decoration:none;line-height:1.2}
.btn svg.i{width:20px;height:20px}
.btn.pri{background:var(--blue);color:#fff;box-shadow:0 1px 2px rgba(16,24,40,.08),inset 0 -1px 0 rgba(0,0,0,.12)}
.btn.pri:hover{background:var(--blue-h)}
.btn.sec{background:var(--surface);color:var(--navy);border-color:#cfd8e6}
.btn.sec:hover{background:var(--tint-blue)}
.btn.ghost{background:transparent;color:var(--blue);border:1.5px dashed #b9c9ee}
.btn.danger-b{background:var(--red);color:#fff}
.btn.sm{min-height:48px;padding:8px 12px;font-size:14px}
.btn.wide{width:100%}
main>.btn.ghost{margin-top:10px}
@media(max-width:374px){.ab-btns .btn{padding:10px 12px;font-size:14px}}

/* steps */
.steps{display:flex;gap:6px;list-style:none;margin:0;padding:0}
.steps li{flex:1;display:flex;align-items:center;gap:6px;padding:8px;border-radius:var(--r-md);background:var(--surface);border:1px solid var(--line);font-size:12.5px;font-weight:600;color:var(--ink-3);min-width:0;line-height:1.25}
.steps li.on{border-color:var(--blue);color:var(--navy);background:var(--tint-blue)}
.steps li.done{color:var(--green)}
.steps .sn{width:22px;height:22px;flex:none;border-radius:50%;display:grid;place-items:center;background:var(--line-2);font:700 12px "Inter",sans-serif}
.steps .sn svg.i{width:14px;height:14px}
.steps li.on .sn{background:var(--blue);color:#fff}
.steps li.done .sn{background:var(--tint-green)}
.summary{padding:12px 14px}
.summary .row{padding:0;border:0;min-height:0;align-items:center}
.summary small{color:var(--ink-3);font-size:12px}
.summary b{display:block}

/* photo */
.sr-file{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden}
.photo{display:flex;align-items:center;gap:12px;min-height:72px;padding:12px;border:1.5px dashed #b9c9ee;border-radius:var(--r-md);background:var(--surface-2);color:var(--blue);cursor:pointer;font-weight:600}
.photo svg.i{width:28px;height:28px}
.photo img{width:56px;height:56px;object-fit:cover;border-radius:8px;flex:none}
.photo.has{border-style:solid;color:var(--ink)}
.photo span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sr-file:focus-visible+.photo{box-shadow:var(--focus)}

/* allocation */
.alloc{list-style:none;margin:0 0 12px;padding:0;display:grid;gap:8px}
.alloc li{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--line);border-radius:var(--r-md);min-height:56px}
.alloc li.on{border-color:#bcd0f7;background:var(--tint-blue)}
.alloc b{font-size:13.5px}
.al-v{text-align:end;font-weight:700}
.al-v>small{display:block;font-size:11.5px;font-weight:600;color:var(--ink-3)}
.al-v>small.ok{color:var(--green)}
.al-in{width:118px;flex:none}

/* swap */
.swap-row{display:flex;justify-content:center;margin:-2px 0 10px}

/* materials */
.mats{list-style:none;margin:8px 0 12px;padding:0;display:grid;gap:8px}
.mats li{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--line);border-radius:var(--r-md)}
.mats small{display:block;font-size:12px;color:var(--ink-3)}
.mats small.neg{color:var(--red)}
.mat-in{width:120px;flex:none}
.mat-in label{display:block;font-size:12px;color:var(--ink-2);font-weight:600;margin-bottom:2px}
.mat-in small{text-align:center}

/* delivery notes */
.dn{padding:14px}
.dn+.dn{margin-top:10px}
.dn-h{display:flex;align-items:center;justify-content:space-between;gap:8px}
.dn-items{margin:8px 0 12px;padding-inline-start:18px;font-size:14px}

/* tags */
.tag{display:inline-flex;align-items:center;gap:4px;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap;background:#eef1f5;color:var(--ink-2)}
.t-on{background:var(--tint-blue);color:var(--navy)}
.t-for{background:var(--tint-green);color:var(--green)}
.t-warn{background:var(--tint-amber);color:var(--amber)}
.st-queued{background:var(--tint-amber);color:var(--amber)}
.st-draft{background:#eef1f5;color:var(--ink-2)}
.st-submitted{background:var(--tint-green);color:var(--green)}

/* statement */
.stmt{overflow:hidden}
.st-prev,.st-close{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:12px 16px;flex-wrap:wrap}
.st-prev{background:var(--surface-2);border-bottom:1px solid var(--line);font-weight:600}
.st-close{background:var(--navy);color:#fff;font-weight:700;font-size:16px}
.st-close .amt small{color:#c9d4ee}
.st-close .tag{background:#fff;color:var(--navy)}
.mvs{list-style:none;margin:0;padding:0}
.mv{display:flex;gap:10px;padding:12px 16px;border-bottom:1px solid var(--line-2)}
.mv-t{font-size:14px}
.mv-t bdi{font-size:12px}
.mv-s{font-size:12.5px;color:var(--ink-3)}
.mv-r{text-align:end;flex:none;display:flex;flex-direction:column;align-items:flex-end}
.mv-r small{font-size:11.5px;color:var(--ink-3)}
.mv-r b{font-size:15px}
.mv-r .dr{color:var(--navy)} .mv-r .cr{color:var(--green)}
.mv-items{margin:6px 0 0;padding-inline-start:16px;font-size:12.5px;color:var(--ink-2)}
.st-tot{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--line);border-top:1px solid var(--line)}
.st-tot>div{background:var(--surface);padding:10px 16px;font-weight:700}
.st-tot>div>small{display:block;font-size:12px;color:var(--ink-3);font-weight:500}

/* drafts */
.docs{list-style:none;margin:0;padding:0}
.doc{display:flex;align-items:center;border-bottom:1px solid var(--line-2)}
.doc:last-child{border-bottom:0}
.doc-a{flex:1;min-width:0;display:flex;align-items:center;gap:10px;padding:12px 14px;color:inherit;text-decoration:none;min-height:64px}
.doc-a b{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.doc-r{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:none;font-weight:700;font-size:14px}

/* done */
.done{padding:22px 16px;text-align:center}
.done-ic{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;margin:0 auto 12px}
.done-ic svg.i{width:34px;height:34px}
.done h2{font-size:18px;color:var(--navy);margin-bottom:4px}
.big-amt{font-size:24px;font-weight:800;margin-top:6px}
.kv{margin:16px 0 0;text-align:start;border-top:1px solid var(--line)}
.kv>div{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--line-2)}
.kv dt{color:var(--ink-3);font-size:13px}
.kv dd{margin:0;font-weight:600;font-size:13.5px;text-align:end;overflow-wrap:anywhere;min-width:0}

/* permissions */
.perm{padding:12px 14px;margin:0;border:1px solid var(--line);min-width:0}
fieldset.perm+fieldset.perm{margin-top:10px}
.perm legend{float:inline-start;width:100%;font-weight:700;font-size:15px;margin-bottom:8px;padding:0;display:flex;align-items:center;justify-content:space-between}
.pchips{clear:both;display:flex;flex-wrap:wrap;gap:6px}
.pchip{display:inline-flex;align-items:center;gap:4px;min-height:48px;min-width:48px;justify-content:center;padding:6px 12px;border-radius:999px;border:1px solid #cfd8e6;background:var(--surface);color:var(--ink-2);font-weight:600;font-size:14px;cursor:pointer}
.pchip svg.i{width:16px;height:16px}
.pchip.on{background:var(--blue);border-color:var(--blue);color:#fff}
.live{min-height:22px;font-size:13px;color:var(--green);font-weight:600;display:flex;align-items:center;gap:6px}
.live svg.i{width:18px;height:18px}
.me{display:flex;align-items:center;gap:12px;padding:14px 16px}
.me b{display:block;font-size:16px}
.about{font-size:12.5px;color:var(--ink-3);text-align:center;padding:8px 12px}

.empty{text-align:center;padding:28px 16px;color:var(--ink-2);display:grid;gap:12px;justify-items:center}
.empty svg.i{width:36px;height:36px;color:var(--ink-3)}

/* ---------- bottom tabs ---------- */
.tabs{position:fixed;inset-inline:0;bottom:0;z-index:20;max-width:var(--maxw);margin:0 auto;display:grid;grid-template-columns:repeat(5,1fr);
  background:var(--surface);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom);box-shadow:0 -6px 20px -12px rgba(22,48,111,.16)}
body.is-sub .tabs{display:none}
.tab{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:var(--tabs-h);color:var(--ink-3);text-decoration:none;font-size:12px;font-weight:600}
.tab.on{color:var(--blue)}
.tab.on::before{content:"";position:absolute;top:0;width:28px;height:3px;border-radius:0 0 3px 3px;background:var(--blue)}
.tab-new .tab-i{width:44px;height:44px;border-radius:14px;background:var(--blue);color:#fff;display:grid;place-items:center;box-shadow:0 6px 14px -6px rgba(41,96,220,.7);margin-top:-14px}
.tab-new.on::before{display:none}
.badge{position:absolute;top:6px;inset-inline-start:calc(50% + 6px);min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--orange);color:#1b1200;font:700 11px/18px "Inter",sans-serif;text-align:center}

/* ---------- sheet ---------- */
.sheet-back{position:fixed;inset:0;background:rgba(14,24,48,.45);z-index:40}
.sheet{position:fixed;inset-inline:0;bottom:0;z-index:41;max-width:var(--maxw);margin:0 auto;max-height:82vh;display:flex;flex-direction:column;background:var(--surface);border-radius:20px 20px 0 0;
  box-shadow:var(--sh-3);padding-bottom:env(safe-area-inset-bottom);animation:up .18s ease-out}
@keyframes up{from{transform:translateY(24px);opacity:.6}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){.sheet{animation:none}}
.sheet-h{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 8px 8px 16px;border-bottom:1px solid var(--line)}
html[dir=rtl] .sheet-h{padding:8px 16px 8px 8px}
.sheet-h h2{font-size:16px;font-weight:700;color:var(--navy);display:flex;align-items:center;gap:8px}
.sheet-h h2 svg.i{color:var(--blue)}
.sheet-b{padding:14px 16px 18px;overflow:auto}
.sheet-b>p{margin-bottom:16px;font-size:15px;line-height:1.7}
.help-n{color:var(--ink)}
.pk-search{position:relative;margin-bottom:8px}
.pk-search svg.i{position:absolute;top:13px;inset-inline-start:12px;color:var(--ink-3)}
.pk-search .in{padding-inline-start:42px}
.pk-list{list-style:none;margin:0;padding:0}
.pk-it{display:flex;align-items:center;gap:10px;width:100%;min-height:56px;padding:10px 8px;border:0;border-bottom:1px solid var(--line-2);background:transparent;text-align:start;cursor:pointer}
.pk-it:hover{background:var(--surface-2)}
.pk-it.on{background:var(--tint-blue)}
.pk-it b{display:block;font-weight:600}
.pk-it>svg.i{color:var(--blue)}

/* ---------- toast ---------- */
.toast{position:fixed;inset-inline:12px;bottom:calc(var(--tabs-h) + 14px + env(safe-area-inset-bottom));z-index:50;max-width:calc(var(--maxw) - 24px);margin:0 auto;padding:12px 16px;border-radius:12px;
  background:var(--ink);color:#fff;font-weight:600;font-size:14px;box-shadow:var(--sh-3);opacity:0;transform:translateY(8px);pointer-events:none;transition:opacity .2s,transform .2s}
body.is-sub .toast{bottom:calc(92px + env(safe-area-inset-bottom))}
.toast.show{opacity:1;transform:none}
.toast.err{background:var(--red)}
.toast.ok{background:var(--green)}
.toast.warn{background:#6e3d03}

@media(min-width:481px){body{background:#e9eef5} .app{background:var(--bg);min-height:100vh;box-shadow:0 0 0 1px var(--line)}}
@media print{.top,.tabs,.actbar,.toast,#offline,.btn{display:none!important} body{background:#fff;padding:0} .card{box-shadow:none}}

/* ---------- delta: ids, permissions per screen, schedule, frequent, notes ---------- */
.id{white-space:nowrap;unicode-bidi:isolate}
.warn-t{display:block;color:#6e3d03!important;font-weight:600}
.gap{height:10px}
.sub-h{font-size:14px;font-weight:700;color:var(--ink-2);margin:12px 0 6px}
.sched{list-style:none;margin:0 0 12px;padding:0;display:grid;gap:6px}
.sched li{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 12px;border:1px solid var(--line);border-radius:var(--r-md);background:var(--surface-2);font-size:14px}
.sched .amt{font-weight:700}
.freq{display:inline-flex;align-items:center;gap:2px;margin-inline-start:6px;padding:1px 8px;border-radius:999px;background:var(--tint-amber);color:var(--amber);font-size:11.5px;font-weight:700;vertical-align:middle}
.freq svg.i{width:12px;height:12px;fill:currentColor;stroke:none}
.prow{padding:10px 0;border-top:1px solid var(--line-2)}
.prow-t{display:block;font-weight:600;font-size:14px;margin-bottom:6px}
.modrow{padding-bottom:10px}
.pchip.mod{border-style:dashed}
.pchip.mod.on{border-style:solid}
.pchip.mixed{background:var(--tint-blue);color:var(--navy);border-color:#9db6ee}
.dn-items li{margin-bottom:6px}
.dn-items li small{display:block;color:var(--ink-3);font-size:12.5px;font-weight:500}
.line .g2+.g2{margin-top:8px}
.line .in.num{font-size:16px;padding-inline:10px}
.in.ro{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:0}.alloc li{flex-wrap:wrap}
.alloc .id{font-size:12.5px}
.al-in{width:104px}
/* ---------- company branding: letterhead header (company start, Innovita ERpro end, equal width) ---------- */
.top-in.brand{gap:8px}
.top-in.brand .sp{flex:0 0 0}
.co-logo,.pw-logo{flex:1 1 0;min-width:0;max-width:150px;display:flex;align-items:center;min-height:48px;border-radius:8px}
.pw-logo{justify-content:flex-end}
.co-logo img,.pw-logo img{display:block;width:100%;height:auto;max-height:44px;object-fit:contain}
.co-logo img{object-position:right center} html[dir=ltr] .co-logo img{object-position:left center}
.pw-logo img{object-position:left center} html[dir=ltr] .pw-logo img{object-position:right center}
.top-in.brand .ls{display:none}
.top-in.brand .net-l{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
@media(max-width:360px){
  .top-in.brand .lw{display:none}
  .top-in.brand .ls{display:block;width:auto;height:40px;max-height:40px}
  .co-logo,.pw-logo{flex:0 0 auto;min-width:48px;justify-content:center}
  .top-in.brand .sp{flex:1 1 auto}
}
.brand-card{padding:16px;text-align:center}
.bc-logo{display:block;width:min(240px,80%);height:auto;max-height:72px;object-fit:contain;margin:0 auto}
.co-name{margin-top:8px;font-weight:700;color:var(--navy);font-size:14.5px;line-height:1.4}
.brand-card .hello{margin-top:12px;padding-top:12px;border-top:1px solid var(--line-2)}
.co-prev{display:grid;place-items:center;min-height:96px;padding:12px;margin-bottom:10px;border:1px solid var(--line);border-radius:var(--r-md);
  background:repeating-conic-gradient(#f1f4f8 0 25%,#fff 0 50%) 0 0/16px 16px}
.co-prev img{max-width:100%;max-height:96px;object-fit:contain}
/* splash: company logo above, «يعمل بواسطة Innovita ERpro» below */
.splash{position:fixed;inset:0;z-index:100;background:var(--bg);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;transition:opacity .35s}
.splash img{width:min(260px,70vw);height:auto;max-height:110px;object-fit:contain}
.splash p{margin:0;font-size:12.5px;color:var(--ink-3)}
.splash.out{opacity:0;pointer-events:none}
@media (prefers-reduced-motion:reduce){.splash{transition:none}}
/* ---------- production on Home ---------- */
.tile-mfg{border-color:#bcd0f7;background:var(--tint-blue)}
.tile-mfg .tile-i{background:var(--blue);color:#fff}
.row-a{color:inherit;text-decoration:none}
.row-a>svg.i:last-child{color:var(--ink-3)}
.card-f .link+.link{margin-inline-start:12px}
/* Owner 2026-11-21: no company logo in the top bar — the company logo lives in the home greeting card only */
.top .co-logo { display: none !important; }
/* Owner 2026-11-21: top bar back to the first design — Innovita ERpro logo large and clear at the start (right in Arabic), EN + status at the other end */
.top-in.brand .pw-logo { order: -1; flex: 0 0 auto; max-width: none; width: auto; justify-content: flex-start; }
.top-in.brand .pw-logo img { width: auto; height: 34px; max-height: 34px; max-width: 200px; object-position: center; }
.top-in.brand .pw-logo .lw { display: block !important; }
.top-in.brand .pw-logo .ls { display: none !important; }
.top-in.brand .sp { flex: 1 1 auto; }
@media (max-width: 360px) { .top-in.brand .pw-logo img { height: 30px; max-width: 170px; } }
/* Arabic vertical company logo in the welcome card */
.bc-logo { width: auto !important; max-width: 70%; height: 120px !important; max-height: 120px !important; }
/* Owner 2026-11-21: company logo only in the intro (splash) when opening the app; the welcome card keeps the company name only */
.brand-card .bc-logo { display: none !important; }
.splash img { width: auto !important; height: min(220px, 40vh) !important; max-height: 220px !important; }
/* Intro → home: the big Arabic logo shows on the opening screen, then shrinks away;
   on the home page the company stays as a small round emblem beside its name. */
.splash img { transition: transform .45s ease, opacity .45s ease; }
.splash.out img { transform: scale(.22) translateY(-160%); opacity: 0; }
.brand-card .co-name { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 0; }
.brand-card .co-name::before { content: ""; flex: 0 0 auto; width: 44px; height: 44px;
  background: url("assets/company-emblem.png") center / contain no-repeat; }
@media (prefers-reduced-motion: reduce) { .splash img { transition: none; } }

/* ---------- LIVE (ERPNext) ---------- */
body.lg .tabs{display:none}
body.lg{padding-bottom:24px}
.login-c{display:grid;gap:16px;justify-items:center;padding-top:8px}
.lg-co{width:min(220px,60vw);height:auto;max-height:120px;object-fit:contain}
.login-c .lg{width:100%}
.login-c .pw{font-size:12.5px;color:var(--ink-3)}
.linkbtn{background:none;border:0;color:var(--blue);font:inherit;font-weight:600;min-height:48px;padding:0 8px;cursor:pointer;text-decoration:underline}
.upd{display:flex;align-items:center;justify-content:center;gap:6px;font-size:12.5px;color:var(--ink-3);margin:6px 0}
.upd svg.i{width:16px;height:16px}
.skel{min-height:120px;display:grid;place-items:center}
.per .seg{margin-bottom:8px}
.per .hint{text-align:center}
.amt-b{display:flex;flex-direction:column;align-items:flex-end;gap:2px;flex:none;font-weight:700}
.mv.sub{padding-top:4px;padding-bottom:4px;background:var(--surface-2)}
.mv.sub .mv-s{padding-inline-start:12px}
.ctile small{display:block;font-size:11.5px;font-weight:500;color:var(--ink-3);margin-top:2px}
.tb{padding:4px 0}
.tb-g>summary,.tb-r{display:flex;align-items:center;gap:8px;min-height:48px;padding:6px 16px;padding-inline-start:calc(16px + var(--ind,0) * 14px);border-bottom:1px solid var(--line-2);cursor:pointer;list-style:none}
.tb-g>summary::-webkit-details-marker{display:none}
.tb-g>summary{font-weight:700}
.tb-g>summary::before{content:"▸";color:var(--ink-3);flex:none}
html[dir=rtl] .tb-g>summary::before{content:"◂"}
.tb-g[open]>summary::before{content:"▾"}
.tb-r{cursor:default}
.tb-n{flex:none;font-weight:700;white-space:nowrap}
.tb-n small{font-weight:500;color:var(--ink-3)}
.st-error{background:var(--tint-red);color:var(--red)}
@media print{.noprint,.per .seg{display:none!important}}
/* live: inline create (duplicate guard chips), net balance, disabled party, footnotes */
.dup{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:4px 0 12px}
.dup .hint{flex-basis:100%;margin:0}
.chip{min-height:48px;padding:0 16px;border-radius:24px;border:1px solid var(--line,#d9dee8);background:var(--tint-blue);color:var(--blue);font:inherit;font-weight:600;cursor:pointer}
.chip:focus-visible{outline:3px solid var(--blue);outline-offset:2px}
.add-new{margin-top:6px}
.tag.t-dis{background:#eceef2;color:#5a6272}
.fine{font-size:12.5px;line-height:1.6;color:var(--muted,#5a6272);margin:8px 4px 0}
.net-card .tr{display:flex;justify-content:space-between;gap:12px;align-items:center}
.net-card .fine{margin:6px 0 0}

/* owner 2026-11-22: brand header identical in AR and EN — logo always on the left */
.top-in.brand { direction: ltr; }

/* owner 2026-11-22: «صافي الحساب» card had no inner padding (text touched the border); breakdown on two lines */
.net-card{padding:14px 16px}
.net-card .bk{display:block}
.net-card .bk-sep{display:none}

/* جرد مخزن */
.sc-h{display:flex;flex-direction:column;gap:2px;margin-bottom:4px}
.sc-h small{color:var(--muted,#5a6272);font-size:12px}
.sc-out{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;margin:8px 0}
.sc-out .sc-reason{flex-basis:100%;margin:4px 0 0}
.sc-v{flex-basis:100%}
.sc-zero{margin-top:4px}
.sc-sum{position:sticky;bottom:calc(var(--actbar-h,76px) + 8px);z-index:4;box-shadow:0 -4px 16px rgba(22,48,111,.08)}
.sc-sum{display:flex;gap:6px;padding:8px 10px}
.sc-sum .tr,.sc-sum .tr.grand{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:0;margin:0;border:0;font-size:11.5px;line-height:1.3}
.sc-sum .tr b{font-size:14px} .sc-sum .tr .amt small{font-size:10px}

/* «اسأل» — المساعد الذكي (D-67) */
.ask{display:flex;flex-direction:column;gap:10px}
.ask-hello{margin:2px 2px 0}
.ask-intro{display:flex;gap:12px;align-items:flex-start;color:var(--ink-2)} .ask-intro svg.i{flex:none;color:var(--blue);margin-top:2px}
.ask-sug .chips{display:flex;flex-wrap:wrap;gap:8px}
.ask-sug .chip{min-height:44px;padding:6px 14px;font-size:13.5px;text-align:start;line-height:1.35;border-radius:18px}
.ask-log{display:flex;flex-direction:column;gap:8px}
.ask-b{max-width:92%;padding:10px 14px;border-radius:16px;font-size:14.5px;line-height:1.6;overflow-wrap:anywhere}
.ask-me{align-self:flex-end;background:var(--blue);color:#fff;border-end-end-radius:6px;white-space:pre-wrap}
.ask-bot{align-self:flex-start;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-end-start-radius:6px;box-shadow:var(--sh-1,none)}
.ask-bot p{margin:0 0 6px} .ask-bot p:last-child{margin-bottom:0}
.ask-x{background:var(--tint-amber);border-color:#f5d7ad;color:#6e3d03}
.ask-l{margin:4px 0 6px;padding-inline-start:20px}
.ask-l li{margin:2px 0}
.ask-tw{overflow-x:auto;margin:6px 0}
.ask-t{border-collapse:collapse;font-size:13px;min-width:100%}
.ask-t th,.ask-t td{border:1px solid var(--line);padding:5px 8px;text-align:start;white-space:nowrap}
.ask-t th{background:var(--surface-2);font-weight:700}
.ask-link{color:var(--blue);font-weight:600;text-decoration:underline;text-underline-offset:2px}
.ask-wait{color:var(--ink-3);display:flex;align-items:center;gap:8px}
.dots{display:inline-flex;gap:4px} .dots i{width:7px;height:7px;border-radius:50%;background:var(--blue);opacity:.35;animation:askdot 1.2s infinite}
.dots i:nth-child(2){animation-delay:.2s} .dots i:nth-child(3){animation-delay:.4s}
@keyframes askdot{0%,80%,100%{opacity:.25}40%{opacity:1}}
@media (prefers-reduced-motion:reduce){.dots i{animation:none;opacity:.7}}
.ask-form{padding:10px;position:sticky;bottom:calc(var(--tabs-h) + 8px);z-index:5}
.ask-form textarea{resize:vertical;min-height:56px}
.ask-row{display:flex;align-items:center;gap:8px;margin-top:8px} .ask-row .hint{flex:1}
.ask-own{margin:0 2px}
/* «اسأل» — الصوت (D-67) */
.ask-rec{min-height:1.2em;margin:6px 2px 0}
.ask-mic.on{background:var(--tint-red);color:var(--red);border-color:#f3c2c2}
.ask-tts{display:inline-flex;align-items:center;gap:4px;margin-top:6px;min-height:36px;padding:4px 10px;border:1px solid var(--line);border-radius:18px;background:var(--surface-2);color:var(--ink-2);font:inherit;font-size:12.5px;cursor:pointer}
.ask-mic-i{font-size:13px}
/* «اسأل» — تحليل عميق (D-67 تكملة 4) */
.ask-deep{display:flex;align-items:center;gap:8px;margin-top:6px;flex-wrap:wrap} .ask-deep .hint{flex:1 1 160px}
.ask-deep.on .ask-deep-t{background:var(--tint-violet,#efe9fb);color:#4b2a91;border-color:#cdbdf0;font-weight:700}
.ask-deep.on .hint{color:#4b2a91}
.ask-deep-a{border-color:#cdbdf0}
.ask-badge{display:inline-block;margin-bottom:6px;padding:1px 8px;border-radius:10px;background:var(--tint-violet,#efe9fb);color:#4b2a91;font-size:12px;font-weight:700}
.ask-cost{margin-top:6px!important;font-size:12.5px}
.ask-confirm{border-color:#cdbdf0} .ask-confirm .ask-row{flex-wrap:wrap} .ask-est{font-weight:700;color:#4b2a91}
.ask-intro{flex-wrap:wrap} .ask-intro p{flex:1 1 200px;margin:0} .ask-intro .ask-own{flex-basis:100%;margin-top:4px}

/* العمل بدون اتصال: «في انتظار الإرسال» + تثبيت التطبيق */
.doc.ob{flex-wrap:wrap}
.ob-acts{display:flex;flex-wrap:wrap;gap:8px;width:100%;padding:0 12px 12px;justify-content:flex-end}
.ob-acts .btn{min-height:48px}
.ob-card{border-inline-start:4px solid var(--amber,#b26a00)}
.install .row{display:flex;gap:12px;align-items:center;margin-bottom:10px}
.install .grow small{display:block;margin-top:2px}

/* «اسأل»: small round floating button (the tab bar keeps «+» in the centre). Inline-end corner of the app column = bottom-left in
   Arabic, bottom-right in English — above the tab bar, away from «+», the bar, save bars and the offline banner (top). */
.ask-fab{position:fixed;z-index:22;bottom:calc(var(--tabs-h) + 12px + env(safe-area-inset-bottom));inset-inline-end:max(12px, calc((100vw - var(--maxw)) / 2 + 12px));
  width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:var(--surface);color:var(--blue);border:1px solid var(--line);
  box-shadow:0 6px 16px -6px rgba(22,48,111,.45);text-decoration:none}
.ask-fab svg.i{width:22px;height:22px}
.ask-fab:focus-visible{outline:3px solid var(--blue);outline-offset:2px}
body.has-fab{padding-bottom:calc(var(--tabs-h) + 76px + env(safe-area-inset-bottom))}
body.is-sub .ask-fab,body.lg .ask-fab,body.kb .ask-fab,body.sheet-open .ask-fab{display:none}
@media print{.ask-fab{display:none}}
/* the chat is its own screen now (no tab bar under it): the composer sits at the bottom edge */
body.is-sub .ask-form{bottom:calc(8px + env(safe-area-inset-bottom))}
.ask-ext-l{display:inline-block;margin-inline-start:4px;padding:0 6px;border-radius:8px;background:var(--surface-2);border:1px solid var(--line);color:var(--ink-2);font-size:11.5px;font-weight:600;text-decoration:none}
.doc-amt{font-size:18px;margin:4px 0}

/* أرصدة جهات التعامل: green = مستحق لنا, red = مستحق علينا, grey = مسدَّد */
.tag.ap-in{background:var(--tint-green);color:var(--green)} .tag.ap-out{background:var(--tint-red);color:var(--red)} .tag.ap-settled{background:#eceef2;color:#5a6272}
.ap-k .kpi.ap-in .kpi-v{color:var(--green)} .ap-k .kpi.ap-out .kpi-v{color:var(--red)}
.tag.ap-role{background:var(--surface-2,#f3f6fa);color:var(--ink-2,#3b4252);font-weight:500}
.ap-row .grow small{display:block}

/* «ما يحتاج انتباهك» + «لوحة المؤشرات» (D-75) */
.att-wrap{display:flex;flex-direction:column;gap:10px;margin:14px 0}
/* owner 2026-11-26: these cards had no inner padding, so text and badges touched or crossed the card border */
.card.att,.card.sv-total,#dash-alerts,#dash-buckets,#dash-exp,#dash-sales,#dash-wh{padding:14px 16px;overflow:hidden}
.card.att .list,#dash-buckets .list,#dash-exp .list,#dash-sales .list,#dash-wh .list{margin:8px -16px 0}
.att .att-h h3,.att-v,.att .hint{overflow-wrap:anywhere}
.att .att-h .tag{flex:0 0 auto}
.att .att-h{display:flex;align-items:center;justify-content:space-between;gap:8px}
.att h3{margin:0;font-size:15px}
.att-v{font-size:20px;font-weight:700;margin:6px 0 2px}
.att-v small{font-size:12.5px;font-weight:500;color:var(--ink-3)}
.att-a{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.att-a .btn{min-height:48px}
.att-l{margin:6px 0 0;padding-inline-start:18px} .att-l li{margin:3px 0}
.att-warn{border-inline-start:4px solid var(--amber,#b26a00)}
.ask-this svg.i{width:18px;height:18px}

/* قيمة المخزون (D-76) */
.sv-v{font-weight:700;white-space:nowrap}
.sv-cat .grow small,.sv-item .grow small,.sv-assets .grow small{display:block}
.sv-assets{opacity:.7}
/* D-106 «موافقات معلّقة» */
.appr-row .appr-why{white-space:pre-line;overflow-wrap:anywhere;font-size:13.5px}
/* D-107b «لوحة الشريك» */
.pt-sec{padding:14px;min-width:0;overflow-wrap:anywhere}.pt-sec h3{margin:0 0 6px}.pt-sec .row{padding:10px 0}
@media print{.pt-noprint,#tabs,#top,.ask-fab{display:none!important}}
/* D-107 «حماية الحسابات» */
.prot-loc,.prot-u{padding:14px;display:flex;flex-direction:column;gap:10px;min-width:0;overflow-wrap:anywhere}
.prot-loc h3{margin:0}.prot-loc .fld{display:flex;flex-direction:column;gap:4px}.prot-u .hint{margin:0}
.prot-u .row{padding:0;border:0;flex-wrap:wrap}.prot-u .row .in{flex:1 1 90px;min-width:0}
/* D-105 G-028 landed cost */
#lcv-manual .lcv-it{flex-wrap:wrap;row-gap:6px}#lcv-manual .grow{min-width:0;flex:1 1 150px}#lcv-manual .grow b,#lcv-manual .grow small{display:block;overflow-wrap:anywhere}#lcv-manual .lcv-m{width:130px;max-width:100%;margin-inline-start:auto}
#lcv-goods .sw-t b,#lcv-goods .sw-t small,#lcv-vis .sw-t b,#lcv-vis .sw-t small{overflow-wrap:anywhere}
/* D-105 G-018 taxes table */
.tx-tbl{display:flex;flex-direction:column;gap:10px;margin-top:6px}.tx-row{border:1px solid var(--line-2);border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:6px;min-width:0}
.tx-row .tx-del{align-self:flex-start}.tx-row .pick{overflow-wrap:anywhere;white-space:normal}
/* D-104 «أصول في المخازن»: long item names / big quantities and amounts wrap inside the card (360px) */
#sv-astk .row{flex-wrap:wrap;row-gap:4px}#sv-astk .grow{min-width:0;flex:1 1 170px}#sv-astk .grow b,#sv-astk .grow small{display:block;overflow-wrap:anywhere}#sv-astk .row>.amt{margin-inline-start:auto;max-width:100%;text-align:end;overflow-wrap:anywhere}#sv-astk .amt bdi{overflow-wrap:anywhere;white-space:normal}#sv-astk .tr{flex-wrap:wrap;gap:4px}#sv-astk .tr b{min-width:0;max-width:100%;overflow-wrap:anywhere;text-align:end;margin-inline-start:auto}
.tag.sv-3p{background:var(--tint-amber);color:#8a4b00}

/* كشف الحساب الشامل: نشاط الفترة لكل صفة (D-74 متابعة 2) */
.act-card .act-g{padding:6px 0 10px;border-bottom:1px solid var(--line)} .act-card .act-g:last-of-type{border-bottom:0}
.act-card .act-h{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}
.act-card .tr{display:flex;justify-content:space-between;gap:10px;padding:3px 0}
.act-card .act-l span{padding-inline-start:10px;color:var(--ink-2)}
.act-card .act-close{font-weight:700;border-top:1px dashed var(--line);margin-top:2px;padding-top:5px}
.act-card .act-net{padding-top:8px} .act-card .act-net .grand{font-size:15px}
.act-card{padding:12px 14px}

/* بطاقة الصنف (D-76 حركة وقيمة) */
.sv-boxes{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0}
.sv-box{display:flex;flex-direction:column;gap:2px;padding:10px 12px}
.sv-box small{color:var(--ink-3)} .sv-box b{font-size:15px}
.sv-mv{color:inherit;text-decoration:none;display:block}
/* owner 2026-11-26: big amounts in half-width KPI cards ran past the card edge — let the currency wrap and scale the number to the card */
.kpi{overflow:hidden}
.kpi-v .amt{white-space:normal}
.kpi-v .amt .num{white-space:nowrap}
.kpi-v{font-size:clamp(16px,5.2vw,20px)}
.kpi:first-child .kpi-v{font-size:clamp(18px,5.8vw,22px)}
.sv-box b,.att-v{overflow-wrap:anywhere}
.sv-box .amt,.att-v .amt{white-space:normal}
.sv-box .amt .num,.att-v .amt .num{white-space:nowrap}
/* owner 2026-11-26 (iPhone): date inputs kept their own iOS width and ran out of the card / over the next field */
input.in[type=date],input.in[type=month],input.in[type=time],input.in[type=datetime-local]{-webkit-appearance:none;appearance:none;width:100%;max-width:100%;min-width:0;box-sizing:border-box;text-align:start;line-height:26px}
input.in[type=date]::-webkit-date-and-time-value{text-align:start;margin:0}
.g2>*,.g3>*{min-width:0;max-width:100%}
.card.form,.card.per{overflow:hidden}
/* ======== layout audit 2026-11-26 (tools/check-layout.js: every screen × 360–430px × ar/en × light/dark, big amounts, long names) ======== */
/* the app has no dark theme: keep the phone's dark mode from painting native inputs / pickers dark on our white cards */
:root{color-scheme:light}
/* KPI amounts follow the card's own width (half cards on a 360px phone are ~130px): 8-digit amounts are never cut */
.kpi{container-type:inline-size}
@supports (font-size:1cqi){ .kpi-v{font-size:clamp(14px,10.5cqi,20px)} .kpi:first-child .kpi-v{font-size:clamp(16px,8cqi,22px)} }
/* list rows: a long name or an unbroken word wraps inside the row instead of pushing the amount out */
.row .grow{min-width:0;overflow-wrap:anywhere}
/* save bar: when the total does not fit next to the buttons (8-digit totals on 360–390px), the buttons move to a second line — the total is never cut */
.ab-tot b{text-overflow:clip}
/* picker buttons: the balance line under the chosen party wraps (it was cut with «…» in English on 360–375px) */
.pick small{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
/* inside the Android app (WebView): window.print() does nothing — the PDF / share button stays */
.in-apk [data-act=print]{display:none!important}

/* «ذاكرتي» (D-67 تكملة 7) */
.ask-mem-chip{margin-top:6px!important;font-size:12.5px;color:var(--ink-2)} .ask-mem-chip a{color:var(--blue)}
.ask-mem-card{margin-top:8px;padding:8px 10px;border:1px dashed var(--line);border-radius:12px;background:var(--surface-2)} .ask-mem-text{font-weight:600}
.ask-mem-tabs{margin:8px 0} .ask-mem-note p{margin:4px 0} .ask-mem-link{margin:6px 2px 0}
/* D-88 «اشرح هذا التقرير» + «اطلب تقريراً» */
.ask-explain{margin:0 0 10px} .ask-explain .ask-ex{color:#6d28d9;border-color:#d8ccfb;background:#f6f2ff;font-weight:700}
[data-theme="dark"] .ask-explain .ask-ex{color:#c4b5fd;border-color:rgba(139,92,246,.4);background:rgba(139,92,246,.14)}
.ask-ctx{border-inline-start:4px solid #7c3aed} .ask-ctx p{margin:0 0 6px;overflow-wrap:anywhere}
.req-form textarea{width:100%;min-height:96px;margin:8px 0} .req-form .hint.err{color:var(--red)}
.req-row{align-items:flex-start} .req-row .grow{display:flex;flex-direction:column;gap:2px;min-width:0} .req-t{overflow-wrap:anywhere}
.req-st{flex:none;font-size:12px;font-weight:700;padding:2px 9px;border-radius:99px;background:var(--surface-2);color:var(--ink-2);white-space:nowrap}
.req-st.blue{background:var(--tint-blue,#eef3fe);color:var(--blue,#2563eb)} .req-st.amber{background:var(--tint-amber,#fff4e5);color:#b45309}
.req-st.green{background:var(--tint-green);color:var(--green)} .req-st.red{background:var(--tint-red);color:var(--red)}
.ask-src{display:inline-block;font-size:11.5px;font-weight:600;padding:0 7px;margin:0 2px;border-radius:99px;background:#f3eefe;color:#6d28d9;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:1px} [data-theme="dark"] .ask-src{background:rgba(139,92,246,.18);color:#c4b5fd}
/* D-90: a balance's DIRECTION is never a colour (owner: «مستحق لنا» in green looked odd) — words say it (له / عليه, مستحق لنا / علينا).
   Colour only signals a credit-limit problem: amber ≥ 80 % of the limit, red over it. (ap-in / ap-out keep green / red as CHECK results
   — «مطابق» / «فرق» — outside the balance lists.) */
.t-for{background:var(--tint-blue);color:var(--navy)}
.ap-row .tag.ap-in,.ap-row .tag.ap-out{background:var(--tint-blue);color:var(--navy)}
.ap-k .kpi.ap-in .kpi-v,.ap-k .kpi.ap-out .kpi-v{color:var(--navy)}
.tag.cr-ok{background:var(--tint-blue);color:var(--navy)} .tag.cr-near{background:var(--tint-amber);color:#b45309} .tag.cr-over{background:var(--tint-red);color:var(--red)}
.credit-card .tr{gap:8px} .credit-card .tr>span:first-child{min-width:0;overflow-wrap:anywhere} .credit-card .tag{white-space:normal;text-align:center}
.credit-card[data-state=near] .cr-av b{color:#b45309} .credit-card[data-state=over] .cr-av b{color:var(--red)}
.credit-card{padding:12px 14px}
/* D-95 the voucher rows' «تفاصيل» (side sheet) */
.link-b { position: relative; background: none; border: 0; padding: 0 4px; color: var(--blue, #2563eb); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; min-height: 0; }
/* the 44px hit area around the small inline link (the «ⓘ» technique, tools/check-layout.js) */
.link-b::after { content: ''; position: absolute; inset: -14px -2px; }

