@font-face { font-family: Plex; src: url(/admin/vendor/plex-400.woff2) format('woff2'); font-weight: 400; }
@font-face { font-family: Plex; src: url(/admin/vendor/plex-500.woff2) format('woff2'); font-weight: 500; }
@font-face { font-family: Plex; src: url(/admin/vendor/plex-700.woff2) format('woff2'); font-weight: 700; }
:root {
  --bg: #f3f5f4; --card: #fff; --ink: #14201b; --muted: #5f6b66; --line: #dfe5e2; --brand: #0b3d2e; --brand2: #13664b; --accent: #e8a317;
  --ok: #1d7a46; --okbg: #e3f4ea; --warn: #9a6400; --warnbg: #fff4dc; --bad: #b42318; --badbg: #fde8e6; --info: #1d4f91; --infobg: #e5eefb; --gray: #eef1f0;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Plex, "IBM Plex Sans Arabic", "Geeza Pro", Tahoma, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.55; }
a { color: var(--brand2); }
.top { display: flex; align-items: center; gap: 24px; background: var(--brand); color: #fff; padding: 10px 22px; position: sticky; top: 0; z-index: 10; }
.brand b { font-size: 17px; } .brand span { display: block; font-size: 11.5px; opacity: .75; }
#nav { display: flex; gap: 4px; flex: 1; } #nav a { color: #d8ebe3; text-decoration: none; padding: 6px 12px; border-radius: 6px; }
#nav a.on, #nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
#who { font-size: 12.5px; display: flex; gap: 10px; align-items: center; } #who .role { background: var(--accent); color: #1b1300; padding: 1px 8px; border-radius: 99px; font-weight: 700; }
#who button { background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; }
main { padding: 18px 22px 60px; max-width: 1680px; margin: 0 auto; }
h1 { font-size: 21px; margin: 0 0 4px; } h2 { font-size: 15.5px; margin: 0 0 10px; } h3 { font-size: 13.5px; margin: 12px 0 6px; }
.muted { color: var(--muted); } .pad { padding: 20px; } .small { font-size: 12px; } .ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.split { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.pagehead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; } .pagehead .sp { flex: 1; }
button, .btn { font: inherit; font-size: 13px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 6px 12px; border-radius: 7px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button.pri, .btn.pri { background: var(--brand2); border-color: var(--brand2); color: #fff; } button.warn { background: var(--accent); border-color: var(--accent); color: #1b1300; }
button.danger { color: var(--bad); border-color: #f1b8b2; } button:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; background: #fff; color: var(--ink); max-width: 100%; }
input:disabled, select:disabled, textarea:disabled { background: #f6f7f7; color: #6b7570; }
textarea { width: 100%; min-height: 70px; } label.f { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; } label.f > * { display: block; margin-top: 3px; width: 100%; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; } .t th { text-align: right; font-weight: 500; color: var(--muted); font-size: 12px; background: #f7f9f8; border-bottom: 1px solid var(--line); padding: 7px 8px; position: sticky; top: 0; }
.t td { border-bottom: 1px solid var(--line); padding: 6px 8px; vertical-align: top; } .t tr:hover td { background: #fafcfb; } .t .n { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t tr.click { cursor: pointer; } .t input { width: 100%; min-width: 50px; } .t input.num { width: 78px; text-align: left; direction: ltr; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 500; background: var(--gray); color: var(--ink); white-space: nowrap; }
.pill.ok { background: var(--okbg); color: var(--ok); } .pill.warn { background: var(--warnbg); color: var(--warn); } .pill.bad { background: var(--badbg); color: var(--bad); } .pill.info { background: var(--infobg); color: var(--info); }
.pill.st-new { background: #e5eefb; color: #1d4f91; } .pill.st-review, .pill.st-ready_for_pricing { background: #efe7fb; color: #5b2aa0; } .pill.st-needs_info { background: var(--warnbg); color: var(--warn); }
.pill.st-quote_sent, .pill.st-negotiation, .pill.st-po { background: #e1f3f6; color: #0d6070; } .pill.st-won { background: var(--okbg); color: var(--ok); } .pill.st-lost { background: var(--badbg); color: var(--bad); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; } .chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 3px 11px; font-size: 12px; cursor: pointer; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); } .chip b { margin-inline-start: 4px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13px; } .kv > div:nth-child(odd) { color: var(--muted); }
.note { white-space: pre-wrap; background: #fbfbf7; border: 1px solid #eee7cf; border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.banner { border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; font-size: 13px; } .banner.warn { background: var(--warnbg); color: #6b4600; border: 1px solid #f2d99b; }
.banner.info { background: var(--infobg); color: #183f73; border: 1px solid #c7d8f3; } .banner.bad { background: var(--badbg); color: #7d1810; border: 1px solid #f3c3bd; }
.banner.label { background: #fff; border: 2px dashed var(--accent); color: #6b4600; font-weight: 700; font-size: 14.5px; text-align: center; }
.conf { display: inline-flex; align-items: center; gap: 6px; } .conf i { width: 46px; height: 6px; background: #e8ecea; border-radius: 4px; overflow: hidden; display: inline-block; }
.conf i b { display: block; height: 100%; } .conf.hi i b { background: #2a9d62; } .conf.mid i b { background: #e8a317; } .conf.lo i b { background: #d64535; }
.unres { display: flex; flex-direction: column; gap: 3px; } .unres span { background: var(--badbg); color: #8a1c12; border-radius: 5px; padding: 1px 6px; font-size: 11.5px; }
.unres span.w { background: var(--warnbg); color: #7a5000; }
tr.r-verified td { background: #f1faf4; } tr.r-unknown td:first-child { box-shadow: inset -3px 0 0 #d64535; } tr.r-needs_info td:first-child { box-shadow: inset -3px 0 0 #e8a317; }
tr.r-alternative td:first-child { box-shadow: inset -3px 0 0 #1d4f91; } tr.r-verified td:first-child { box-shadow: inset -3px 0 0 #2a9d62; } tr.excluded td { opacity: .45; text-decoration: line-through; }
.viewer { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; background: #525659; border-radius: 10px; padding: 10px; }
.viewer canvas, .viewer img { display: block; width: 100%; background: #fff; margin-bottom: 10px; border-radius: 3px; }
.viewer .grid { background: #fff; border-radius: 6px; overflow: auto; } .viewer pre { background: #fff; padding: 12px; border-radius: 6px; white-space: pre-wrap; font-family: inherit; margin: 0; }
.grid table { border-collapse: collapse; font-size: 12px; } .grid td, .grid th { border: 1px solid #d6dbd9; padding: 3px 6px; white-space: nowrap; } .grid th { background: #eef1f0; font-weight: 500; color: #666; }
.grid tr.hdr td { background: #fff4dc; font-weight: 700; }
.tot { width: 100%; font-size: 13.5px; } .tot td { padding: 5px 0; border-bottom: 1px dashed var(--line); } .tot td:last-child { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; }
.tot tr.g td { font-weight: 700; font-size: 16px; border-bottom: 0; color: var(--brand); } .tot tr.c td { color: #5b2aa0; }
.flags li { margin-bottom: 5px; } .flags { padding-inline-start: 18px; margin: 0; }
.sev-high { color: var(--bad); } .sev-medium { color: var(--warn); } .sev-low { color: var(--info); }
tr.lowm td { background: #fff7f5; } .hidden-cost { color: #9aa3a0; font-size: 11.5px; }
.diff h3 { display: flex; gap: 8px; align-items: center; } .diff .add { color: var(--ok); } .diff .rem { color: var(--bad); } .diff .chg { color: var(--warn); }
.del { text-decoration: line-through; color: #a33; } .ins { color: #186a3b; font-weight: 500; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 12.5px; max-height: 420px; overflow: auto; } .timeline li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.timeline .when { color: var(--muted); font-size: 11.5px; } .timeline .who { font-weight: 500; }
svg.layout { width: 100%; height: auto; background: #fbfcfb; border: 1px solid var(--line); border-radius: 8px; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #1d2a25; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13px; z-index: 50; }
#toast.err { background: #8a1c12; }
.login { max-width: 360px; margin: 60px auto; }
.tag-demo { background: #fff0c2; color: #6b4600; border: 1px dashed #d9a400; padding: 0 7px; border-radius: 4px; font-size: 11px; font-weight: 700; }
@media print { .top, button, .noprint { display: none !important; } }
@media (max-width: 1100px) { .split, .grid2, .grid3 { grid-template-columns: 1fr; } .viewer { position: static; } }

.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
div.ltr { text-align: right; display: block; }
.unres span { overflow-wrap: anywhere; }
#bt td { padding: 6px 6px; } #bt input[data-f=description] { min-width: 180px; }

/* ===== بوابة المدير: مكتب المبيعات ===== */
.cards7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-size: 26px; line-height: 1.1; color: var(--brand); font-variant-numeric: tabular-nums; } .kpi span { font-size: 12.5px; color: var(--muted); }
.kpi:hover { border-color: var(--brand2); box-shadow: 0 2px 8px rgba(11,61,46,.08); }
.banner.ok { background: var(--okbg); color: var(--ok); } .banner.bad { background: var(--badbg); color: var(--bad); }
.sendbar { border-inline-start: 4px solid var(--accent); } .sendbar label.small { display: inline-flex; gap: 6px; align-items: center; }
.modal { position: fixed; inset: 0; background: rgba(10,20,16,.45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh; }
.modal-box { background: #fff; border-radius: 12px; width: min(640px, 94vw); padding: 14px 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.pp-list { max-height: 55vh; overflow: auto; } .pp-item { padding: 8px 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.pp-item.on, .pp-item:hover { background: #eef6f2; border-color: #cfe5da; }
.tl2 li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
tr.lowm td { background: #fff7e6 !important; }
.pill.st-qualified, .pill.st-opportunity { background: #e6f2ff; color: #1d4f91; } .pill.st-quote { background: #e1f3f6; color: #0d6070; } .pill.st-disqualified { background: var(--badbg); color: var(--bad); }
@media (max-width: 1100px) { .cards7 { grid-template-columns: repeat(4, minmax(0, 1fr)); } #nav { flex-wrap: wrap; } }
@media (max-width: 700px) { .cards7 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid2, .grid3, .split { grid-template-columns: 1fr !important; } .top { flex-wrap: wrap; } main { padding: 12px; } }
/* منع الفيض الأفقي في الشبكات (RTL): المحتوى الطويل يلتف داخل العمود */
.grid2 > *, .grid3 > *, .split > *, .row > .grow { min-width: 0; }
.tl2 li, .timeline li { overflow-wrap: anywhere; }
.card { min-width: 0; overflow-wrap: anywhere; }
