:root{--brown:#7a3b1d;--blue:#1d5a7a;--bg:#f6f1ea;--card:#fff;--line:#e5dccf;--txt:#2b2118}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Tahoma,"Noto Naskh Arabic",sans-serif;background:var(--bg);color:var(--txt);font-size:16px;padding-bottom:env(safe-area-inset-bottom)}
header{position:sticky;top:0;z-index:5;background:var(--brown);color:#fff;display:flex;align-items:center;justify-content:space-between;padding:12px 14px;padding-top:calc(12px + env(safe-area-inset-top))}
body.dolidol header{background:var(--blue)}
h1{font-size:19px;margin:0;line-height:1.25}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.hlogo{width:40px;height:40px;border-radius:9px;flex:0 0 auto;display:block;background:#fff2}
.loginlogo{display:block;width:88px;height:88px;border-radius:18px;margin:2px auto 8px}
@media(max-width:380px){.hlogo{width:34px;height:34px;border-radius:8px}h1{font-size:16px}header{padding-left:10px;padding-right:10px}.brand{gap:8px}}
header button{background:transparent;color:#fff;border:0;font-size:24px;padding:0 6px}
main{max-width:720px;margin:0 auto;padding:12px}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:12px;margin-bottom:12px}
.day{font-weight:700;margin:18px 4px 8px;color:var(--brown);font-size:17px}
body.dolidol .day{color:var(--blue)}
label{display:block;font-size:14px;margin:8px 0 3px;color:#5a4a3c}
input,select,textarea{width:100%;font:inherit;padding:10px;border:1px solid #cbbfae;border-radius:8px;background:#fff;color:var(--txt)}
textarea{min-height:64px}
.row{display:flex;gap:8px}.row>*{flex:1;min-width:0}
.line{border:1px dashed #cbbfae;border-radius:10px;padding:8px;margin:10px 0;background:#fcfaf6}
.line .head{display:flex;justify-content:space-between;align-items:center;font-size:14px;color:#7a6a5a}
button.btn{font:inherit;border:0;border-radius:10px;padding:11px 14px;background:var(--brown);color:#fff;font-weight:600}
body.dolidol button.btn{background:var(--blue)}
button.btn.ghost{background:#efe6d8;color:var(--txt)}
button.btn.red{background:#b3261e}
button.btn.full{width:100%;margin-top:10px}
.tabs{display:flex;gap:8px;margin-bottom:10px}.tabs button{flex:1}
.badge{display:inline-block;padding:2px 9px;border-radius:99px;font-size:13px;font-weight:700;color:#fff;background:#888}
.s-non_traitee{background:#6b7280}.s-fabrication{background:#d97706}.s-en_route{background:#2563eb}.s-livree{background:#16a34a}.s-probleme{background:#dc2626}
.new{background:#dc2626;color:#fff;animation:pulse 1.4s infinite}
@keyframes pulse{50%{opacity:.55}}
.sample{background:#fff3cd;color:#664d03;border:1px solid #ffe69c;border-radius:8px;padding:5px 8px;font-size:13px;margin:6px 0}
.top{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}
.name{font-weight:700;font-size:17px}
.bc{font-size:12px;color:#7a6a5a;direction:ltr;text-align:right;word-break:break-all}
.ltr{direction:ltr;unicode-bidi:embed;display:inline-block}
.info div{margin:3px 0}
.k{color:#7a6a5a;font-size:13px}
table{width:100%;border-collapse:collapse;margin-top:8px;font-size:14px}
th,td{border-bottom:1px solid var(--line);padding:6px 3px;text-align:right}
th{color:#7a6a5a;font-weight:600;font-size:12px}
td.d{direction:ltr;text-align:right;white-space:nowrap}
.btns{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
.btns button{padding:10px 6px;border-radius:10px;border:2px solid transparent;font:inherit;font-weight:700;color:#fff}
.btns button small{display:block;font-weight:400;font-size:11px;opacity:.9}
.btns button.cur{border-color:#000;box-shadow:0 0 0 2px #fff inset}
.btns .full{grid-column:1/-1}
.ts{font-size:13px;color:#4a3d31;margin-top:6px}
.remark{background:#fde8e8;border-radius:8px;padding:6px 8px;margin-top:6px;font-size:14px}
a.tel{color:inherit}
#toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:#222;color:#fff;padding:10px 16px;border-radius:99px;z-index:20;pointer-events:none}
.empty{text-align:center;color:#8a7a6a;padding:30px}
.btn.wa{display:block;text-align:center;text-decoration:none;background:#16a34a;color:#fff;border-radius:10px;padding:12px 14px;font-weight:700;margin-top:10px}
body.dolidol .btn.wa{background:#16a34a}
.problem-box{background:#fde8e8;border:2px solid #dc2626;border-radius:10px;padding:8px 10px;margin:8px 0}
.problem-box .ptxt{margin-top:6px;font-weight:700;color:#7f1d1d;font-size:16px;white-space:pre-wrap}
.card.has-problem{border-color:#dc2626;border-width:2px}
.pform{background:#fff5f5;border:1px solid #f1b0b0;border-radius:10px;padding:8px;margin-top:10px}
.note{background:#eef2f7;border-radius:8px;padding:6px 8px;margin-top:6px;font-size:14px}
.filter .row{margin-bottom:2px}
.btns{grid-template-columns:1fr 1fr 1fr}
.btns button:last-child{grid-column:1/-1}
body button.btn.red,body.dolidol button.btn.red{background:#b3261e;color:#fff}

.bonlink{margin-top:8px}.bonlink a{color:#1d5a7a;font-weight:700}
.wai{vertical-align:-3px;margin-inline-end:2px}a.wa-phone{color:#128c4a;font-weight:700;text-decoration:none;border-bottom:1px dotted #128c4a}
.s-retour{background:#7e22ce}
body button.btn.retourbtn,body.dolidol button.btn.retourbtn,body button.btn.retour{background:#3b0764;color:#fff;letter-spacing:1px}
.retour-box{background:#f5ebfd;border:2px solid #7e22ce;border-radius:10px;padding:8px 10px;margin:8px 0}
.retour-box .ptxt{margin-top:6px;font-weight:700;color:#3b0764;white-space:pre-wrap}
.btns button.s-retour{grid-column:1/-1;min-height:48px}
.retour-hist{background:#f5ebfd;border:1px solid #c9a6ea;border-radius:10px;padding:8px 10px;margin:8px 0}
.rh-title{font-weight:800;color:#3b0764;margin-bottom:4px}
.rh-item{border-top:1px dashed #c9a6ea;padding:5px 0}.rh-item:first-of-type{border-top:0}
.rh-when{font-size:13px;color:#5b21b6;font-weight:700}.rh-why{font-size:15px}
.push-card{background:#eef6fb;border-color:#b6d4f2}.push-card.ok{background:#eaf7ee;border-color:#b7e1c1;font-weight:700}.push-hint{font-size:14px;color:#3b4a56;margin-top:8px;line-height:1.6}

.btn.loc{display:block;text-align:center;text-decoration:none;background:#1a73e8;color:#fff;border-radius:10px;padding:12px 14px;font-weight:700;margin-top:10px}
body.dolidol .btn.loc{background:#1a73e8}

.invbox{margin-top:12px;padding:10px;border:1px dashed #b9a58c;border-radius:10px;background:#fbf7f1}
.btn.inv{display:block;text-align:center;background:#7a3b1d;color:#fff;border-radius:10px;padding:12px 14px;font-weight:700}
label.btn.invpick{display:block;background:#efe6d8;color:var(--txt);border:0;width:100%;box-sizing:border-box;text-align:center;cursor:pointer;border-radius:10px;padding:11px 14px;font-weight:600;margin-top:10px}

.invbox .btn.inv{margin-top:14px}


.presets{display:flex;flex-wrap:wrap;gap:8px}
button.pre{flex:1 1 calc(33.333% - 8px);min-width:96px;font:inherit;font-weight:700;padding:10px 6px;border-radius:10px;border:2px solid #d9c9b3;background:#faf6f0;color:var(--txt);cursor:pointer}
button.pre.on{background:var(--brown);border-color:var(--brown);color:#fff}
body.dolidol button.pre.on{background:var(--blue);border-color:var(--blue)}
.customdates{margin-top:6px}

/* ---- v2: fabric role theme ---- */
:root{--green:#2f6b4f}
body.fabric header{background:var(--green)}
body.fabric button.btn{background:var(--green)}
body.fabric button.btn.ghost{background:#efe6d8;color:var(--txt)}
body.fabric .day{color:var(--green)}
body.fabric button.pre.on{background:var(--green);border-color:var(--green)}
/* ---- v2: collapsed order card ---- */
.cardhead{cursor:pointer;-webkit-tap-highlight-color:transparent;outline:none}
.cardhead:focus-visible{outline:2px solid var(--brown);outline-offset:3px;border-radius:8px}
.cardhead .who{min-width:0}
.cardhead .meta{font-size:14px;color:#111;font-weight:700;margin-top:2px}
.cardhead .hr{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.chev{font-size:18px;color:#8a7a6a;line-height:1}
.pills{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:10px}
.pills.one{grid-template-columns:1fr}
.pill{border-radius:10px;color:#fff;padding:5px 6px;text-align:center;min-width:0;display:flex;flex-direction:column;justify-content:center}
.pill small{font-size:11px;opacity:.9;line-height:1.2}
.pill b{font-size:13px;line-height:1.25;word-break:break-word}
.pills.one .pill{flex-direction:row;gap:8px;justify-content:center;align-items:center}
.card.open{border-color:#cbbfae;box-shadow:0 2px 10px #0000000d}
.cardbody{margin-top:10px;padding-top:8px;border-top:1px dashed var(--line)}
.sec{margin-top:12px;padding:10px;border:1px solid #e3d5c2;border-radius:10px;background:#fcfaf6}
.sech{font-weight:800;color:var(--brown);margin-bottom:6px;font-size:15px;display:flex;justify-content:space-between;align-items:center}
body.fabric .sech{color:var(--green)}
body.dolidol .sech{color:var(--blue)}
.tls{display:flex;flex-wrap:wrap;gap:6px 10px;margin-top:6px;font-size:12px;color:#5a4a3c}
.tls .tl b{background:#eadfd2;border-radius:6px;padding:0 6px;margin-inline-end:3px}
.small{font-size:12px;margin-top:4px}
.j4{margin-top:8px;padding:6px 10px;border-radius:8px;background:#eef6ff;border:1px solid #b6d4f2;color:#16406b;font-size:14px}
.j4.late{background:#fde8e8;border-color:#f1b0b0;color:#7f1d1d}
.ticketrow{margin-top:8px;align-items:stretch}
button.tickview,button.devview{font:inherit}
button.tickview{flex:1;border:1px solid #b9a58c;background:#fff;border-radius:10px;padding:10px;font-weight:700;color:var(--txt)}
.ticketrow label.invpick{margin-top:0;width:auto}
.delline{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.dpill{color:#fff;border-radius:99px;padding:2px 12px;font-weight:700;font-size:14px}
.countline{margin-top:12px;padding:10px 12px;border-radius:10px;background:#fff7e6;border:1px solid #f3d9a4;font-weight:700}
.countline.ok{background:#e8f6ec;border-color:#9bd3ab;color:#14532d}
.cprog{font-weight:800;color:var(--green)}
.cprog.full{color:#16a34a}
.ctabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:6px}
button.ctab{font:inherit;font-weight:700;padding:8px 4px;border-radius:10px;border:2px solid #d9c9b3;background:#faf6f0;color:var(--txt);font-size:14px}
button.ctab.on{background:var(--green);border-color:var(--green);color:#fff}
.pgrp{margin-top:8px;padding:8px;border:1px solid #e3d5c2;border-radius:10px;background:#fff}
.pgh{display:flex;justify-content:space-between;align-items:center;font-weight:700;font-size:14px;margin-bottom:6px;gap:8px}
button.pcrm{font:inherit;border:0;background:#fde8e8;color:#b3261e;border-radius:8px;padding:2px 9px;font-weight:800}
.pcs{display:flex;flex-wrap:wrap;gap:6px}
label.pc{margin:0;display:flex;align-items:center;justify-content:center;gap:0;min-width:44px;height:44px;border:2px solid #cbbfae;border-radius:10px;background:#fff;font-weight:800;font-size:16px;position:relative;cursor:pointer;color:#5a4a3c}
label.pc input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer}
label.pc.on{background:#16a34a;border-color:#16a34a;color:#fff}
label.pc.on span::before{content:'✓ '}
.manual{margin-top:8px}
button.btn[disabled]{opacity:.45}
/* order type (نوع الطلبية) */
.tbadge{font-size:12px;padding:2px 8px;white-space:nowrap}
.tbadge.t-foam_only{background:#0f766e}.tbadge.t-foam_shop{background:#b45309}.tbadge.t-jalsa_nofoam{background:#7c3aed}
.foamtop{background:#ecfdf5;border:1px solid #a7f3d0;color:#065f46;border-radius:10px;padding:8px 12px;margin-bottom:6px}
.typeopt{display:flex;gap:8px;margin:4px 0 6px}
.typeopt .opt{flex:1;display:flex;align-items:center;gap:6px;justify-content:center;margin:0;padding:10px 6px;border:2px solid #d1d5db;border-radius:10px;background:#fff;font-weight:700;font-size:15px;cursor:pointer;text-align:center}
.typeopt .opt.on{border-color:#0f766e;background:#ecfdf5;color:#065f46}
.typeopt .opt input{width:auto;margin:0}
.tabs{flex-wrap:wrap}.tabs button{min-width:0;padding-inline:8px}
/* v4: other items (admin), delivery log, invoice+devis checkbox */
button.oirm{font:inherit;border:0;background:#fde8e8;color:#b3261e;border-radius:8px;padding:2px 9px;font-weight:800}
.oibox .oi{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:6px 0;border-bottom:1px dashed var(--line)}
.fromdev{display:inline-block;background:#e0f2fe;color:#075985;border-radius:6px;padding:0 6px;font-size:11px;font-weight:700;vertical-align:middle}
.dellog{margin-top:8px;padding-top:6px;border-top:1px dashed var(--line)}
.dellog .dl{font-size:13px;padding:3px 0;display:flex;flex-wrap:wrap;gap:4px 6px;align-items:center}
.dpill.sm{font-size:12px;padding:1px 8px}
.by{display:inline-block;border-radius:6px;padding:0 6px;font-size:12px;font-weight:700;background:#eee;color:#444}
.by-admin{background:#efe4d3;color:#5c3d1e}.by-fabric{background:#dcfce7;color:#166534}.by-bot{background:#ede9fe;color:#5b21b6}
.chk.alsodevis{display:flex;align-items:center;gap:8px;margin:8px 0 4px;font-size:14px;font-weight:600}
.chk.alsodevis input{width:auto;margin:0}
/* ===== admin dashboard v2 (لوحة التحكم): light, sober, horizontal-friendly cards ===== */
.d2{display:flex;flex-direction:column;gap:14px}
.d2 .card{margin:0}
.d2-sec{background:#fff;border:1px solid #e5dccf;border-radius:14px;padding:14px;box-shadow:0 1px 2px #0000000a}
.d2-h{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin:0 0 10px}
.d2-h h3{margin:0;font-size:16px;color:#2b2118}.d2-h small{font-size:12px;color:#8a7a6a}
.d2-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
.d2-tile{font:inherit;text-align:inherit;display:flex;flex-direction:column;gap:3px;background:#faf6f0;border:1px solid #eadfd0;border-radius:12px;padding:12px;cursor:pointer;color:#2b2118;min-width:0}
.d2-tile .l{font-size:12.5px;font-weight:700;color:#6b5a48}
.d2-tile .v{font-size:24px;font-weight:800;line-height:1.15;direction:ltr;text-align:start;word-break:break-all}
.d2-tile .u{font-size:11.5px;color:#8a7a6a;font-weight:700}
.d2-tile.tot{border-top:3px solid #7a3b1d}.d2-tile.adv{border-top:3px solid #2f6b4f}.d2-tile.adv .v{color:#2f6b4f}
.d2-tile.rem{border-top:3px solid #c2410c}.d2-tile.rem .v{color:#c2410c}
.d2-tile:disabled,.d2-tile.zero{cursor:default;opacity:.65}
.d2-tile:not(:disabled):active,.d2-row:not(:disabled):active,.d2-alert:active{transform:scale(.99)}
.d2-note{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:10px;font-size:12.5px;color:#5a4a3a;line-height:1.5}
.d2-note b{direction:ltr;unicode-bidi:isolate}
.d2-chip{font:inherit;display:inline-block;margin-top:8px;border:1px solid #e5dccf;background:#f6f1ea;color:#5a4a3a;border-radius:99px;padding:5px 12px;font-size:12.5px;cursor:pointer}
.d2-chip.static{cursor:default}
/* banks */
.d2-banks{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px}
.d2-bank{font:inherit;text-align:inherit;display:flex;flex-direction:column;gap:2px;background:#fff;border:1px solid #e5dccf;border-inline-start:4px solid var(--bc,#94a3b8);border-radius:12px;padding:10px 12px;cursor:pointer;color:#2b2118;min-width:0}
.d2-bank .n{font-weight:800;font-size:14px}.d2-bank .v{font-size:19px;font-weight:800;direction:ltr;text-align:start}.d2-bank small{font-size:11.5px;color:#8a7a6a}
.d2-bank:disabled{cursor:default;opacity:.55}
.d2-cih{margin-top:10px;border:1px solid #c7d2fe;background:#f5f7ff;border-radius:12px;padding:12px}
.d2-cih .t{display:flex;justify-content:space-between;align-items:center;font-weight:800;margin-bottom:6px}
.d2-cih .t b{direction:ltr;font-size:20px;color:#1d3a8a}
.d2-cih .ln{font:inherit;width:100%;text-align:inherit;display:flex;justify-content:space-between;gap:8px;padding:7px 0;border:0;border-bottom:1px dashed #c7d2fe;background:none;color:#2b2118;font-size:14px}
.d2-cih .ln b{direction:ltr}.d2-cih .ln.go{cursor:pointer}.d2-cih .ln.go b{color:#c2410c}
.d2-cih .eq{font-size:12px;color:#51608f;margin-top:8px;line-height:1.5}
/* foam / fabric stage lists */
.d2-two{display:grid;grid-template-columns:1fr;gap:14px}
.d2-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}
.d2-row{font:inherit;text-align:inherit;display:flex;align-items:center;justify-content:space-between;gap:8px;background:#fff;border:1px solid #e5dccf;border-inline-start:4px solid var(--rc,#94a3b8);border-radius:10px;padding:9px 10px;cursor:pointer;color:#2b2118;min-width:0}
.d2-row span{font-size:13.5px;font-weight:700;line-height:1.3}.d2-row b{font-size:20px;font-weight:800;color:var(--rc,#2b2118);direction:ltr}
.d2-row:disabled{cursor:default;opacity:.55}.d2-row:disabled b{color:#a8a29e}
.d2-row .stg{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:var(--rc,#94a3b8);color:#fff;font-size:11px;margin-inline-end:6px}
/* late alerts */
.d2-alerts{display:grid;grid-template-columns:1fr;gap:10px}
.d2-alert{font:inherit;display:block;width:100%;text-align:inherit;border:1px solid #fca5a5;background:#fef2f2;border-radius:14px;padding:12px;color:#7f1d1d;cursor:pointer}
.d2-alert.ok{background:#f0fdf4;border-color:#bbf7d0;color:#166534;cursor:default}
.d2-alert .ah{display:flex;align-items:center;gap:10px}
.d2-alert .at{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.d2-alert .at b{font-size:15.5px}.d2-alert .at small{font-size:12px;opacity:.9;line-height:1.4}
.d2-alert .big{font-size:30px;font-weight:800;line-height:1;color:#b91c1c;direction:ltr}
.d2-alert.ok .big{color:#16a34a;font-size:22px}
.d2-alert .al{display:flex;flex-direction:column;gap:4px;margin-top:8px;padding-top:8px;border-top:1px solid #fecaca}
.d2-alert .al>span{display:flex;justify-content:space-between;gap:8px;font-size:13.5px}
.d2-alert .al i{font-style:normal;background:#dc2626;color:#fff;border-radius:99px;padding:0 9px;font-weight:700;font-size:12.5px;white-space:nowrap}
.d2-alert .al .more{color:#991b1b;opacity:.85;font-size:12.5px}
.d2-unk{font:inherit;display:inline-block;margin-top:6px;border:1px solid #fdba74;background:#fff7ed;color:#9a3412;border-radius:99px;padding:5px 12px;font-size:12.5px;cursor:pointer;width:fit-content}
.d2-foot{text-align:center;font-size:12px;color:#8a7a6a;line-height:1.6;padding:0 8px 12px}
@media(min-width:760px){.d2-two{grid-template-columns:1fr 1fr}.d2-alerts{grid-template-columns:repeat(3,1fr)}.d2-alert{display:flex;flex-direction:column}.d2-tile .v{font-size:28px}}
/* list banner + late tag */
.dashbanner{display:flex;justify-content:space-between;align-items:center;gap:8px;background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;border-radius:12px;padding:8px 12px;margin-bottom:10px;font-size:14px}
.dashbanner button{font:inherit;border:0;background:#fed7aa;color:#9a3412;border-radius:8px;width:30px;height:30px;font-weight:800}
.badge.late{background:#dc2626}.badge.unk{background:#ea580c}

/* ---- ramassage ticket QR reader ---- */
.qrhint{margin:6px 2px 0;font-size:12.5px}
.qrnote{margin-top:10px;padding:11px 13px;border-radius:12px;border:1px solid;font-size:14px;line-height:1.6;box-shadow:0 1px 2px rgba(60,40,20,.06)}
.qrnote .qrh{font-size:15px;font-weight:700}
.qrnote .qrs{font-size:13px;margin-top:2px}
.qrnote .qrcode{display:inline-block;padding:1px 8px;border-radius:7px;background:rgba(255,255,255,.75);font-family:ui-monospace,Menlo,Consolas,monospace;font-size:14px;letter-spacing:.2px;word-break:break-all;unicode-bidi:isolate}
.qrnote.ok{background:#ecfdf3;border-color:#a7e3bd;color:#14532d}
.qrnote.warn{background:#fff4e5;border-color:#f6c98a;color:#7c3f00}
.qrnote.busy{background:#f3f4f6;border-color:#e0e3e7;color:#4b5563}

/* ---- admin export button (Excel only; CSV endpoint kept server-side, hidden from UI) ---- */
.exprow{display:grid;grid-template-columns:1fr;gap:8px;margin-top:10px}
.exprow button.btn.csvbtn{margin:0;min-height:52px;padding:8px 6px;line-height:1.3;background:#fff;color:#1f6f43;border:1.5px solid #1f6f43;box-shadow:0 1px 2px rgba(60,40,20,.08)}
.exprow button.btn.csvbtn.xl{background:#1f6f43;color:#fff}
.exprow button.btn.csvbtn:active{opacity:.85}
@media(max-width:360px){.exprow{grid-template-columns:1fr}}

.modrow{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.modrow .minp{flex:1 1 140px;min-width:0;padding:6px 8px;font-size:14px;border:1px solid #d8cbb8;border-radius:8px;background:#fff}
.modrow .msave{width:auto;padding:6px 14px;min-height:36px}

.notebox .notein{width:100%;min-height:72px;padding:8px 10px;font:inherit;border:1px solid #d8cbb8;border-radius:8px;background:#fff;resize:vertical;margin-bottom:6px}
.notebox .notets{margin-top:4px}
.notebadge{background:#fff3c4;color:#7a5b00;border:1px solid #f0d77a}
summary.sech{cursor:pointer;list-style:none}
summary.sech::-webkit-details-marker{display:none}
details.oibox>summary.sech::after{content:' ▾';color:#7a6a5a}
details.oibox[open]>summary.sech::after{content:' ▴'}

.bankrow .dnum small{font-size:11px;color:#7a6a5a;font-weight:600}
.mslot{display:inline-flex;align-items:center}
.mthumb{padding:0;border:2px solid #d8cbb8;border-radius:10px;background:#fff;width:52px;height:52px;overflow:hidden;cursor:zoom-in;min-height:0;flex:none}
.mthumb img{display:block;width:100%;height:100%;object-fit:cover}
.mfab b{font-weight:700}
.mpbox{position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,.82);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px;cursor:zoom-out}
.mpbox img{max-width:100%;max-height:82vh;border-radius:12px;background:#fff;object-fit:contain}
.mpbox .mpcap{color:#fff;margin-top:10px;font-weight:700;direction:ltr;text-align:center}
.mpbox .mpclose{position:absolute;top:12px;left:12px;width:40px;height:40px;border-radius:50%;border:0;background:#fff;color:#111;font-size:18px;min-height:0}

/* ---- جلسة (fabric role): simple 4-phase mobile UI. Light theme, white cards, deep green + gold. Scoped to body.fabric: nothing here touches admin / dolidol. ---- */
body.fabric{--fg:#0b4a36;--fg2:#14684d;--gold:#c8a24a;--goldbg:#fbf4e1;--mut:#8b9590;--ln:#e8ece9;background:#f7f8f6}
body.fabric header{background:#fff;color:var(--fg);border-bottom:3px solid var(--gold)}
body.fabric header button{color:var(--fg)}
body.fabric h1{color:var(--fg)}
body.fabric.fdet{background:#fff}
body.fabric.fdet main{padding-bottom:110px}
body.fabric .card.fdetail{border:0;padding:0;background:transparent;margin:0}
.fhead{display:flex;align-items:center;gap:10px;padding:6px 2px 10px}
.fback{width:42px;height:42px;border-radius:50%;border:0;background:#eef1ef;color:var(--fg);display:grid;place-items:center;flex:0 0 auto;padding:0}
.fback .ico{width:22px;height:22px}
.ftt{flex:1;min-width:0;text-align:center}
.ftt h2{margin:0;font-size:26px;font-weight:800;color:var(--fg);line-height:1.2}
.fsub{font-size:13px;color:#5d6b64;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fnum{flex:0 0 auto;background:var(--goldbg);color:#8a6d1f;border:1px solid #ecdcae;border-radius:99px;padding:3px 10px;font-weight:700;font-size:13px;max-width:34vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* step indicator */
.psteps{display:flex;align-items:flex-start;justify-content:space-between;margin:6px 4px 14px}
.pnode{background:none;border:0;padding:0;display:flex;flex-direction:column;align-items:center;gap:4px;min-width:62px;font:inherit;color:var(--mut);cursor:pointer}
.pnode .pc{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;font-weight:800;font-size:16px;background:#fff;border:2px solid #d5dbd7;color:var(--mut)}
.pnode small{font-size:12px;font-weight:700}
.pnode.cur .pc{background:var(--fg);border-color:var(--fg);color:#fff}
.pnode.cur small{color:var(--fg)}
.pnode.done .pc{background:var(--gold);border-color:var(--gold);color:#fff}
.pnode.done small{color:#8a6d1f}
.pnode.view .pc{box-shadow:0 0 0 4px #0b4a3622}
.pline{flex:1;height:2px;margin-top:19px;background:repeating-linear-gradient(90deg,#cfd6d2 0 5px,transparent 5px 9px)}
.fph{font-size:18px;font-weight:800;margin:6px 4px 10px;color:#1b1f1d}
.fcard{background:#fff;border:1px solid var(--ln);border-radius:20px;padding:14px;margin-bottom:12px;box-shadow:0 4px 18px #0b4a3610}
.fh{font-weight:800;color:var(--fg);margin-bottom:10px;font-size:16px}
/* phase 1: steps */
.fsteps{list-style:none;margin:0 0 12px;padding:8px 14px;background:#fff;border:1px solid var(--ln);border-radius:20px;box-shadow:0 4px 18px #0b4a3610}
.fstep{display:flex;align-items:center;gap:12px;min-height:58px;position:relative}
.fstep .sic{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:#eaf3ee;color:var(--fg2);flex:0 0 auto}
.fstep .slb{flex:1;min-width:0;display:flex;flex-direction:column}
.fstep .slb b{font-size:17px;font-weight:700;color:#1b1f1d}
.fstep .slb small{font-size:12px;color:var(--mut)}
.fstep .sind{width:28px;height:28px;border-radius:50%;border:2px solid #cfd6d2;display:grid;place-items:center;flex:0 0 auto;background:#fff;position:relative;z-index:1;color:#fff;font-size:15px;font-weight:800}
.fstep:not(:last-child) .sind::after{content:'';position:absolute;top:100%;left:50%;height:30px;border-left:2px dotted #cfd6d2;transform:translateX(-50%)}
.fstep:not(:last-child){margin-bottom:0}
.fstep.done .sind{background:var(--fg);border-color:var(--fg)}
.fstep.done .sind::after{border-color:var(--fg)}
.fstep.cur .sic{background:var(--goldbg);color:#a47c14}
.fstep.cur .slb b{color:#8a6d1f}
.fstep.cur .sind{border-color:var(--gold);box-shadow:0 0 0 4px #c8a24a30}
.fstep.cur .sind i{width:12px;height:12px;border-radius:50%;background:var(--gold);display:block}
.fstep.todo .sic{background:#f1f3f2;color:#9aa6a0}.fstep.todo .slb b{color:#7b8782;font-weight:600}
.fstep.fail .sic{background:#fde8e8;color:#c0261e}.fstep.fail .slb b{color:#c0261e}.fstep.fail .sind{background:#c0261e;border-color:#c0261e}
.tickic{display:block}
/* phase 2: checklist */
.fchecks{padding:6px 14px}
label.ckrow{display:flex;align-items:center;gap:14px;margin:0;padding:16px 4px;border-bottom:1px solid var(--ln);cursor:pointer;font-size:19px;font-weight:700;color:#1b1f1d;position:relative;min-height:62px}
label.ckrow:last-child{border-bottom:0}
label.ckrow input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0}
.cbx{width:32px;height:32px;border-radius:9px;border:2px solid #c3cbc7;background:#fff;display:grid;place-items:center;color:transparent;flex:0 0 auto}
.ckrow.on .cbx{background:var(--fg);border-color:var(--fg);color:#fff}
.ckrow.part .cbx{border-color:var(--gold);background:var(--goldbg)}
.ckrow input:disabled~.cnm{opacity:.75}
.cnm{flex:1}
button.ckrm{position:relative;z-index:2;border:0;background:#fde8e8;color:#b3261e;border-radius:10px;width:36px;height:36px;font-weight:800;padding:0}
details.fadd{margin:0 0 12px;background:#fff;border:1px dashed #c3cbc7;border-radius:16px;padding:10px 14px}
details.fadd summary{cursor:pointer;font-weight:700;color:var(--fg2);list-style:none;min-height:30px;display:flex;align-items:center}
details.fadd summary::-webkit-details-marker{display:none}
details.fadd .row{margin-top:8px}
/* phase 3: form */
.fl{display:flex;align-items:center;gap:6px;font-size:15px;font-weight:800;color:var(--fg);margin:14px 2px 6px}
.fl:first-child{margin-top:0}
.fl .ico{width:20px;height:20px;color:var(--fg2)}
.fl i{color:var(--gold);font-style:normal;font-size:18px}
body.fabric .fcard input:not([type=checkbox]):not([type=radio]),body.fabric .fcard select,body.fabric .fcard textarea{border:1.5px solid #d5dbd7;border-radius:14px;padding:14px;font-size:17px;min-height:52px;background:#fff}
body.fabric .fcard input:focus,body.fabric .fcard select:focus,body.fabric .fcard textarea:focus{outline:0;border-color:var(--fg2);box-shadow:0 0 0 3px #14684d22}
.packrow{border:1.5px solid #d5dbd7!important;border-radius:14px;padding:12px 14px!important;font-size:17px!important;min-height:56px!important}
.packrow.on{background:#eaf3ee;border-color:var(--fg2)!important}
.cars{display:grid;gap:8px}
label.car{display:flex;align-items:center;gap:12px;margin:0;padding:13px 14px;border:1.5px solid #d5dbd7;border-radius:14px;font-size:17px;font-weight:700;min-height:54px;position:relative;cursor:pointer;direction:ltr;text-align:left}
label.car input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0}
.car .rd{width:24px;height:24px;border-radius:50%;border:2px solid #c3cbc7;flex:0 0 auto;display:grid;place-items:center}
.car.on{border-color:var(--fg2);background:#eaf3ee}
.car.on .rd{border-color:var(--fg);background:radial-gradient(var(--fg) 0 42%,#fff 46%)}
.ticketrow{margin-bottom:8px}
label.tickzone{display:flex;flex-direction:column;align-items:center;gap:6px;margin:0;padding:22px 12px;border:2px dashed var(--fg2);border-radius:18px;color:var(--fg);text-align:center;cursor:pointer;background:#f6fbf8}
.tickzone .ico{width:38px;height:38px}
.tickzone b{font-size:17px}.tickzone small{color:#5d6b64;font-size:12px}
.fcard .j4{margin-top:10px;font-size:13px;color:#5d6b64}
/* phase 4 */
.fsum{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.fsum>div{display:flex;flex-direction:column;gap:4px;min-width:0}
.fsum .k{font-size:12px;color:var(--mut)}
.fsum b{font-size:16px;color:#1b1f1d;display:flex;align-items:center;gap:6px;word-break:break-all}
.fsum b .ico{width:20px;height:20px;color:var(--fg2);flex:0 0 auto}
.dtiles{display:grid;grid-template-columns:1fr 1fr;gap:10px}
button.dtile{font:inherit;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:92px;padding:10px 6px;border-radius:18px;border:2px solid #d5dbd7;background:#fff;color:#1b1f1d;font-weight:800;font-size:16px;cursor:pointer}
button.dtile .ico{width:30px;height:30px;color:var(--fg2)}
button.dtile.t-livre .ico{color:#b58a1e}button.dtile.t-echec .ico{color:#c0261e}
button.dtile.on{border-color:var(--fg);background:#eaf3ee;box-shadow:0 0 0 3px #0b4a3622}
button.dtile.t-echec.on{border-color:#c0261e;background:#fdf0ef;box-shadow:0 0 0 3px #c0261e22}
.whybox{margin-top:4px}
.fhint{background:var(--goldbg);border:1px solid #ecdcae;color:#7a5f14;border-radius:14px;padding:11px 14px;margin:0 0 12px;font-weight:700;font-size:14px;text-align:center}
.fok{background:#e8f6ec;border:1px solid #9bd3ab;color:#14532d;border-radius:14px;padding:12px 14px;margin:0 0 10px;font-weight:800;text-align:center}
button.flink{display:block;margin:0 auto 12px;background:none;border:0;color:#5d6b64;font:inherit;font-weight:700;padding:10px 14px;text-decoration:underline}
details.fmore{background:#fff;border:1px solid var(--ln);border-radius:16px;padding:10px 14px;margin:6px 0 12px}
details.fmore>summary{cursor:pointer;font-weight:800;color:var(--fg);min-height:34px;display:flex;align-items:center;list-style:none}
details.fmore>summary::-webkit-details-marker{display:none}
details.fmore>summary::after{content:'▾';margin-inline-start:auto;color:var(--mut)}
details.fmore[open]>summary::after{content:'▴'}
/* bottom action bar */
.fbar{position:fixed;left:0;right:0;bottom:0;z-index:6;padding:12px 14px calc(12px + env(safe-area-inset-bottom));background:linear-gradient(to top,#fff 70%,#fff0)}
.fbar>*{max-width:696px;margin:0 auto;display:flex}
button.fbtn{width:100%;min-height:62px;border:0;border-radius:20px;background:var(--fg);color:#fff;font:inherit;font-size:20px;font-weight:800;display:flex;align-items:center;justify-content:center;gap:12px;box-shadow:0 8px 20px #0b4a3640;cursor:pointer}
button.fbtn .ico{width:26px;height:26px;color:#e6c76d}
button.fbtn:active{transform:translateY(1px)}
button.fbtn:disabled{background:#b9cfc5;color:#eef5f1;box-shadow:none;cursor:not-allowed}
button.fbtn:disabled .ico{color:#eef5f1}
/* order list (fabric): same cards, softer */
body.fabric .card:not(.fdetail){border-radius:18px}
body.fabric .chev{font-size:26px;color:var(--fg2)}
body.fabric #toast{pointer-events:none}
body.fabric.fdet #toast{bottom:calc(96px + env(safe-area-inset-bottom))} /* above the big bottom button, never covering it */
/* phase 2 reuses the per-piece checklist (tabs / ticks / other products) */
body.fabric .fdetail .countbox{background:#fff;border:1px solid var(--ln);border-radius:20px;padding:14px;margin:0 0 12px;box-shadow:0 4px 18px #0b4a3610}
body.fabric .fdetail .sech{color:var(--fg)}
body.fabric .fdetail button.ctab{min-height:48px;font-size:15px;border-radius:14px}
body.fabric .fdetail button.ctab.on{background:var(--fg);border-color:var(--fg)}
body.fabric .fdetail label.pc{min-width:52px;height:52px;border-radius:12px}
body.fabric .fdetail .pgh{font-size:16px}
body.fabric .fdetail .pcall{min-height:46px}
body.fabric .fdetail input[type=datetime-local]{width:100%}
.pnode small{text-align:center;line-height:1.2}
/* v2: phase 1 steps are tappable buttons; 5-phase indicator; notes box */
.fstep>.fstepbtn{all:unset;box-sizing:border-box;display:flex;align-items:center;gap:12px;width:100%;min-height:62px;cursor:pointer;-webkit-tap-highlight-color:transparent}
.fstep>.fstepbtn:focus-visible{outline:2px solid var(--fg2);outline-offset:2px;border-radius:12px}
.fstep.cur>.fstepbtn,.fstep.todo>.fstepbtn:active{background:#f6fbf8;border-radius:14px}
.fstep.done .sic{background:#eaf3ee}
.fhint.ghost{background:transparent;border-color:transparent;color:var(--mut);font-weight:600;font-size:13px}
.pnode{min-width:52px}
.pnode small{font-size:11px}
.psteps .pline{margin-top:19px}
body.fabric.fdet main:has(.card.fdetail.nobar){padding-bottom:24px}
.fnotebox textarea{min-height:90px}
.fnotebox .k{margin-top:6px}
.fnoteadm .ptxt{font-weight:700;margin-top:4px}
button.docdl{font:inherit}
button.docdl:not(.btn){border:1px solid #b9a58c;background:#fff;border-radius:10px;padding:10px;font-weight:700;color:var(--txt)}
.ticketrow button.docdl.btn{padding-left:14px;padding-right:14px}
/* admin order page v2 */
.bonbtn{display:flex;gap:8px;align-items:center;margin:12px 0 0}
.bonbtn a.btn{flex:1;text-align:center;text-decoration:none;color:var(--txt);margin:0}
.bonbtn .bondl{flex:0 0 auto;color:#1d5a7a;font-weight:700;font-size:13px}
.fplist{list-style:none;margin:6px 0 4px;padding:0}
.fp{display:flex;align-items:center;gap:10px;padding:7px 0;position:relative}
.fp+.fp::before{content:"";position:absolute;inset-inline-start:13px;top:-9px;height:14px;width:2px;background:#d8cbb9}
.fp.done+.fp::before,.fp.cur+.fp::before{background:#d8cbb9}
.fp .fdot{flex:0 0 28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-style:normal;font-weight:800;font-size:13px;background:#e6dccd;color:#7a6a58}
.fp.done .fdot{background:#16a34a;color:#fff}
.fp.cur .fdot{background:#d97706;color:#fff;box-shadow:0 0 0 4px rgba(217,119,6,.2)}
.fp .fpn{flex:1;display:flex;flex-direction:column;line-height:1.3}
.fp .fpn small{color:#6b5b4a;font-size:12px}
.fp.todo .fpn b{color:#9a8b78;font-weight:600}
.fp .fpt{font-size:12px;color:#5a4a3c;white-space:nowrap}
.dolnote .badge{margin-inline-end:6px}
/* catalogue picker (admin) */
.catpk{margin:6px 0}
.catpk .catq{width:100%;box-sizing:border-box}
.catchips{display:flex;gap:6px;overflow-x:auto;padding:6px 0;-webkit-overflow-scrolling:touch}
.catchip{flex:0 0 auto;border:1px solid #b9a58c;background:#fff;border-radius:99px;padding:6px 12px;font:inherit;font-size:13px;font-weight:700;color:var(--txt);white-space:nowrap}
.catchip.on{background:var(--brown);border-color:var(--brown);color:#fff}
.catres{max-height:280px;overflow-y:auto;border:1px solid #e3d8c8;border-radius:10px;background:#fff;-webkit-overflow-scrolling:touch}
.catpick{display:flex;width:100%;justify-content:space-between;align-items:center;gap:10px;text-align:start;padding:10px 12px;border:0;border-bottom:1px solid #f0e8dc;background:#fff;font:inherit;color:var(--txt)}
.catpick:active{background:#f5efe6}
.catpick .cpn{display:flex;flex-direction:column;line-height:1.35;font-weight:700;font-size:14px}
.catpick .cpn small{font-weight:400;color:#7a6a58;font-size:12px}
.catpick .cpp{flex:0 0 auto;color:#1f6f43;font-size:13px}
.ditem{display:flex;align-items:center;gap:8px;padding:6px 0;border-bottom:1px dashed #e3d8c8}
.ditem .dil{flex:1;font-weight:700;font-size:14px}
.ditem .diqty{width:64px;flex:0 0 auto}
.ditem .dirm{flex:0 0 auto;padding:6px 10px;margin:0}
.oitot{margin:6px 0}

/* catalogue thumbnails */
.cth{width:44px;height:44px;border-radius:8px;object-fit:cover;flex:0 0 44px;background:#f0e8dc}
.cth0{display:flex;align-items:center;justify-content:center;font-size:20px}
.oibox .oil{display:flex;align-items:center;gap:8px}
/* trash */
.tabs button.trashtab{flex-basis:100%}
.trcard .trh{display:flex;justify-content:space-between;gap:8px;align-items:baseline;margin-bottom:4px}
.trcard .row .btn{margin:0}
/* BL (bon de livraison) */
.blbox img.blimg{display:block;max-width:100%;max-height:340px;margin:6px auto;border-radius:10px;border:1px solid #e3d8c8;background:#fff;object-fit:contain}
.blbox .row{margin-top:6px}
.blbox .row .btn{margin:0}

/* logout + entry (login) screen */
header button#logout{font-size:13px;font-weight:700;background:#ffffff26;border-radius:99px;padding:7px 11px;margin-inline-start:6px;white-space:nowrap}
header button#logout[hidden]{display:none}
@media(max-width:360px){header button#logout{padding:6px 8px;font-size:12px}}
.linkbtn{display:block;margin:12px auto 0;background:none;border:0;color:#6b5a48;font:inherit;font-size:13px;text-decoration:underline}
body.entrymode header,header.entryhead{display:none}
body.entrymode{background:linear-gradient(180deg,#f6f1ea 0%,#ecdfcd 100%);min-height:100vh}
.entry{max-width:380px;margin:0 auto;padding:max(28px,env(safe-area-inset-top)) 22px 28px;text-align:center}
.entrylogo{display:block;width:112px;height:112px;border-radius:24px;margin:8vh auto 14px;box-shadow:0 8px 24px #7a3b1d33;background:#fff}
.entryh{margin:0;font-size:24px;letter-spacing:.5px;color:var(--brown)}
.entrysub{color:#7a6a58;margin:2px 0 22px;font-size:15px}
.entry form{background:#fff;border:1px solid var(--line);border-radius:18px;padding:16px;text-align:start;box-shadow:0 4px 18px #7a3b1d14}
.entry label{display:block;font-size:13px;font-weight:700;color:#5a4a3c;margin:4px 0 4px}
.entry input{width:100%;box-sizing:border-box;font:inherit;padding:12px;border:1px solid #cdbfa9;border-radius:12px;margin-bottom:10px;background:#fffdf9}
.entry input:focus{outline:2px solid #7a3b1d55;border-color:var(--brown)}
.entry .btn.full{margin-top:6px}
.entryhint{margin-top:16px;font-size:12px;color:#8a7a68;line-height:1.6}

/* unified login: interface buttons + single code field */
.entrypick{font-weight:700;color:#5a4a3c;margin:0 0 12px}
.rolebtns{display:flex;flex-direction:column;gap:12px}
.rolebtn{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;font:inherit;font-size:19px;font-weight:800;color:#fff;border:0;border-radius:16px;padding:16px;box-shadow:0 4px 14px #0002;background:var(--brown)}
.rolebtn span{font-size:24px}
.rolebtn.r-dolidol{background:var(--blue)}
.rolebtn.r-fabric{background:#0b4a36}
.rolebtn:active{transform:scale(.98)}
.entryrole{font-size:17px;font-weight:800;color:var(--brown);text-align:center;margin:2px 0 10px}
.entry input.codein{text-align:center;font-size:30px;letter-spacing:10px;padding:14px}
.entryerr{margin:2px 0 10px}
/* admin top bar (3 buttons) + interface switcher */
header{flex-wrap:wrap;row-gap:8px}
header .brand{flex:1 1 auto}
#hbar{flex:0 0 100%;max-width:100%;min-width:0;display:flex;align-items:stretch;gap:6px}
#hbar:not(:has(> :not([hidden]))){display:none}
#adminnav{flex:0 0 auto;min-width:0;display:flex}
#adminnav[hidden]{display:none}
#adminnav button{flex:0 0 auto;min-width:0;font:inherit;font-size:13px;font-weight:700;color:#fff;background:#ffffff26;border:0;border-radius:99px;padding:7px 10px;white-space:normal;line-height:1.25;overflow-wrap:anywhere;text-align:center;overflow:hidden}
#adminnav button.on{background:#fff;color:var(--brown)}
#swrow{flex:1 1 0;min-width:0;display:flex;align-items:stretch;gap:4px}
#swrow[hidden]{display:none}
.swchip{flex:1 1 0;min-width:0;font:inherit;font-size:13px;font-weight:700;color:#fff;background:#ffffff26;border:0;border-radius:99px;padding:7px 4px;white-space:normal;line-height:1.25;overflow-wrap:anywhere;text-align:center;overflow:hidden}
.swchip.on{background:#fff;color:var(--brown)}
body.dolidol #swrow .swchip.on{color:var(--blue)}
body.fabric #swrow .swchip{color:var(--fg);background:#0000000f}
body.fabric #swrow .swchip.on{background:#0b4a36;color:#fff}

/* Dolidol BL upload: 3 blue options */
.blopts{display:flex;gap:8px;margin-top:8px}
label.blbtn{flex:1 1 0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:54px;padding:10px 6px;background:#1d6fd6;color:#fff;border-radius:12px;font-weight:800;font-size:14px;text-align:center;cursor:pointer;box-shadow:0 2px 6px #1d6fd633;-webkit-tap-highlight-color:transparent}
label.blbtn:active{background:#1859ad}
label.blbtn.cam{background:#0f5bc0}
.ditem .diprice{width:78px;flex:0 0 auto}
.ditem .dil{display:flex;align-items:center;gap:6px}
.diman{align-items:center}
.quotebox .qbadge{font-size:12px;padding:2px 10px;border-radius:999px;color:#fff;margin-inline-start:6px}
.quotebox .q-prov{background:#d97706}.quotebox .q-ok{background:#16a34a}
.quotebox.qprov{border-color:#f3cf8f;background:#fffbf1}.quotebox.qconf{border-color:#a7dfb8;background:#f3fbf5}
.qrows>div{display:flex;justify-content:space-between;gap:10px;padding:5px 0;border-bottom:1px dashed #e3d8c8;font-size:14px}
.qrows .qtot{font-size:16px;border-bottom:0;border-top:2px solid #7a3b1d;margin-top:4px;padding-top:7px}
.qwarn{color:#b91c1c;margin:4px 0}
/* manual lines table (new-order form) */
.mtable{border:1px solid #e5dccf;border-radius:12px;padding:8px;background:#fffdf9}
.mhead{display:none}
.mrow{display:grid;grid-template-columns:1fr 1fr 1fr 34px;gap:6px 8px;align-items:end;padding:8px 0;border-bottom:1px dashed #e3d8c8}
.mrow .mname{grid-column:1/-1}.mc{display:flex;flex-direction:column;gap:2px;margin:0}.mc input{margin:0;min-width:0}
.mlab{font-size:11px;color:#8a7a6a;font-weight:700}
.mt{display:block;min-height:44px;line-height:44px;padding:0 8px;border-radius:8px;background:#f3ece1;font-weight:800;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mrdel{margin:0;padding:10px 0;align-self:end;height:44px}
.mfoot{display:flex;justify-content:space-between;align-items:center;gap:8px;padding-top:8px}.mfoot .mradd{margin:0;flex:0 0 auto}
.mgt{font-size:14px}.mgt b{font-size:17px;color:#7a3b1d}
@media(min-width:620px){.mhead{display:grid;grid-template-columns:1fr 90px 120px 130px 34px;gap:8px;font-size:12px;font-weight:700;color:#6b5a48;padding:2px 0 6px}
 .mrow{grid-template-columns:1fr 90px 120px 130px 34px}.mrow .mname{grid-column:auto}.mlab{display:none}}
.sec.blbox .sech.bltitle{color:#1a7f37!important;font-weight:800}
/* order list card: client name + piece count (one unit) on the first line; city · phone on the second */
.cardhead .nameline{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px}
.cardhead .nameline .name{min-width:0;overflow-wrap:anywhere}
.qtybadge{display:inline-block;white-space:nowrap;unicode-bidi:isolate;direction:rtl;background:#f3ece1;border:1px solid #e3d8c8;color:#111;font-weight:800;font-size:12.5px;line-height:1;padding:4px 9px;border-radius:99px;flex:0 0 auto}
.cardhead .meta bdi{unicode-bidi:isolate}
.drvsaved{display:flex;align-items:center;gap:10px;margin:2px 0 6px;padding:7px 10px;border:1px solid #a7dfb8;background:#f0faf3;border-radius:10px}
.drvsaved .drvok{color:#1a7f37;font-weight:800;font-size:14px}.drvsaved .drvnum{font-weight:800;font-size:16px;color:#111}
input.driverin.locked{background:#f0faf3;border-color:#a7dfb8;color:#14532d;font-weight:700}
/* ---- salon model picker (new/edit order form): dropdown with thumbnails + photo under the field ---- */
.mcombo{position:relative;margin-bottom:6px}
.mcin{display:flex;gap:6px;align-items:stretch}
.mcin input{flex:1;min-width:0;margin:0}
.mcin .mdd{flex:0 0 46px;min-height:44px;border:1px solid #d8cbb8;border-radius:10px;background:#fff;font-size:18px;color:#5c3d1e;padding:0}
.mlist{position:absolute;z-index:30;inset-inline:0;top:100%;margin-top:4px;max-height:min(58vh,420px);overflow-y:auto;background:#fff;border:1px solid #cbbfae;border-radius:12px;box-shadow:0 10px 28px #0000002e;padding:4px}
.mlist[hidden]{display:none}
.mopt{display:flex;align-items:center;gap:10px;width:100%;text-align:start;background:none;border:0;border-bottom:1px solid #f0e8dc;padding:6px;min-height:56px;font:inherit;color:#2b2118;cursor:pointer;border-radius:8px}
.mopt[hidden]{display:none}.mopt:last-child{border-bottom:0}.mopt:active,.mopt:hover{background:#faf3e8}
.mopt img,.mopt .mph{width:44px;height:44px;border-radius:8px;flex:none;object-fit:cover;background:#f3ece1}
.mph{display:inline-flex;align-items:center;justify-content:center;font-size:20px;color:#b9a98f;border:1px dashed #d8cbb8;box-sizing:border-box}
.mot{display:flex;flex-direction:column;min-width:0}.mot b{direction:ltr;text-align:start;font-size:15px}.mot small{font-size:12px;color:#8a7a6a}
.mprev{display:flex;align-items:center;gap:10px;margin-top:8px}.mprev:empty{display:none}
.mthumb.mbig,.mbig.mnone{width:150px;height:150px;border-radius:12px;flex:none}
.mbig.mnone{display:inline-flex;align-items:center;justify-content:center;font-size:44px;color:#b9a98f;background:#f6f1ea;border:2px dashed #d8cbb8}
.mthumb.mbig img{object-fit:cover}
.mcap{font-size:14px;line-height:1.5;color:#2b2118}.mcap b{direction:ltr;unicode-bidi:isolate}.mcap small{color:#8a7a6a}

.provnote{background:#fff7e0;border:1px solid #f3d27a;color:#6b4e00;font-size:13px;line-height:1.7}
.tabs button{white-space:normal;line-height:1.25;overflow-wrap:anywhere}
.gtotal{margin:14px 0 6px;background:#fff7ec;border:2px solid #BD7C48;border-radius:12px;padding:12px 14px;text-align:center}.gtotal .gt-l{font-weight:800;color:#7a3b1d;font-size:15px}.gtotal .gt-v{font-size:26px;font-weight:900;color:#BD7C48;margin:2px 0}.gtotal .gt-d{line-height:1.6}
output.rugtot,output.qrugtot{display:block;padding:10px 12px;border:1px dashed #cdb6a1;border-radius:10px;background:#f7f1ea;font-weight:800;color:#7a3b1d;min-height:42px;box-sizing:border-box}
.qcf{margin:10px 0 6px;padding:10px 12px;border:1px solid #cfe8d6;background:#f4fbf6;border-radius:12px}
.qcf select,.qcf input{width:100%}
.qcf .qcotxt{margin-top:6px}
.qcf .qrel{background:#fffdf5}
.s-confirme{background:#16a34a}
.btns .s-confirme{color:#fff;border:0;border-radius:10px;padding:12px 8px;font:inherit;font-weight:700}
.btns button:disabled{opacity:.45}.btns .s-confirme:disabled.cur{opacity:1}
.btn.cfoam,button.cfoam{background:#16a34a;color:#fff}
.btns .cfoam{opacity:1}
.confline{margin-top:6px;font-size:12px;font-weight:700;border-radius:8px;padding:4px 10px;display:inline-block}
.confline.ok{background:#dcfce7;color:#166534;border:1px solid #86efac}
.confline.wait{background:#fff7e0;color:#92400e;border:1px solid #f3d27a}
.awaitconf{margin:8px 0;padding:8px 10px;border-radius:10px;background:#fff7e0;color:#92400e;border:1px solid #f3d27a;font-size:13px}
.fstep.confirm.done .sic,.fstep.confirm.cur .sic{color:#16a34a}
.fstep.confirm.cur .fstepbtn,.fstep.confirm.done .fstepbtn{border-color:#86efac;background:#f0fdf4}
.fstep .fconf[data-fa="cfab"]{background:#16a34a;color:#fff;border-color:#16a34a}
.fstep.locked{opacity:.5}
.btn.cfab,button.cfab{background:#16a34a;color:#fff}
/* 🃏 كارت 2D + leads */
.lcardimg{display:block;width:100%;max-width:420px;margin:8px auto;border-radius:10px;border:1px solid #e5e7eb;background:#fff}
.lprices{display:flex;gap:6px;flex-wrap:wrap;margin:6px 0}.lprices span{background:#f3ece4;border-radius:8px;padding:3px 9px;font-weight:700;font-size:13px;direction:ltr}
.lrh{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.lst{margin-inline-start:auto;border-radius:10px;padding:2px 10px;font-size:12px;font-weight:700;background:#e5e7eb}
.lst-sent{background:#dbeafe;color:#1e40af}.lst-chosen{background:#fef3c7;color:#92400e}.lst-reminded{background:#ede9fe;color:#5b21b6}.lst-reminded_eco{background:#d1fae5;color:#065f46;border:1px solid #6ee7b7}.ecotag{background:#16a34a;color:#fff;border-radius:10px;padding:2px 9px;font-size:12px;font-weight:800;white-space:nowrap}.ecobox summary{color:#166534}.lst-confirmed{background:#dcfce7;color:#166534}
.lbtns{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-top:6px}.lbtns .btn{flex:1 1 auto}.lbtns select{flex:0 0 auto}
.lhead{display:flex;justify-content:space-between;align-items:center;margin:12px 4px 6px}.lerr{background:#fde8e8;color:#991b1b;border-radius:8px;padding:8px 10px;margin:8px 0;font-weight:600}
.lres{margin-top:12px;border-top:1px dashed #d6c7b8;padding-top:8px}.cvt{width:100%;font-size:13px;margin:6px 0}.cvt td{padding:3px 6px;border-bottom:1px solid #eee}

/* admin list = compact rows (client, amount, pills, date, 👁 🗑) */
.crowcard .top{align-items:center}.crowcard .hr{flex-wrap:wrap;justify-content:flex-end;row-gap:4px;gap:6px;max-width:68%}
.camt{font-weight:800;font-size:14px;white-space:nowrap}.cdate{font-size:12px;color:#6b7280;white-space:nowrap}
.ibtn{border:0;background:#f3ece4;border-radius:8px;width:34px;height:34px;font-size:17px;padding:0;cursor:pointer;line-height:1}.ibtn.ctrash{background:#fde8e8}
.crowcard .pills{grid-template-columns:repeat(3,auto);justify-content:start;gap:4px;margin-top:6px}
.crowcard .pill{flex-direction:row;gap:4px;align-items:center;padding:2px 9px;border-radius:999px}.crowcard .pill small{font-size:10px}.crowcard .pill b{font-size:11.5px}
.adetbar{margin-bottom:8px}.dethead{margin-bottom:8px}
/* compact: ~2 lines per order */
.crowcard{padding:8px 10px;margin-bottom:8px}.crowcard .meta{display:none}.crowcard .top{gap:6px}
.crowcard .hr{max-width:none;flex-wrap:nowrap;gap:5px}.crowcard .name{font-size:15px}.crowcard .qtybadge{font-size:11px}
.crowcard .ibtn{width:30px;height:30px;font-size:15px}.crowcard .chev{display:none}.crowcard .badge.tbadge{display:none}
.crowcard .pills{display:flex;flex-wrap:wrap;gap:4px;margin-top:5px}.crowcard .pill small{display:none}
.crowcard .confline{display:inline-block;font-size:11px;padding:1px 7px;margin:4px 6px 0 0}
.sidectl{display:flex;align-items:center;justify-content:space-between;gap:8px;background:#dcfce7;border:1px solid #86efac;color:#166534;border-radius:10px;padding:8px 10px;margin:6px 0;font-weight:700}
.sidectl .btn{flex:0 0 auto;width:auto;padding:6px 12px;margin:0;background:#fff;color:#991b1b;border:1px solid #fca5a5}
.sidelab{display:inline-block;margin-top:2px;font-size:11px;font-weight:800;padding:1px 8px;border-radius:999px;background:#eef2ff;color:#3730a3}
.sidelab.sl-j{background:#f3e8ff;color:#6b21a8}.sidelab.sl-dj{background:#fff7e0;color:#92400e}
.fsub+.sidelab{margin-top:4px}
a.carlink{color:#1d4ed8;text-decoration:underline}
.fok.notdel{background:#f3f4f6;color:#374151;border:1px solid #d1d5db}
button.picked{background:#0b4a36;color:#fff;margin-top:8px}
.picked-at{margin-top:6px}

/* admin status panel: ONE compact block, aligned rows [stage pill | confirmation chip], identical pill style; palette = CSS variables */
:root{--sp-dol:#1d4ed8;--sp-jal:#0f766e;--sp-del:#6b7280;--sp-del-go:#4f6d8f;--sp-del-ok:#16a34a;--sp-del-ko:#c2410c;
 --sp-ok-bg:#dcfce7;--sp-ok-fg:#166534;--sp-ok-bd:#86efac;--sp-wait-bg:#fff;--sp-wait-fg:#92400e;--sp-wait-bd:#f59e0b;
 --sp-new:#f59e0b;--sp-new-bg:#fff7ed;--sp-new-fg:#b45309;--sp-line:#eadfce;--sp-h:26px}
.pill.pd{background:var(--sp-dol)!important}.pill.pj{background:var(--sp-jal)!important}
.pills.spanel{display:flex;flex-direction:column;gap:5px;margin-top:8px;padding:8px;background:#fbf8f3;border:1px solid var(--sp-line);border-radius:12px}
.spanel .srow{display:grid;grid-template-columns:minmax(0,1fr) 98px;gap:6px;align-items:center}
.spanel .srow:has(> .pill:only-child){grid-template-columns:minmax(0,1fr)}
.spanel .pill{flex-direction:row;gap:6px;align-items:center;justify-content:flex-start;min-height:var(--sp-h);padding:2px 10px;border-radius:999px;text-align:start;box-sizing:border-box}
.spanel .pill small{display:inline;font-size:10.5px;opacity:.85;white-space:nowrap}.spanel .pill b{font-size:11.5px;line-height:1.2;overflow-wrap:anywhere}
.spanel .pill.sp-del{background:var(--sp-del)}
.spanel .pill.sp-del.ds-encours{background:var(--sp-del-go)}.spanel .pill.sp-del.ds-livre{background:var(--sp-del-ok)}.spanel .pill.sp-del.ds-echec{background:var(--sp-del-ko)}
.spanel .confline.sc{margin:0;display:flex;align-items:center;justify-content:center;min-height:var(--sp-h);box-sizing:border-box;padding:2px 8px;border-radius:999px;font-size:11px;line-height:1.2;text-align:center}
.spanel .confline.ok{background:var(--sp-ok-bg);color:var(--sp-ok-fg);border:1px solid var(--sp-ok-bd)}
.spanel .confline.wait{background:var(--sp-wait-bg);color:var(--sp-wait-fg);border:1px dashed var(--sp-wait-bd)}
.spanel .srow.snote{display:block}.spanel .srow.snote:empty{display:none}
.spanel .nbadge{display:flex;align-items:center;gap:6px;margin:0;min-height:var(--sp-h);box-sizing:border-box;padding:2px 12px;border-radius:999px;font-size:12px;font-weight:800}
.spanel .nbadge small{font-size:10.5px;font-weight:700;opacity:.8}
.spanel .nbadge .ndot{width:9px;height:9px;border-radius:50%;flex:0 0 auto;background:var(--sp-new)}.spanel .nbadge.nb-ok .ndot{background:var(--sp-del-ok)}
.spanel .nbadge.nb-new{background:var(--sp-new-bg);color:var(--sp-new-fg);border:1px solid var(--sp-new)}
/* list rows: the same aligned rows, slightly tighter, full card width under the name line */
.crowcard .pills.spanel{gap:4px;padding:5px 6px;margin-top:6px}
.crowcard .spanel{--sp-h:22px}.crowcard .spanel .pill{padding:1px 10px}.crowcard .spanel .pill small{font-size:10px}.crowcard .spanel .pill b{font-size:11.5px}
.crowcard .spanel .confline.sc{font-size:10.5px;padding:1px 7px}.crowcard .spanel .nbadge{font-size:11px;padding:1px 10px}
button.fbtn.ghost{background:#fff;color:#991b1b;border:2px solid #fca5a5;min-height:48px;font-size:16px;margin-top:8px}

.tickthumb{display:block;max-width:100%;max-height:220px;margin:8px auto;border-radius:10px;border:1px solid #d9cfc4;background:#fff;object-fit:contain;cursor:pointer}
.tickpdf{padding:14px;text-align:center;font-weight:800;color:#6f4e37;background:#f7efe6}
.tick-at{margin:8px 0;padding:8px 10px;border-radius:10px;background:#ecfdf5;color:#065f46;font-weight:700;font-size:14px}

.delstate{border:2px solid #ccc;border-radius:12px;padding:8px 10px;margin:6px 0 10px;background:#fff}.delstate .dsrow{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:3px}.delstate .dpill{font-size:16px;padding:4px 14px}.delstate .dsat{font-weight:800}

.mbox{border:2px dashed #d9cfc4;border-radius:12px;padding:10px;margin:10px 0;background:#fffaf4}.msent{width:100%;box-sizing:border-box;font-size:16px;margin:6px 0}
.mgrid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.mcol-h{display:grid;grid-template-columns:1fr 1fr;gap:8px;text-align:center;font-weight:800;color:#6f4e37;margin-top:8px}.mcol{background:#fff;border:1px solid #e5ddd3;border-radius:10px;padding:6px;font-size:13px;min-width:0}.mimg{width:100%;height:auto;display:block;border-radius:6px;background:#f4efe9;min-height:60px}
.btn.qconfirm{background:#16a34a;color:#fff;border-color:#16a34a}
.btn.qconfirm:active{background:#15803d}
.btn.qconfwa[disabled]{opacity:.45}
.quotebox .qsec{border-top:1px dashed #d8cbb8;margin-top:10px;padding-top:8px}
.quotebox .qsec>.sech.small{font-weight:800;color:#6f4e37}
.quotebox .qcli{padding:2px 0 4px}
.quotebox .oilive{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:6px 0;padding:6px 10px;background:#f6efe5;border-radius:8px;font-size:13px}
.quotebox .oilive output{font-weight:800}
.quotebox .oilabel{width:100%;margin-bottom:4px}
.quotebox .qmodel{margin-bottom:6px}

/* header fits a 390px (and 360px) screen for every role: nothing wider than the viewport, nav labels wrap inside their pills */
header{max-width:100%;overflow-x:clip}
header .brand{min-width:0}
header .brand h1{overflow:hidden;text-overflow:ellipsis}
@media(max-width:420px){#hbar{gap:4px}#adminnav button{font-size:12px;padding:7px 8px}.swchip{font-size:12px}header #refresh{padding:0 4px}header button#logout{padding:6px 9px;font-size:12.5px;margin-inline-start:2px}}
/* client update over WhatsApp + payment proof */
.nbadge{display:inline-block;margin:4px 0 2px;padding:3px 10px;border-radius:99px;font-size:12px;font-weight:800}
.nbadge.nb-new{background:#fff1e0;color:#b45309;border:1px solid #f59e0b}
.nbadge.nb-ok{background:#e8f8ee;color:#166534;border:1px solid #86c99a}
.notifybox .natt-row{display:flex;align-items:center;gap:6px;margin:4px 0}
.notifybox pre.ntext{white-space:pre-wrap;word-break:break-word;font:inherit;font-size:12.5px;background:#faf6f0;border-radius:8px;padding:8px;margin:4px 0}
.notifybox .nh{border-top:1px dashed #d8cbb8;padding-top:4px;margin-top:4px}
.ppbox{border-top:1px dashed #d8cbb8;margin-top:10px;padding-top:8px}
.ppbox .ppthumb{display:block;max-width:100%;max-height:200px;border-radius:10px;border:1px solid #e5e7eb;margin:6px 0;cursor:pointer;background:#f3f4f6;min-height:60px}
.ppbox .ppdoc{display:block;width:100%;padding:18px;border-radius:10px;border:1px dashed #b9a58e;background:#faf6f0;font-weight:800;margin:6px 0}
.ppbox .pppick{flex-wrap:wrap;gap:6px}.ppbox .ppbtn{flex:1 1 90px;text-align:center;margin:0;padding:10px 6px;cursor:pointer}

/* installable app: left/right safe areas (landscape notch) + the «ثبت التطبيق» hint */
body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
#installhint{margin:8px 12px 0}
#installhint[hidden]{display:none}
.insthint-in{display:flex;gap:10px;align-items:flex-start;background:#fff8e6;border:1px solid #e3c98a;border-radius:12px;padding:9px 11px;font-size:13px;line-height:1.55;color:var(--txt)}
.insthint-in .insttxt{flex:1 1 auto;min-width:0}
.insthint-in .instgo{margin-top:6px;font:inherit;font-size:13px;font-weight:700;color:#fff;background:var(--brown);border:0;border-radius:99px;padding:7px 16px}
.insthint-in .instx{flex:0 0 auto;font:inherit;font-size:16px;line-height:1;border:0;background:transparent;color:#7a6a58;padding:2px 4px}

/* ---- global overflow safety (iPhone Safari): nothing may be wider than the screen ---- */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;max-width:100%;overflow-x:hidden}
body{max-width:100%;overflow-x:clip;overflow-wrap:break-word;overscroll-behavior-x:none}
img,svg,canvas,video{max-width:100%}
input,select,textarea{min-width:0;max-width:100%}
input[type=date],input[type=time],input[type=datetime-local],input[type=month],input[type=number],input[type=file]{-webkit-appearance:none;appearance:none;min-width:0;max-width:100%;width:100%;min-height:42px}
input[type=checkbox],input[type=radio]{width:auto;min-width:0}
select{text-overflow:ellipsis}
.card,.mbox,.mcmp,.quotebox,.notifybox{max-width:100%;min-width:0}
table{max-width:100%}
.hlogo{flex:0 0 auto}
/* flex / grid children may shrink below their content (default min-width:auto is what pushes cards off the screen) */
:where(.brand,.row,.line .head,.tabs,.top,.btns,.reste,.presets,.cardhead .hr,.pills,.pill,.sech,.tls,.delline,.ctabs,.pgh,.pcs,label.pc,.typeopt,.typeopt .opt,.oibox .oi,.dellog .dl,.chk.alsodevis,.d2,.d2-h,.d2-tiles,.d2-tile,.d2-note,.d2-banks,.d2-bank,.d2-cih .t,.d2-cih .ln,.d2-two,.d2-list,.d2-row,.d2-row .stg,.d2-alerts,.d2-alert .ah,.d2-alert .at,.d2-alert .al,.d2-alert .al>span,.d2-alert,.dashbanner,.exprow,.modrow,.mslot,.mpbox,.fhead,.fback,.psteps,.pnode,.pnode .pc,.fstep,.fstep .sic,.fstep .slb,.fstep .sind,label.ckrow,.cbx,details.fadd summary,.fl,.cars,label.car,.car .rd,label.tickzone,.fsum,.fsum>div,.fsum b,.dtiles,button.dtile,details.fmore>summary,.fbar>*,button.fbtn,.fstep>.fstepbtn,.bonbtn,.fp,.fp .fdot,.fp .fpn,.catchips,.catpick,.catpick .cpn,.ditem,.cth0,.oibox .oil,.trcard .trh,.rolebtns,.rolebtn,#hbar,#adminnav,#swrow,.blopts,label.blbtn,.ditem .dil,.qrows>div,.mrow,.mc,.mfoot,.mhead,.cardhead .nameline,.drvsaved,.mcin,.mopt,.mph,.mot,.mprev,.mbig.mnone,.lprices,.lrh,.lbtns,.lhead,.crowcard .pills,.sidectl,.pills.adm,.delstate .dsrow,.timeline .tlnow,.tllist li,.mgrid,.mcol-h,.quotebox .oilive,.notifybox .natt-row,.insthint-in)>*{min-width:0}
/* the order-type / option cards: wrap, and stack on phones (the 3 cards were cut off on the left) */
.typeopt{flex-wrap:wrap}
.typeopt .opt{flex:1 1 140px;min-width:0;overflow-wrap:anywhere}
@media(max-width:520px){.typeopt{flex-direction:column}.typeopt .opt{flex:0 0 auto;width:100%;justify-content:flex-start;text-align:start}}

/* saved 2D design versions */
.dvbox{margin:10px 0;padding:10px;border:1px solid var(--line);border-radius:12px;background:#fff}
.dvitem{display:flex;gap:10px;align-items:flex-start;margin-top:10px;padding:8px;border:2px solid #e5ddd3;border-radius:12px;background:#fffdf9}
.dvitem.on{border-color:#0f766e;background:#ecfdf5}
.dvimg{flex:0 0 112px;width:112px;height:112px;object-fit:contain;background:#f3ede4;border-radius:8px;border:1px solid #e5ddd3}
.dvinfo{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:3px;font-size:14px}
.dvon{display:inline-block;background:#0f766e;color:#fff;border-radius:99px;padding:1px 9px;font-size:12px;font-weight:700}
.dvtot{font-size:15px}
.dvpick{margin-top:6px}

#wafb{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(18px + env(safe-area-inset-bottom));z-index:9999;max-width:92vw;background:#1f6f43;color:#fff;border-radius:999px;padding:10px 16px;box-shadow:0 4px 14px rgba(0,0,0,.3);font-size:14px}
#wafb a{color:#fff;font-weight:700;text-decoration:underline}

.spin{display:flex;align-items:center;gap:10px;margin:10px 0;padding:10px 12px;border-radius:10px;background:#fbf7f1;border:1px solid #e3d5c0;color:#6b4a2b;font-weight:700}
.spinner{flex:0 0 auto;width:20px;height:20px;border-radius:50%;border:3px solid #e3d5c0;border-top-color:#8a5a2b;animation:dmspin .9s linear infinite}
@keyframes dmspin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.spinner{animation-duration:2.5s}}

.lnote{color:#92400e;background:#fffbeb;border-radius:8px;padding:2px 8px;margin:3px 0;line-height:1.5}

/* admin «مراحل البونج (Dolidol)»: same vertical timeline as the fabric box, Dolidol blue accent; مشكل red, RETOUR purple */
.dolprog{border-inline-start:4px solid #1d4ed8}.dolprog .sech{color:#1d4ed8}
.fp.bad .fdot{background:#dc2626;color:#fff}.fp.bad .fpn b{color:#b91c1c}
.fp.ret .fdot{background:#7e22ce;color:#fff}.fp.ret .fpn b{color:#6b21a8}
.fp.bad.cur .fdot{box-shadow:0 0 0 4px rgba(220,38,38,.2)}.fp.ret.cur .fdot{box-shadow:0 0 0 4px rgba(126,34,206,.2)}

/* 2D design thumbnail on confirmed orders (left side in RTL = last child) */
.detrow{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.detmain{min-width:0;flex:1}
.dthumb{object-fit:cover;background:#f3f4f6;border:1px solid #e5e7eb;border-radius:8px;cursor:pointer;flex:0 0 auto;display:block}
.dthumb-lg{width:84px;height:84px;object-fit:contain;background:#fff}
.dthumb-sm{width:34px;height:34px;border-radius:6px}
.dfull{position:fixed;inset:0;z-index:9999;background:#000d;display:flex;align-items:center;justify-content:center;padding:12px}
.dfull img{max-width:100%;max-height:100%;object-fit:contain;background:#fff;border-radius:8px}
.dfull .dfx{position:absolute;top:10px;left:10px;width:40px;height:40px;border-radius:50%;border:0;background:#fff;font-size:18px}

/* quote-option chip next to / under the design thumbnail */
.dside{display:flex;flex-direction:column;align-items:center;gap:4px;flex:0 0 auto;max-width:42%}
.mchips{display:flex;flex-wrap:wrap;gap:4px;justify-content:center}.mchips:empty{display:none}
.mchips.mrow{justify-content:flex-end;margin-top:4px}
.mchip{display:inline-block;font-size:11px;font-weight:700;line-height:1.3;padding:2px 8px;border-radius:999px;background:#efe6d8;color:#5b3a1e;border:1px solid #d9c9b0;white-space:normal;text-align:center}
.mchip.mecho{background:#dcfce7;color:#166534;border-color:#86efac}

/* fabric / Dolidol: design thumbnail + chip row */
.drow{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:2px 0 10px;padding:8px;background:#fff;border:1px solid var(--line);border-radius:12px}
.drow .mchips{justify-content:flex-start;flex:1}
.rpbox{margin-top:10px}.rpbox .rph{font-weight:800;margin-bottom:6px}.rpbox.adm{border-top:1px dashed #d8cbb8;padding-top:8px}
.rpgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:6px 0}.rpt{position:relative;border-radius:10px;overflow:hidden;background:#f3f4f6;border:1px solid #e5e7eb}
.rpt .rpimg{display:block;width:100%;aspect-ratio:1;object-fit:cover;cursor:pointer;min-height:60px}.rpt .rptm{position:absolute;bottom:0;left:0;right:0;font-size:10px;text-align:center;color:#fff;background:#0009;padding:1px 0}
.rpt .rpdel{position:absolute;top:3px;right:3px;width:26px;height:26px;border-radius:50%;border:0;background:#000a;color:#fff;font-size:14px;line-height:26px;padding:0;cursor:pointer}
.rppick{flex-wrap:wrap;gap:6px}.rppick .rpbtn{flex:1 1 120px;text-align:center;margin:0;padding:12px 6px;cursor:pointer}
.rpov{position:fixed;inset:0;z-index:9999;background:#000e;display:flex;align-items:center;justify-content:center}.rpov img{max-width:100%;max-height:100%;object-fit:contain}
.rpov .rpclose{position:absolute;top:12px;left:12px;width:40px;height:40px;border-radius:50%;border:0;background:#fff3;color:#fff;font-size:20px}

/* admin order page: action buttons tidy at phone width (same height / radius, the Bon link looks like the other buttons) */
.fulldetail .cardbody button.btn.full,.fulldetail .cardbody a.btn.full{min-height:48px;box-sizing:border-box;line-height:1.3}
.bonbtn a.btn{display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:48px;padding:10px 14px;border-radius:10px;background:#efe6d8;font-weight:600}
.bonbtn .bondl{white-space:nowrap}
/* carrier parcel creation («إنشاء الرامساج») */
.cpbox{margin-top:12px;padding:12px;border:1px solid #d9c9b8;border-radius:12px;background:#fffaf4}.cpbox input{font-size:16px}.cpbox .sech{margin-bottom:6px}
.cpdone{margin-top:10px}.cpdone .fok{margin-bottom:6px}.cpdone .btn{margin-top:8px}

/* ---- «التوصيل» board + bulk ramassage + tracking box (admin) ---- */
.shstrip{display:flex;flex-wrap:wrap;gap:6px;align-items:center;width:100%;margin:0 0 10px;padding:10px;border:1px solid #e3e6ec;border-radius:12px;background:#fff;font:inherit;text-align:right;cursor:pointer}
.shchip{font-size:12px;padding:3px 8px;border-radius:999px;background:#f1f3f7;color:#374151;white-space:nowrap}
.shchip.g-livre{background:#e3f6e8;color:#166534}.shchip.g-retour,.shchip.g-echec{background:#fde8e8;color:#991b1b}.shchip.g-post{background:#fff3d6;color:#92400e}.shchip.g-route{background:#e0ebff;color:#1d4ed8}
.shgrp{background:#fff;border:1px solid #e3e6ec;border-radius:12px;margin:0 0 10px;overflow:hidden}
.shhead{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px;border:0;background:#f7f8fb;font:inherit;font-weight:700;cursor:pointer;text-align:right}
.shcount{background:#111827;color:#fff;border-radius:999px;min-width:26px;padding:1px 8px;text-align:center;font-size:13px}
.shrow{display:flex;align-items:stretch;border-top:1px solid #eef0f4}
.shchk{display:flex;align-items:center;justify-content:center;padding:0 12px;min-width:44px;cursor:pointer}
.shchk input{width:22px;height:22px}
.shmain{flex:1;display:flex;flex-direction:column;gap:2px;padding:10px 12px;border:0;background:none;font:inherit;text-align:right;cursor:pointer;min-width:0;overflow-wrap:anywhere}
.shbadge{display:inline-block;font-size:12px;padding:2px 8px;border-radius:999px;margin-inline-start:6px;vertical-align:middle}
.shbadge.ok{background:#e3f6e8;color:#166534}.shbadge.no{background:#fff3d6;color:#92400e}
.shempty{padding:10px 12px}
.shbulk,.shalerts{margin-bottom:10px}
.shal{display:block;width:100%;padding:8px 0;border:0;border-top:1px solid #eef0f4;background:none;font:inherit;text-align:right;cursor:pointer}
.shprow{border-top:1px solid #eef0f4;padding:8px 0}
.shprow.skip{color:#6b7280}.shprow.okr{background:#f0faf3}.shprow.bad{background:#fff6f6}
.shph{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.shprow input{width:100%;box-sizing:border-box}
.trkbox{margin-top:10px;padding:10px;border:1px solid #cfe3d4;background:#f4fbf6;border-radius:12px}
.trkbig{font-size:20px;font-weight:700;letter-spacing:.5px;direction:ltr;text-align:center;margin:4px 0 8px;overflow-wrap:anywhere}
.trkbox .row{gap:8px}.trklink{margin-top:8px;display:block;text-align:center;text-decoration:none}
.cphint{padding:8px 0}

/* ---- several parcels per order ---- */
.pclist{margin-top:10px}.pclist .trkbox{margin-top:8px}
.pclh{margin:0 0 4px}.pcsum{padding:2px 2px 0}
.pstat{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:2px 0 6px;justify-content:center}
.pclist .cpdone{margin-top:8px}
.cpsum{margin-top:6px}
.cpcount{max-width:90px}
.pclist.ro .trkbox{background:#fafafa;border-color:#e3e6ec}

/* confirmed-model photo right next to the 2D design thumbnail (order page, list cards, Majalis / Dolidol pages) */
.dtpair{display:inline-flex;align-items:center;gap:6px;flex:0 0 auto}
.mthumb.mt2{padding:0;border:1px solid #e5e7eb;border-radius:8px;background:#fff;overflow:hidden;flex:0 0 auto;display:block}
.mthumb.mt2 img{width:100%;height:100%;object-fit:cover;display:block}
.mt2-lg{width:84px;height:84px}.mt2-sm{width:34px;height:34px;border-radius:6px}
.dside{max-width:64%}

/* «منتجات أخرى في الدوفي المأكد»: product photo column (catalogue items only) */
.xprod td.pimgc{width:44px;padding:4px}.pthumb{width:40px;height:40px;object-fit:cover;border-radius:6px;border:1px solid #e5e7eb;background:#f3f4f6;cursor:zoom-in;display:block}
.tlbox .tlurl{direction:ltr;text-align:left;background:#faf6f0;border-radius:8px;padding:6px 8px;margin:6px 0;overflow-wrap:anywhere;user-select:all}
.tlbox .tlrow{display:flex;gap:8px;flex-wrap:wrap}.tlbox .tlrow .btn{flex:1 1 140px;min-width:0}
