:root{--ink:#12233B;--navy:#1C355E;--accent:#F37021;--accent-ink:#B04A0B;--paper:#F3F5F8;--surface:#FFFFFF;--line:#DCE2EA;--muted:#5F6B7A;--ok:#1E8E5A;--bad:#B93A32;--warn:#A8690A;--r:8px}
*{box-sizing:border-box;margin:0;padding:0}
html{font-size:15px}
body{font-family:'IBM Plex Sans Arabic',Tahoma,sans-serif;background:var(--paper);color:var(--ink);line-height:1.7;min-height:100vh}
a{color:var(--navy)}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}
h1{font-size:1.6rem;font-weight:700;line-height:1.3}
h2{font-size:1.05rem;font-weight:700}
small,.muted{color:var(--muted);font-size:.86rem}
.num{font-variant-numeric:tabular-nums;direction:ltr;unicode-bidi:isolate;display:inline-block}

/* الشريط الجانبي */
.side{position:fixed;inset-block:0;inset-inline-start:0;width:248px;background:var(--ink);color:#fff;display:flex;flex-direction:column;padding:22px 16px;gap:18px;z-index:20}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:#fff;padding-bottom:18px;border-bottom:1px solid rgba(255,255,255,.12)}
.brand-mark{width:42px;height:42px;border-radius:50%;background:#fff;color:var(--navy);display:grid;place-items:center;font-weight:700;font-size:1.25rem;border:3px solid var(--accent);font-family:Georgia,serif}
.brand-text b{display:block;font-size:.92rem;letter-spacing:.2px;direction:ltr;text-align:right}
.brand-text small{color:rgba(255,255,255,.6)}
.side nav{display:flex;flex-direction:column;gap:2px}
.side nav a{color:rgba(255,255,255,.75);text-decoration:none;padding:10px 12px;border-radius:var(--r);font-weight:500;border-inline-start:3px solid transparent}
.side nav a:hover{background:rgba(255,255,255,.07);color:#fff}
.side nav a.on{background:rgba(255,255,255,.1);color:#fff;border-inline-start-color:var(--accent)}
.side-new{text-align:center}
.side-user{margin-top:auto;border-top:1px solid rgba(255,255,255,.12);padding-top:14px;display:flex;flex-direction:column}
.side-user small{color:rgba(255,255,255,.55)}
.side-user a{color:rgba(255,255,255,.75);font-size:.86rem;margin-top:6px}
.main{margin-inline-start:248px;padding:28px 32px 60px;max-width:1280px}
.main-bare{min-height:100vh;display:grid;place-items:center;padding:20px}

/* عناصر عامة */
.head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:22px}
.head p{color:var(--muted)}
.btn{display:inline-block;border:1px solid var(--line);background:var(--surface);color:var(--ink);font:inherit;font-weight:600;padding:8px 16px;border-radius:var(--r);cursor:pointer;text-decoration:none;line-height:1.5}
.btn:hover{border-color:var(--navy)}
.btn-accent{background:var(--accent);border-color:var(--accent);color:#fff}
.btn-accent:hover{background:#DD5F12;border-color:#DD5F12}
.btn-navy{background:var(--navy);border-color:var(--navy);color:#fff}
.btn-sm{padding:4px 10px;font-size:.84rem}
.btn-danger{color:var(--bad)}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);margin-bottom:20px}
.panel>header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 18px;border-bottom:1px solid var(--line)}
.panel-body{padding:18px}
.flash{padding:12px 16px;border-radius:var(--r);margin-bottom:18px;font-weight:600;border:1px solid}
.flash-ok{background:#EAF6EF;border-color:#BFE3CF;color:#17623F}
.flash-err{background:#FBECEA;border-color:#F0C4BF;color:#8E2A23}
.empty{padding:28px 18px;color:var(--muted);text-align:center}
.tag{display:inline-block;padding:1px 10px;border-radius:99px;font-size:.8rem;font-weight:600;background:#EEF1F5;color:var(--navy);white-space:nowrap}
.tag-won,.tag-approved,.tag-done{background:#E3F3EA;color:var(--ok)}
.tag-lost,.tag-declined,.tag-cancelled,.tag-not_interested{background:#FBE9E7;color:var(--bad)}
.tag-quote,.tag-interested{background:#FFF0E5;color:var(--accent-ink)}
.tag-needs_time,.tag-shopping,.tag-no_answer,.tag-scheduled{background:#FCF3DF;color:var(--warn)}
.due-late{color:var(--bad);font-weight:700}.due-today{color:var(--accent-ink);font-weight:700}.due-soon{color:var(--navy);font-weight:600}

/* مسار العميل — العنصر المميز: محطات على خط واحد مثل خط سير الشحنة */
.route{list-style:none;display:flex;position:relative;margin:6px 0}
.route li{flex:1;position:relative;text-align:center;padding-top:26px;font-size:.86rem;color:var(--muted);font-weight:500}
.route li::before{content:'';position:absolute;top:8px;inset-inline:0;height:3px;background:var(--line)}
.route li:first-child::before{inset-inline-start:50%}
.route li:last-child::before{inset-inline-end:50%}
.route li i{position:absolute;top:1px;left:50%;transform:translateX(-50%);width:17px;height:17px;border-radius:50%;background:var(--surface);border:3px solid var(--line);z-index:1}
.route li.done{color:var(--navy)}
.route li.done::before{background:var(--navy)}
.route li.done i{background:var(--navy);border-color:var(--navy)}
.route li.here{color:var(--ink);font-weight:700}
.route li.here::before{background:linear-gradient(to left,var(--navy) 50%,var(--line) 50%)}
.route li.here:first-child::before{background:var(--line)}
.route li.here i{background:var(--accent);border-color:var(--accent);box-shadow:0 0 0 5px rgba(243,112,33,.2)}
.route-lost li.here i{background:var(--bad);border-color:var(--bad);box-shadow:none}
.route li.here:last-child::before{background:var(--navy)}
.route-won li.here i{background:var(--ok);border-color:var(--ok);box-shadow:0 0 0 5px rgba(30,142,90,.18)}
.route-counts li{padding-top:0;padding-bottom:30px}
.route-counts li::before{top:auto;bottom:9px}
.route-counts li i{top:auto;bottom:2px;border-color:var(--navy);background:var(--surface)}
.route-counts li:last-child i{background:var(--ok);border-color:var(--ok)}
.route-counts a{text-decoration:none;display:block;padding:4px 6px 10px;border-radius:var(--r)}
.route-counts a:hover{background:var(--paper)}
.route-counts b{display:block;font-size:2.4rem;font-weight:700;color:var(--ink);line-height:1.15;font-variant-numeric:tabular-nums}
.route-counts span{color:var(--muted);font-size:.9rem}

/* شريط الأرقام */
.figures{display:grid;grid-template-columns:repeat(4,1fr);border:1px solid var(--line);border-radius:var(--r);background:var(--surface);margin-bottom:20px}
.figures div{padding:16px 18px;border-inline-start:1px solid var(--line)}
.figures div:first-child{border-inline-start:0}
.figures b{display:block;font-size:1.45rem;font-weight:700;line-height:1.3}
.figures b span{display:block}
.list li>small.num{white-space:nowrap}
.cols{display:grid;grid-template-columns:1.25fr 1fr;gap:20px;align-items:start}

/* جداول وقوائم */
table{width:100%;border-collapse:collapse}
th{text-align:start;font-size:.84rem;color:var(--muted);font-weight:600;padding:10px 14px;border-bottom:1px solid var(--line);white-space:nowrap}
td{padding:11px 14px;border-bottom:1px solid #EDF0F4;vertical-align:top}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover td{background:#FAFBFC}
td a.strong{font-weight:700;text-decoration:none}
td a.strong:hover{text-decoration:underline}
.scroll{overflow-x:auto}
.list{list-style:none}
.list li{display:flex;gap:12px;justify-content:space-between;align-items:baseline;padding:11px 18px;border-bottom:1px solid #EDF0F4}
.list li:last-child{border-bottom:0}
.list a{font-weight:600;text-decoration:none}
.filters{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:16px}
.filters input,.filters select{width:auto;min-width:150px}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:var(--r);overflow:hidden;background:var(--surface)}
.seg a{padding:7px 14px;text-decoration:none;font-weight:600;color:var(--muted)}
.seg a.on{background:var(--navy);color:#fff}

/* لوحة المراحل */
.board{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(230px,1fr);gap:14px;overflow-x:auto;padding-bottom:10px}
.board section{background:#E9EDF2;border-radius:var(--r);padding:10px;min-height:120px}
.board h2{display:flex;justify-content:space-between;padding:4px 6px 10px;font-size:.92rem}
.card{display:block;background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:10px 12px;margin-bottom:8px;text-decoration:none;color:var(--ink)}
.card:hover{border-color:var(--navy)}
.card b{display:block}

/* النماذج */
label{display:block;font-weight:600;font-size:.9rem;margin-bottom:4px}
input,select,textarea{width:100%;font:inherit;color:var(--ink);background:var(--surface);border:1px solid #C5CDD8;border-radius:6px;padding:8px 11px}
input:focus,select:focus,textarea:focus{border-color:var(--navy);outline:2px solid rgba(28,53,94,.15)}
textarea{resize:vertical;min-height:84px}
input[type=radio],input[type=checkbox]{width:auto}
.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px 18px}
.grid .full{grid-column:1/-1}
.field-hint{color:var(--muted);font-size:.82rem;margin-top:3px}
fieldset{border:0;margin-bottom:6px}
legend{font-weight:700;font-size:1.02rem;padding-bottom:10px;margin-bottom:14px;border-bottom:2px solid var(--navy);width:100%}
.choices{display:flex;flex-wrap:wrap;gap:8px}
.choices label{display:flex;align-items:center;gap:7px;border:1px solid #C5CDD8;border-radius:6px;padding:7px 13px;margin:0;font-weight:500;cursor:pointer;background:var(--surface)}
.choices label:has(input:checked){border-color:var(--navy);background:#EEF2F8;font-weight:700}
.actions{display:flex;gap:10px;margin-top:18px;flex-wrap:wrap}
.when{display:none;margin-top:14px}
.when.show{display:block}

/* صفحة العميل */
.lead-top{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:20px 22px 14px;margin-bottom:20px}
.lead-top .head{margin-bottom:14px}
.next{display:flex;gap:10px;align-items:center;flex-wrap:wrap;border-top:1px solid var(--line);margin-top:14px;padding-top:12px}
.dl{display:grid;grid-template-columns:auto 1fr;gap:6px 16px}
.dl dt{color:var(--muted);font-size:.88rem;white-space:nowrap}
.dl dd{font-weight:500;overflow-wrap:anywhere}
details.composer{border:1px solid var(--line);border-radius:var(--r);background:var(--surface);margin-bottom:10px}
details.composer>summary{cursor:pointer;padding:11px 16px;font-weight:700;list-style:none;display:flex;justify-content:space-between;align-items:center}
details.composer>summary::-webkit-details-marker{display:none}
details.composer>summary::after{content:'+';font-size:1.3rem;color:var(--accent);line-height:1}
details.composer[open]>summary{border-bottom:1px solid var(--line)}
details.composer[open]>summary::after{content:'−'}
details.composer>form{padding:16px}
.entry{padding:14px 18px;border-bottom:1px solid #EDF0F4}
.entry:last-child{border-bottom:0}
.entry-head{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;align-items:baseline;margin-bottom:4px}
.entry p{white-space:pre-line}
.entry details{margin-top:10px}
.entry details summary{cursor:pointer;color:var(--navy);font-weight:600;font-size:.9rem}
.entry details form{margin-top:12px;padding:14px;background:var(--paper);border-radius:var(--r)}
.files{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.file{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:6px;padding:5px 10px;text-decoration:none;background:var(--surface);max-width:100%}
.file:hover{border-color:var(--navy)}
.file-ext{background:var(--navy);color:#fff;font-size:.68rem;font-weight:700;border-radius:3px;padding:1px 5px;direction:ltr}
.file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:230px;font-weight:500}
.file-size{color:var(--muted);font-size:.78rem}
.timeline{list-style:none;padding:8px 18px}
.timeline li{position:relative;padding:8px 22px 8px 0;border-inline-start:0}
.timeline li::before{content:'';position:absolute;inset-inline-start:4px;top:16px;width:9px;height:9px;border-radius:50%;background:var(--navy)}
.timeline li::after{content:'';position:absolute;inset-inline-start:8px;top:26px;bottom:-8px;width:1px;background:var(--line)}
.timeline li:last-child::after{display:none}

/* الدخول */
.login{width:min(400px,100%);background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:32px 28px;border-top:5px solid var(--accent)}
.login .brand{color:var(--ink);border-bottom-color:var(--line);margin-bottom:22px}
.login .brand-text small{color:var(--muted)}
.login label{margin-top:14px}
.login .btn{width:100%;margin-top:22px;padding:11px}

@media (max-width:980px){
  .side{position:static;width:auto;flex-direction:row;flex-wrap:wrap;align-items:center;padding:12px 16px;gap:10px}
  .brand{border:0;padding:0}.side nav{flex-direction:row;flex-wrap:wrap}.side-user{margin:0;border:0;padding:0;margin-inline-start:auto}.side-user small{display:none}
  .main{margin:0;padding:18px 14px 50px}
  .cols,.grid{grid-template-columns:1fr}
  .figures{grid-template-columns:repeat(2,1fr)}.figures div:nth-child(3){border-inline-start:0}.figures div:nth-child(n+3){border-top:1px solid var(--line)}
  .route-counts b{font-size:1.6rem}.route li{font-size:.76rem}
}
@media (prefers-reduced-motion:no-preference){.route li.here i{animation:pulse 1.6s ease-out 1}}
@keyframes pulse{from{box-shadow:0 0 0 0 rgba(243,112,33,.55)}to{box-shadow:0 0 0 5px rgba(243,112,33,.2)}}
@media print{.side,.composer,.actions,.filters{display:none}.main{margin:0}}

/* ═══ v2: شاشة الدخول ═══ */
.main-bare:has(.auth){display:block;padding:0;min-height:100vh;width:100%}
.auth{width:100%;min-height:100vh;display:grid;grid-template-columns:minmax(420px,42%) 1fr;background:var(--surface)}
.auth-form{display:flex;flex-direction:column;justify-content:center;padding:56px clamp(28px,5vw,72px);max-width:520px;width:100%;margin-inline:auto}
.auth-brand{display:flex;align-items:center;gap:12px;margin-bottom:52px}
.auth-brand .brand-text b{color:var(--ink);font-size:1rem}
.auth-brand .brand-text small{color:var(--muted)}
.auth-form h1{font-size:2rem;margin-bottom:6px}
.auth-lead{color:var(--muted);margin-bottom:26px}
.auth-form label{margin-top:16px}
.auth-form input{padding:12px 14px;font-size:1rem;background:#F7F9FB;border-color:#CFD6E0}
.auth-form input:focus{background:#fff}
.pw{position:relative}
.pw input{padding-inline-end:72px}
.pw-toggle{position:absolute;inset-block:6px;inset-inline-end:6px;border:0;background:transparent;color:var(--navy);font:inherit;font-size:.85rem;font-weight:600;padding:0 10px;cursor:pointer;border-radius:6px}
.pw-toggle:hover{background:#EEF2F8}
.auth-submit{margin-top:28px;padding:13px;font-size:1.05rem;width:100%}
.auth-submit:hover{background:var(--ink)}
.auth-foot{margin-top:18px;color:var(--muted);font-size:.86rem}
.auth-art{position:relative;overflow:hidden;background:var(--ink);color:#fff;display:flex;align-items:center;justify-content:center;padding:60px clamp(32px,6vw,96px)}
.auth-art::before{content:'';position:absolute;inset:0;background-image:radial-gradient(rgba(255,255,255,.07) 1px,transparent 1.2px);background-size:22px 22px}
.auth-art-in{position:relative;z-index:1;width:min(560px,100%)}
.auth-motto{font-size:clamp(1.6rem,2.8vw,2.7rem);font-weight:700;line-height:1.5;margin-bottom:56px}
.auth-route{list-style:none;position:relative;padding-inline-start:34px}
.auth-route::before{content:'';position:absolute;inset-inline-start:9px;top:12px;bottom:12px;border-inline-start:3px dashed rgba(255,255,255,.28)}
.auth-route li{position:relative;padding:13px 0;font-size:1.2rem;color:rgba(255,255,255,.78)}
.auth-route li i{position:absolute;inset-inline-start:-34px;top:50%;transform:translateY(-50%);width:21px;height:21px;border-radius:50%;background:var(--ink);border:3px solid rgba(255,255,255,.55);z-index:1}
.auth-route li:last-child{color:#fff;font-weight:700}
.auth-route li:last-child i{background:var(--accent);border-color:var(--accent);box-shadow:0 0 0 7px rgba(243,112,33,.22)}
.auth-art-foot{margin-top:56px;color:rgba(255,255,255,.45);font-size:.82rem;direction:ltr;text-align:right}
@media (prefers-reduced-motion:no-preference){.auth-route li i{animation:stop .5s ease-out both;animation-delay:calc(var(--i) * 120ms + 150ms)}@keyframes stop{from{transform:translateY(-50%) scale(.3);opacity:0}to{transform:translateY(-50%) scale(1);opacity:1}}}
@media (max-width:900px){.auth{grid-template-columns:1fr}.auth-art{display:none}.auth-form{padding:40px 22px}}

/* ═══ v2: لوحة المتابعة بعرض الصفحة ═══ */
.main:has(.dash){max-width:none;padding:30px 36px 56px}
.dash-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;flex-wrap:wrap;margin-bottom:26px}
.dash-date{color:var(--muted);font-weight:500;margin-bottom:2px}
.dash-head h1{font-size:2rem}
.dash-sub{margin-top:6px;color:var(--muted)}
.alert-chip{display:inline-block;background:#FBECEA;color:var(--bad);font-weight:700;border-radius:99px;padding:3px 14px;text-decoration:none;border:1px solid #F0C4BF}
.alert-chip:hover{background:#F8DEDA}
.dash-actions{display:flex;gap:10px}
.dash-actions .btn{padding:10px 20px}

/* المسار: العنصر الأبرز في الصفحة — خط سير الشحنة بعرض كامل */
.journey{background:var(--ink);color:#fff;border-radius:12px;padding:22px 30px 30px;margin-bottom:22px;position:relative;overflow:hidden}
.journey::before{content:'';position:absolute;inset:0;background-image:radial-gradient(rgba(255,255,255,.06) 1px,transparent 1.2px);background-size:22px 22px;pointer-events:none}
.journey>header{position:relative;display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap;margin-bottom:18px}
.journey>header small{color:rgba(255,255,255,.6)}
.journey-route{position:relative;list-style:none;display:grid;grid-template-columns:repeat(5,1fr)}
.journey-route li{position:relative;text-align:center;padding-bottom:30px}
.journey-route li::before{content:'';position:absolute;bottom:10px;inset-inline:0;height:3px;background:rgba(255,255,255,.18)}
.journey-route li:first-child::before{inset-inline-start:50%}
.journey-route li:last-child::before{inset-inline-end:50%}
.journey-route li.has::before{background:rgba(255,255,255,.35)}
.journey-route li>i{position:absolute;bottom:2px;left:50%;transform:translateX(-50%);width:19px;height:19px;border-radius:50%;background:var(--ink);border:3px solid rgba(255,255,255,.4);z-index:1}
.journey-route li.has>i{border-color:#fff}
.journey-route li.st-won>i{background:var(--ok);border-color:var(--ok)}
.journey-route li.st-quote.has>i{background:var(--accent);border-color:var(--accent);box-shadow:0 0 0 6px rgba(243,112,33,.22)}
.journey-route a{display:inline-block;color:#fff;text-decoration:none;padding:6px 18px 12px;border-radius:10px}
.journey-route a:hover{background:rgba(255,255,255,.08)}
.journey-route b{display:block;font-size:clamp(2.2rem,3.6vw,3.2rem);font-weight:700;line-height:1.1}
.journey-route li:not(.has) b{color:rgba(255,255,255,.4)}
.journey-route a span{color:rgba(255,255,255,.75);font-size:.95rem}
.journey-route em{position:absolute;bottom:-1px;inset-inline-start:-14px;transform:translateX(50%);font-style:normal;font-size:.74rem;font-weight:600;color:rgba(255,255,255,.85);background:var(--navy);border:1px solid rgba(255,255,255,.2);border-radius:99px;padding:0 8px;z-index:2;white-space:nowrap}
[dir=rtl] .journey-route em{transform:translateX(-50%)}

.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:0;background:var(--surface);border:1px solid var(--line);border-radius:12px;margin-bottom:22px}
.kpis>div{padding:18px 22px;border-inline-start:1px solid var(--line);display:flex;flex-direction:column;gap:2px;min-width:0}
.kpis>div:first-child{border-inline-start:0}
.kpis small{font-weight:600}
.kpis b{font-size:2rem;font-weight:700;line-height:1.2;text-align:right}
.kpis span{color:var(--muted);font-size:.86rem;overflow-wrap:anywhere}
.kpis .kpi-bad b{color:var(--bad)}

.dash-grid{display:grid;grid-template-columns:1.35fr 1fr .8fr;gap:22px;align-items:start}
.dash-grid .panel{margin:0;border-radius:12px}
.agenda{list-style:none}
.agenda li{display:grid;grid-template-columns:92px 1fr auto;gap:14px;align-items:center;padding:12px 18px;border-bottom:1px solid #EDF0F4;border-inline-start:4px solid transparent}
.agenda li:last-child{border-bottom:0}
.agenda .ag-late{border-inline-start-color:var(--bad);background:#FDF6F5}
.agenda .ag-today{border-inline-start-color:var(--accent)}
.ag-when b{display:block;font-size:.9rem}
.ag-late .ag-when b{color:var(--bad)}.ag-today .ag-when b{color:var(--accent-ink)}.ag-soon .ag-when b{color:var(--navy)}
.ag-when small{display:block;font-size:.8rem}
.ag-who a{font-weight:700;text-decoration:none;display:block}
.ag-who small{display:block}
.feed{list-style:none;padding:6px 18px 10px}
.feed li{position:relative;padding:10px 0 10px;padding-inline-start:22px;border-bottom:1px solid #EDF0F4}
.feed li:last-child{border-bottom:0}
.feed li::before{content:'';position:absolute;inset-inline-start:2px;top:18px;width:9px;height:9px;border-radius:50%;background:var(--navy)}
.feed a{font-weight:700;text-decoration:none}
.feed p{font-size:.92rem}
.feed small{font-size:.78rem}
.bars{list-style:none;padding:10px 18px 16px}
.bars li{display:grid;grid-template-columns:1fr auto;gap:2px 10px;padding:9px 0}
.bars li i{grid-column:1/-1;display:block;height:8px;border-radius:4px;background:#E7ECF2;position:relative;overflow:hidden}
.bars li i::after{content:'';position:absolute;inset-block:0;inset-inline-start:0;width:var(--w);background:var(--navy);border-radius:4px}
.bars b{font-size:1rem}
@media (max-width:1300px){.dash-grid{grid-template-columns:1fr 1fr}.dash-grid .panel:first-child{grid-column:1/-1}}
@media (max-width:980px){.main:has(.dash){padding:18px 14px 50px}.dash-grid,.kpis{grid-template-columns:1fr 1fr}.kpis>div:nth-child(3){border-inline-start:0}.kpis>div:nth-child(n+3){border-top:1px solid var(--line)}.dash-grid .panel:first-child{grid-column:1/-1}.journey{padding:18px 12px 24px}.journey-route a{padding:4px 4px 10px}.journey-route a span{font-size:.76rem}}
@media (max-width:620px){.dash-grid,.kpis{grid-template-columns:1fr}.kpis>div{border-inline-start:0;border-top:1px solid var(--line)}.kpis>div:first-child{border-top:0}.agenda li{grid-template-columns:78px 1fr}.agenda .tag{display:none}.journey-route em{display:none}}

/* ═══ v3: الخطوط والقراءة — Readex Pro للنصوص، Noto Kufi Arabic للعناوين والأرقام ═══ */
:root{--muted:#4E5A6A;--kufi:'Noto Kufi Arabic','Readex Pro',Tahoma,sans-serif}
html{font-size:16.5px}
body{font-family:'Readex Pro','Noto Kufi Arabic',Tahoma,sans-serif;line-height:1.75;letter-spacing:0;-webkit-font-smoothing:antialiased}
h1,h2,legend,.btn,.side nav a,.tag,.journey-route b,.kpis b,.route-counts b,.figures b,.alert-chip,.auth-motto,.auth-route li,.agenda .ag-when b{font-family:var(--kufi)}
h1{font-size:2.05rem;font-weight:800;letter-spacing:-.2px}
h2{font-size:1.18rem;font-weight:700}
small,.muted{font-size:.9rem}
.btn{font-weight:700;padding:9px 18px}
.btn-sm{font-size:.86rem;padding:5px 12px}
.tag{font-size:.82rem;font-weight:600;padding:2px 12px}
/* الشريط الجانبي */
.side{width:268px}
.main{margin-inline-start:268px}
.brand-text b{font-size:1rem}
.side nav{gap:4px}
.side nav a{font-size:1.04rem;font-weight:600;padding:12px 14px}
.side-new{font-size:1rem;padding:11px}
.side-user b{font-size:1.02rem}
/* اللوحة */
.dash-date{font-size:1rem}
.dash-head h1{font-size:2.5rem}
.dash-sub{font-size:1.05rem}
.alert-chip{font-size:.98rem;padding:5px 16px}
.dash-actions .btn{font-size:1rem;padding:11px 22px}
.journey{padding:26px 34px 34px}
.journey>header h2{font-size:1.3rem}
.journey>header small{font-size:.95rem;color:rgba(255,255,255,.72)}
.journey-route b{font-size:clamp(2.6rem,4vw,3.8rem);font-weight:800}
.journey-route a span{font-size:1.08rem;font-weight:500;color:rgba(255,255,255,.88)}
.journey-route em{font-size:.82rem;padding:1px 10px}
.kpis>div{padding:20px 24px}
.kpis small{font-size:1rem;color:var(--ink);font-weight:600}
.kpis b{font-size:2.6rem;font-weight:800}
.kpis span{font-size:.95rem}
.panel>header{padding:16px 20px}
.agenda li{padding:14px 20px;grid-template-columns:110px 1fr auto}
.ag-when b{font-size:1rem}
.ag-when small{font-size:.86rem}
.ag-who a{font-size:1.08rem}
.ag-who small{font-size:.92rem}
.feed{padding:6px 20px 12px}
.feed li{padding:12px 0;padding-inline-start:24px}
.feed a{font-size:1.06rem}
.feed p{font-size:1rem;color:#24344B}
.feed small{font-size:.85rem}
.bars{padding:12px 20px 18px}
.bars li span{font-size:1.02rem}
.bars b{font-family:var(--kufi);font-size:1.1rem}
.empty{font-size:1rem}
/* الدخول */
.auth-form h1{font-size:2.5rem}
.auth-lead{font-size:1.05rem}
.auth-form label{font-size:.98rem}
.auth-form input{font-size:1.08rem;padding:13px 15px}
.auth-submit{font-size:1.12rem}
.auth-motto{font-weight:800;line-height:1.55}
.auth-route li{font-size:1.25rem}
/* باقي الصفحات تستفيد تلقائياً من الخط الجديد والحجم الأكبر */
td{font-size:.98rem}
th{font-size:.9rem}
@media (max-width:980px){.side{width:auto}.main{margin:0}.dash-head h1{font-size:1.9rem}.journey-route b{font-size:2rem}.journey-route a span{font-size:.82rem}.kpis b{font-size:2rem}}

/* ═══ WHO_V1: شريط المستخدم الحالي + «بواسطة» ═══ */
.topbar{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 16px;margin-bottom:22px;box-shadow:0 1px 2px rgba(18,35,59,.04)}
.tb-user{display:flex;align-items:center;gap:12px;min-width:0}
.tb-av{width:44px;height:44px;border-radius:50%;background:var(--navy);color:#fff;display:grid;place-items:center;font-family:var(--kufi);font-weight:800;font-size:1.2rem;border:3px solid var(--accent);flex:none}
.tb-who{display:flex;flex-direction:column;line-height:1.35;min-width:0}
.tb-who small{font-size:.8rem}
.tb-who b{font-family:var(--kufi);font-size:1.15rem;font-weight:800;color:var(--ink);overflow-wrap:anywhere}
.tb-role{font-family:var(--kufi);font-size:.8rem;font-weight:700;color:var(--accent-ink);background:#FDEBDD;border-radius:999px;padding:2px 12px}
.tb-end{display:flex;align-items:center;gap:12px}
.tb-date{color:var(--muted);font-size:.92rem}
.by{display:inline-block;font-size:.84rem;color:var(--navy);background:#EAF0F8;border-radius:999px;padding:0 10px;margin-inline-start:4px;white-space:nowrap}
.by b{font-weight:700}
.entry-by{margin:2px 0 6px}
.card-by{display:block;font-size:.8rem;color:var(--navy)}
@media (max-width:620px){.tb-date{display:none}.topbar{padding:8px 12px}.tb-av{width:38px;height:38px;font-size:1rem}}
@media print{.topbar{display:none}}

/* ═══ QREQ_V1: طلبات عروض الأسعار من قسم التسعير ═══ */
.qreq{border-top:3px solid #7c3aed}
.qreq-new>summary{color:#5b21b6}
.qreq-item{border-inline-start:4px solid #ddd6fe}
.qreq-ref{background:#ede9fe;color:#5b21b6;border-radius:6px;padding:0 8px;font-size:.82rem;margin-inline-start:6px}
.qreq-meta{font-size:.92rem}
.qreq-acts{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;align-items:flex-start}
.qreq-acts>form{margin:0}
.qreq-acts details{margin:0}
.qreq-acts details>summary{list-style:none}
.qreq-acts details>summary::-webkit-details-marker{display:none}
.qreq-acts details[open]{flex-basis:100%}
.qoffer{margin-top:12px;border:1px solid #DDD6FE;border-radius:var(--r);padding:12px 14px;background:#FAF8FF}
.qoffer-approved{border-color:#86EFAC;background:#F0FDF4}
.qoffer-rejected{border-color:#FECACA;background:#FEF7F7}
.qoffer-amt{font-family:var(--kufi);font-weight:800;font-size:1.08rem;color:#5b21b6}
.qoffer-res{margin-top:8px;border-radius:var(--r);padding:8px 12px;font-weight:600}
.qoffer-res.ok{background:#DCFCE7;color:#166534}
.qoffer-res.bad{background:#FEE2E2;color:#991B1B}

/* ═══ QREQ_V2: واجهة مبسّطة لعروض التسعير ═══ */
.qreq>header{gap:10px}
.qcard{padding:16px 18px;border-bottom:1px solid #EDF0F4;border-inline-start:4px solid #DDD6FE}
.qcard:last-child{border-bottom:0}
.qcard-act{border-inline-start-color:var(--accent);background:#FFFBF7}
.qcard-ok{border-inline-start-color:var(--ok)}.qcard-bad{border-inline-start-color:#CBD5E1}.qcard-wait{border-inline-start-color:#7c3aed}
.qcard-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.qcard-head>div>b{font-family:var(--kufi);font-size:1.08rem;display:block}
.qcard-head small{display:block;margin-top:2px}
.qcard-head>div{flex:1;min-width:0}.qcard-head .by{font-size:.76rem;padding:0 8px;vertical-align:middle}
.qsteps{list-style:none;display:flex;margin:14px 0 6px}
.qsteps li{flex:1;position:relative;text-align:center;padding-top:22px;font-size:.8rem;color:var(--muted)}
.qsteps li::before{content:'';position:absolute;top:7px;inset-inline:0;height:3px;background:var(--line)}
.qsteps li:first-child::before{inset-inline-start:50%}.qsteps li:last-child::before{inset-inline-end:50%}
.qsteps li i{position:absolute;top:0;inset-inline-start:calc(50% - 8px);width:16px;height:16px;border-radius:50%;background:#fff;border:3px solid var(--line);z-index:1}
.qsteps li.done i{background:var(--navy);border-color:var(--navy)}.qsteps li.done::before{background:var(--navy)}
.qsteps li.here i{background:var(--accent);border-color:var(--accent)}.qsteps li.here{color:var(--ink);font-weight:700}
.qsteps li.bad i{background:var(--bad);border-color:var(--bad)}
.qnow{margin-top:8px;font-weight:700;border-radius:var(--r);padding:8px 12px;background:#F1F5F9}
.qnow-act{background:#FFF1E6;color:var(--accent-ink)}.qnow-ok{background:#DCFCE7;color:#166534}.qnow-bad{background:#F1F5F9;color:#475569}.qnow-wait{background:#F5F3FF;color:#5B21B6}
.qoffer-box{margin-top:12px;border:2px solid var(--accent);border-radius:12px;padding:14px 16px;background:#fff}
.qoffer-line{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;align-items:baseline}
.qoffer-line b{font-family:var(--kufi);font-size:1.25rem;color:var(--navy)}
.qask{font-family:var(--kufi);font-weight:800;font-size:1.1rem;margin-top:14px;text-align:center}
.qbtns{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:10px}.qbtns form{margin:0}
.qbtn-ok{background:var(--ok);border-color:var(--ok);color:#fff;font-size:1.05rem;padding:12px 30px}
.qbtn-no{background:#fff;border-color:var(--bad);color:var(--bad);font-size:1.05rem;padding:12px 30px}
.qreject{margin-top:14px;background:var(--paper);border-radius:var(--r);padding:14px}
.qresult{margin-top:12px;border-radius:12px;padding:12px 16px;border:1.5px solid #86EFAC;background:#F0FDF4}
.qresult-bad{border-color:#E2E8F0;background:#F8FAFC}
.qsmall{font-size:.88rem;color:var(--muted);margin-top:6px}
.qmore{margin-top:10px}.qmore summary{cursor:pointer;color:var(--navy);font-weight:600;font-size:.9rem}
.qmore p{margin-top:8px}.qaddf{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.qold{margin-top:8px;font-size:.88rem;color:var(--muted)}
.qnew{max-width:760px}.qnew-intro{background:#F5F3FF;color:#5B21B6;border-radius:var(--r);padding:10px 14px;font-weight:600;margin-bottom:18px}
.qnew-step{display:flex;gap:14px;margin-bottom:18px}.qnew-step>span{flex:none;width:32px;height:32px;border-radius:50%;background:var(--navy);color:#fff;display:grid;place-items:center;font-family:var(--kufi);font-weight:800}
.qnew-step>div{flex:1}.qnew-send{font-size:1.05rem;padding:12px 30px}
.qalert{display:block;margin:0 0 18px;background:#FFF1E6;border:2px solid var(--accent);color:var(--accent-ink);border-radius:12px;padding:12px 18px;font-weight:700;text-decoration:none;font-size:1.02rem}

/* ═══ QREQ_V3: ملف العميل + اختيار العميل في طلب التسعير ═══ */
.file-tag{display:inline-block;color:var(--accent-ink);font-weight:700;font-size:.85rem;margin-bottom:2px}
.fileacts{display:flex;gap:8px;flex-wrap:wrap;margin:-6px 0 18px}
.fileacts a{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:9px 16px;font-family:var(--kufi);font-weight:700;font-size:.92rem;color:var(--navy);text-decoration:none}
.fileacts a:hover{border-color:var(--navy)}
.fileacts a.fa-main{background:var(--accent);border-color:var(--accent);color:#fff}
.side-new2{background:transparent;border:1px solid rgba(255,255,255,.3);color:#fff;margin-top:-8px}
.row-acts{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap}.row-acts .btn{font-size:.78rem;padding:4px 10px}
.qmode{display:flex;gap:8px;margin-bottom:6px}.qmode label{flex:1;display:flex;align-items:center;justify-content:center;gap:8px;border:1.5px solid #C5CDD8;border-radius:10px;padding:11px;font-weight:700;cursor:pointer;margin:0}
.qmode label:has(input:checked){border-color:var(--navy);background:#EEF2F8}
#qcs{margin-top:10px}
.qclients{max-height:300px;overflow-y:auto;border:1px solid var(--line);border-radius:10px;margin-top:8px}
.qclient{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 14px;border-bottom:1px solid #EDF0F4;cursor:pointer;margin:0;font-weight:500}
.qclient:last-child{border-bottom:0}.qclient:hover{background:#F8FAFC}
.qclient:has(input:checked){background:#EEF2F8;box-shadow:inset 3px 0 0 var(--navy)}
.qclient small{flex-basis:100%;margin-inline-start:26px;margin-top:-4px}
.qclient-fixed{background:#EEF2F8;border-radius:10px;padding:10px 14px}

/* ═══ QREQ_V4: رقم الطلب + ملف الطلب وسجلّه ═══ */
.qno{display:inline-block;background:var(--navy);color:#fff;border-radius:6px;padding:1px 10px;font-size:.78rem;font-weight:700;margin-bottom:4px;font-family:var(--kufi)}
.qcard-foot{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px}
.qcard-foot span{color:var(--muted);font-size:.86rem}
.qtl{list-style:none;padding:8px 20px 16px}
.qtl li{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid #EDF0F4;position:relative}
.qtl li:last-child{border-bottom:0}
.qtl-i{flex:none;width:34px;height:34px;border-radius:50%;background:#F1F5F9;display:grid;place-items:center;font-size:1rem}
.qtl li p{font-weight:600}
.qtl-offer .qtl-i{background:#FFF1E6}.qtl-ok .qtl-i{background:#DCFCE7}.qtl-bad .qtl-i{background:#FEE2E2}
.qtl-ok p{color:#166534}.qtl-bad p{color:#991B1B}

/* ═══ LEAD_CARD_V1: بطاقة ملف زبون ═══ */
.lcard fieldset{margin-bottom:22px;padding:16px 18px 18px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.lcard legend{display:flex;align-items:center;gap:10px;border:0;padding:0 6px;margin:0;width:auto;font-size:1rem;color:var(--navy)}
.lcard legend small{font-weight:500;color:var(--muted);font-size:.8rem;font-family:inherit}
.lc-n{width:26px;height:26px;border-radius:50%;background:var(--navy);color:#fff;display:inline-grid;place-items:center;font-size:.82rem}
.grid.g3{grid-template-columns:repeat(3,1fr)}
.lc-co label{min-width:0}.lc-co label:has(input:checked){border-color:var(--accent);background:#FFF1E6;color:var(--accent-ink)}
.lc-sv label{padding:8px 14px}
.lc-save{font-size:1.02rem;padding:11px 28px}
.lc-panel header{gap:10px}
.lc-card{display:grid;grid-template-columns:1fr;gap:12px}
.lc-g{border:1px solid #EDF0F4;border-radius:10px;padding:10px 12px;background:#FBFCFE}
.lc-g h3{font-size:.86rem;font-weight:800;color:var(--navy);margin:0 0 6px;font-family:var(--kufi)}
.lc-i{display:flex;justify-content:space-between;gap:10px;padding:4px 0;border-bottom:1px dashed #EDF0F4;font-size:.88rem}
.lc-i:last-child{border-bottom:0}.lc-i>span{color:var(--muted);flex:none}.lc-i b{font-weight:700;text-align:left;word-break:break-word}
.lc-empty{color:var(--muted);font-size:.84rem;margin:0}
.lc-chips{display:flex;flex-wrap:wrap;gap:6px}.lc-chip{background:#EEF2F8;color:var(--navy);border-radius:20px;padding:3px 11px;font-size:.8rem;font-weight:700}
.lc-co-b{display:inline-block;border-radius:6px;padding:1px 10px;font-weight:800;color:#fff;background:var(--navy)}
.lc-co-prime{background:#F37021}.lc-co-easyline{background:#1d4ed8}.lc-co-draxon{background:#1a3a6c}.lc-co-all{background:#0f766e}
.lc-miss{color:#B91C1C;font-weight:800}
@media(max-width:980px){.grid.g3{grid-template-columns:repeat(2,1fr)}}
@media(max-width:640px){.grid.g3{grid-template-columns:1fr}}

/* ═══ LEAD_CARD_V2: وضع «شراء بضاعة» + ملفات البضاعة ═══ */
.lcard .lc-buy,.lcard .lc-buy-tag{display:none}
.lcard.lc-mode-buy .lc-buy{display:block}.lcard.lc-mode-buy .lc-buy-tag{display:inline}
.lcard.lc-mode-buy .lc-ship,.lcard.lc-mode-buy #lc-src{display:none}
.lc-buy-tag{color:var(--accent-ink)!important;font-weight:700!important}
.lc-fchip{display:flex;align-items:center;gap:8px;background:#F8FAFC;border:1px solid var(--line);border-radius:8px;padding:6px 10px;margin:6px 0;font-size:.86rem}
.lc-fchip.new{background:#FFFBF5;border-style:dashed}
.lc-fchip b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600;direction:ltr;text-align:right}
.lc-fchip a,.lc-fchip button{flex:none;font-family:inherit;font-size:.78rem;font-weight:700;border-radius:6px;padding:3px 10px;cursor:pointer;text-decoration:none;border:0}
.lc-fchip a{background:#E0F2FE;color:#075985}.lc-fchip button{background:#FEE2E2;color:#B91C1C}
.lc-fl{margin-top:8px}.lc-fl>span{display:block;color:var(--muted);font-size:.84rem;margin-bottom:4px}
.lc-thumbs{display:flex;flex-wrap:wrap;gap:8px}
.lc-th{display:flex;flex-direction:column;align-items:center;gap:3px;width:92px;text-decoration:none;color:inherit}
.lc-th img,.lc-th span{width:92px;height:70px;border-radius:8px;border:1px solid var(--line);object-fit:cover;display:grid;place-items:center;font-size:1.8rem;background:#fff}
.lc-th small{font-size:.7rem;color:var(--muted);max-width:92px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:ltr}
