:root { --navy: #123A5A; --teal: #2E7D6E; --gold: #D4A017; --bg: #F5F7FA; --ink: #333; --mut: #5B6576; --line: #E3E8EF; }
* { box-sizing: border-box; }
body { margin: 0; font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.grow { flex: 1; }
.ltr { direction: ltr; text-align: right; }

.btn { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid #CBD4E0; background: #fff; color: var(--navy); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.pri { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.red { background: #C0392B; border-color: #C0392B; color: #fff; }
.btn.big { min-height: 48px; font-size: 15px; }
input[type=text], input[type=password], input[type=search], input[type=date], select { min-height: 44px; padding: 0 12px; border: 1px solid #CBD4E0; border-radius: 10px; background: #fff; width: 100%; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px; background: var(--c); }
.note { padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 13px; }
.note.g { background: #E3F2EE; color: #1F5E52; } .note.y { background: #FBF1D6; color: #6E5100; } .note.r { background: #FBE7E6; color: #9B2C24; }
.pill { padding: 8px 12px; border-radius: 99px; background: var(--teal); color: #fff; font-size: 13px; font-weight: 600; }
.pill.warn { background: #8A6A00; } .pill.off { background: #9B2C24; }

/* الرأس */
header { background: var(--navy); color: #fff; border-bottom: 4px solid var(--gold); }
.wrap { max-width: 1400px; margin: 0 auto; padding: 14px 24px; }
.hd { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.hd h1 { margin: 0; font-size: 22px; } .hd small { color: #F2D27A; font-weight: 600; font-size: 12px; }
.hd-end { display: flex; gap: 8px; align-items: center; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.1); flex-wrap: wrap; }
.seg button { min-height: 44px; border: 0; border-radius: 9px; padding: 0 14px; background: transparent; color: #fff; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.seg button.on { background: #fff; color: var(--navy); }
.seg i { font-style: normal; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: rgba(0,0,0,.12); }

/* المؤشرات والفلاتر */
main { display: flex; flex-direction: column; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 12px 16px; } .kpi b { display: block; font-size: 26px; color: var(--navy); } .kpi span { font-size: 13px; color: #4A5565; }
.progress { padding: 12px 16px; display: flex; gap: 14px; align-items: center; color: var(--navy); }
.progress #pct { color: var(--teal); font-size: 18px; }
.bar { height: 12px; border-radius: 99px; background: #E9EDF2; flex: 1; } .bar div { height: 100%; border-radius: 99px; background: var(--teal); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--line); align-items: flex-end; flex-wrap: wrap; }
.tabs > b { padding: 0 0 12px; color: #4A5565; font-size: 13px; }
.tabs button { min-height: 44px; border: 0; background: none; border-bottom: 3px solid transparent; font-weight: 600; color: #4A5565; padding: 0 14px; }
.tabs button.on { border-color: var(--gold); color: var(--navy); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.chip { min-height: 40px; border-radius: 99px; border: 1px solid #CBD4E0; background: #fff; padding: 0 12px; font-weight: 600; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip i { font-style: normal; padding: 1px 6px; border-radius: 99px; background: rgba(127,127,127,.15); font-size: 12px; }
.search { display: flex; gap: 10px; align-items: center; padding: 0 16px 14px; } .search span { white-space: nowrap; color: var(--mut); }

/* القوائم المنبثقة والنوافذ */
.menu { position: fixed; z-index: 50; width: 260px; background: #fff; border: 1px solid #D5DCE6; border-radius: 12px; box-shadow: 0 14px 34px rgba(18,58,90,.2); padding: 6px; }
.menu button { width: 100%; min-height: 44px; border: 0; background: none; border-radius: 8px; display: flex; align-items: center; gap: 10px; padding: 0 10px; text-align: right; }
.menu button:hover, .menu button.on { background: #F0F5F9; }
.menu label { display: flex; gap: 10px; align-items: center; min-height: 40px; padding: 0 8px; }
.menu > b { display: block; padding: 6px 8px; }
.menu.wide { width: min(380px, 92vw); }
.menu.wide input { margin-bottom: 6px; }
.menu i { font-style: normal; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: #EEF1F5; color: #4A5565; }
.loc-list { max-height: min(50vh, 420px); overflow-y: auto; border-top: 1px solid #EEF1F5; margin-top: 4px; padding-top: 4px; }
.loc-btn span { font-size: 11px; opacity: .8; }
.chips .hint { color: var(--mut); font-size: 13px; align-self: center; }
dialog { border: 0; border-radius: 18px; padding: 0; width: min(640px, 100%); max-height: 94vh; }
dialog::backdrop { background: rgba(8,22,36,.72); }
.dh { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 2; }
.db { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.row-in { display: flex; gap: 8px; }
.recent { display: flex; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid #F0F3F7; } .recent span { flex: 1; color: var(--mut); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 12px; background: var(--bg); border-radius: 12px; }
.fields small { display: block; color: var(--mut); font-size: 11px; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sgrid button { min-height: 54px; border-radius: 12px; border: 2px solid var(--line); background: #fff; display: flex; gap: 8px; align-items: center; padding: 0 12px; font-weight: 700; text-align: right; }
.sgrid button.on { background: var(--bg-c); border-color: var(--c); color: var(--fg-c); }
.asset-title { font-size: 17px; color: var(--navy); }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 99; font-weight: 600; }

@media (max-width: 1023px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 699px) {
  .wrap { padding: 12px; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dialog { max-height: 100vh; border-radius: 18px 18px 0 0; margin-bottom: 0; }
}
}
.recent em { font-style: normal; font-weight: 600; color: var(--fg-c); display: flex; align-items: center; }

/* ———— التنقل بين الصفحات ———— */
.seg a, .seg span.on { min-height: 44px; display: flex; align-items: center; padding: 0 14px; border-radius: 9px; color: #fff; font-weight: 700; text-decoration: none; }
.seg span.on { background: #fff; color: var(--navy); }

/* ———— صفحة مشروع الحوكمة ———— */
.p-info { padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.p-info h2 { margin: 2px 0; font-size: 20px; color: var(--navy); }
.p-code { color: var(--teal); font-weight: 700; }
.p-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: #4A5565; }
#pBody { display: flex; flex-direction: column; gap: 14px; }
.p-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.p-kpi { text-align: right; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.p-kpi.on { border-color: var(--fg-c); }
.p-kpi span:first-child { display: flex; gap: 8px; align-items: center; font-weight: 700; color: var(--fg-c); font-size: 13px; }
.p-kpi i { font-style: normal; width: 24px; height: 24px; border-radius: 7px; background: var(--bg-c); display: flex; align-items: center; justify-content: center; }
.p-kpi b { font-size: 28px; color: var(--navy); line-height: 1.2; }
.p-kpi small { color: var(--mut); font-size: 12px; }
.p-mid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; }
.p-box { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.p-box > b { color: var(--navy); } .p-box b small, .p-box > small { font-weight: 500; color: var(--mut); font-size: 12px; }
.p-scroll { overflow-x: auto; }
.matrix { display: grid; grid-template-columns: minmax(150px, 1.6fr) repeat(6, minmax(64px, 1fr)); gap: 4px; min-width: 560px; font-size: 13px; }
.matrix > span { padding: 6px 4px; font-size: 12px; font-weight: 600; color: #4A5565; text-align: center; }
.matrix .g { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.badge { min-width: 28px; height: 26px; padding: 0 6px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: var(--bg-c); color: var(--fg-c); }
.matrix button { min-height: 40px; border: 2px solid transparent; border-radius: 8px; background: var(--bg-c, #FAFBFC); color: var(--fg-c, #A0A8B5); font-weight: 700; }
.matrix button.on { border-color: var(--navy); } .matrix button.total { background: #F0F3F7; color: var(--navy); cursor: default; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: #4A5565; }
.legend span { display: flex; align-items: center; gap: 6px; } .legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--bg-c); border: 1px solid var(--fg-c); }
.sec-row { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.sec-row div:first-child { display: flex; justify-content: space-between; } .sec-row div:first-child span:last-child { color: var(--mut); }
.sec-bar { height: 8px; border-radius: 99px; background: #E9EDF2; display: flex; overflow: hidden; }
.sec-bar i { background: var(--teal); } .sec-bar i + i { background: #C0392B; }
.p-table { overflow-x: auto; }
.p-grid { display: grid; grid-template-columns: 100px minmax(160px,1.6fr) 130px 60px 70px minmax(150px,1.3fr) 100px 110px 125px 70px minmax(120px,1fr) 130px; min-width: 1220px; align-items: center; }
.p-grid > * { padding: 9px 10px; min-width: 0; }
.p-band { font-size: 12px; font-weight: 700; } .p-band .b1 { grid-column: span 7; background: var(--navy); color: #fff; } .p-band .b2 { grid-column: span 5; background: var(--gold); color: #3D2E00; }
.p-head { background: #F0F3F7; font-size: 12px; font-weight: 600; color: #4A5565; border-bottom: 1px solid var(--line); }
.p-row { border-bottom: 1px solid #E9EDF2; font-size: 13px; } .p-row.conflict { background: #FFF8F7; }
.p-row .no { font-weight: 700; color: var(--navy); } .p-row .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-row .sm { font-size: 12px; color: #4A5565; } .sep { border-left: 3px solid var(--gold); font-weight: 600; color: var(--navy); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--bg-c); color: var(--fg-c); font-weight: 600; font-size: 12px; white-space: nowrap; }
.tag.sq { border-radius: 8px; font-weight: 700; }
.p-card { padding: 12px 16px; border-bottom: 1px solid #E9EDF2; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.p-card > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; }
.p-card .cnt { border-top: 1px dashed var(--line); padding-top: 6px; justify-content: flex-start; color: var(--mut); font-size: 12px; }
.up-list { border: 1px solid var(--line); border-radius: 12px; } .up-list div { display: flex; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #F0F3F7; font-size: 13px; } .up-list b { flex: 1; }
@media (max-width: 1023px) { .p-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .p-mid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 699px) { .p-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ———— جدول الجرد ———— */
#list { overflow: hidden; }
.row { display: grid; grid-template-columns: var(--cols); align-items: center; min-height: 56px; border-bottom: 1px solid #E9EDF2; border-inline-start: 4px solid var(--sc, transparent); }
.row > * { padding: 0 10px; min-width: 0; }
.row:nth-child(odd):not(.head) { background: #FBFCFD; }
.row.picked { background: #F1F8F6 !important; }
.row.head { position: sticky; top: 0; z-index: 3; min-height: 44px; background: #F0F3F7; font-size: 12px; font-weight: 700; color: #4A5565; border-radius: 14px 14px 0 0; }
.sel { display: flex; justify-content: center; } .sel input { width: 20px; height: 20px; accent-color: var(--teal); cursor: pointer; }
.c { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .c.b { font-weight: 600; } .c.no { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.num { text-align: left; font-variant-numeric: tabular-nums; } .c.zero { color: #A0A8B5; } .c.sm { font-size: 12px; color: var(--mut); }
.sb { max-width: 100%; height: 34px; border: 0; border-radius: 8px; background: var(--bg-c); color: var(--fg-c); display: inline-flex; align-items: center; gap: 6px; padding: 0 10px 0 8px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.sb .dot { width: 8px; height: 8px; margin: 0; } .sb i { font-style: normal; font-size: 10px; opacity: .7; }
.act { display: flex; gap: 6px; align-items: center; }
.btn.ok { min-height: 38px; background: var(--teal); border-color: var(--teal); color: #fff; padding: 0 12px; font-size: 13px; white-space: nowrap; }
.btn.ph { display: none; }
.btn.sm { min-height: 36px; padding: 0 10px; font-size: 12px; }
.btn.danger { color: #9B2C24; } .btn.ghost { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; } .btn.line { background: none; border-color: rgba(255,255,255,.35); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }
.lnk { border: 0; background: none; color: var(--mut); font-size: 12px; padding: 8px 4px; }
.det { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 10px 10px; }
.det select { flex: 0 1 220px; min-height: 38px; } .det input[type=text] { flex: 1 1 220px; min-height: 38px; }
.det .need, .db .need { border-color: #E3A49D; }
.err { color: #9B2C24; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tagb.on { background: #FBF1D6; border-color: #EBD38A; color: #6E5100; }
.photos { display: inline-flex; gap: 6px; align-items: center; }
.th { width: 36px; height: 36px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--navy); }
.th img { width: 100%; height: 100%; object-fit: cover; } .th.wait { background: #FBF1D6; }
#labBtn .cnt { font-style: normal; font-size: 12px; padding: 1px 7px; border-radius: 99px; background: var(--gold); color: #3D2E00; }

/* شريط التحديد المتعدد */
.bulk { position: fixed; z-index: 40; bottom: 16px; left: 50%; transform: translateX(-50%); width: min(1100px, calc(100% - 24px)); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--navy); color: #fff; box-shadow: 0 12px 32px rgba(18,58,90,.3); }
.bulk #bulkInfo { display: flex; gap: 10px; align-items: baseline; } .bulk small { color: #C9D6E3; }
main { padding-bottom: 90px; }

/* قائمة الملصقات */
dialog.wide { width: min(1100px, 100%); }
.lab-list { border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 55vh; }
.lrow { display: grid; grid-template-columns: 44px 110px minmax(150px, 1.6fr) 80px minmax(120px, 1.2fr) 100px 110px; align-items: center; min-height: 48px; border-bottom: 1px solid #EEF1F5; font-size: 13px; min-width: 760px; }
.lrow > * { padding: 0 8px; min-width: 0; } .lrow label { display: flex; justify-content: center; } .lrow input { width: 18px; height: 18px; accent-color: var(--teal); }
.lrow.head { position: sticky; top: 0; background: #F0F3F7; font-size: 12px; font-weight: 700; color: #4A5565; }
.lrow b { color: var(--navy); } .lrow .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lrow .sm { font-size: 12px; color: var(--mut); }
.lrow.done { opacity: .55; }
.why { font-style: normal; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: #E4ECF4; color: var(--navy); white-space: nowrap; } .why.damaged { background: #FBF1D6; color: #6E5100; }
.lab-act { align-items: center; flex-wrap: wrap; }

/* ———— المسح بملء الشاشة ———— */
dialog.scan { width: min(980px, 94vw); height: min(740px, 88dvh); max-width: none; max-height: none; margin: auto; border-radius: 22px; background: #0B1A26; color: #fff; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
dialog.scan .sc-side .ico { width: 58px; height: 58px; }
dialog.scan .sc-zoom button { width: 46px; height: 46px; }
.sc-cam { position: absolute; inset: 0; }
#camWrap, #camWrap video { position: absolute; inset: 0; width: 100%; height: 100%; }
#camWrap { overflow: hidden; } #camWrap video { object-fit: cover; transform-origin: center; transition: transform .2s; }
.sc-roi { position: absolute; left: 15%; right: 15%; top: 33%; bottom: 33%; border: 3px solid var(--teal); border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(5,12,20,.55); transition: border-color .2s; }
.sc-roi i { position: absolute; left: 3%; right: 3%; top: 50%; height: 2px; background: #FF5A4E; box-shadow: 0 0 12px #FF5A4E; }
.sc-cam.hit .sc-roi { border-color: #4CD3A5; box-shadow: 0 0 0 100vmax rgba(20,90,70,.45); }
.sc-cam.focusing .sc-roi { border-color: var(--gold); }
.sc-guide { position: absolute; left: 15%; right: 15%; top: calc(67% + 10px); margin: 0; text-align: center; font-size: 13px; color: #E8EEF4; }
.sc-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: linear-gradient(rgba(11,26,38,.85), transparent); }
.sc-top b { font-size: 17px; } .sc-top small { color: #C9D6E3; font-size: 12px; }
.chipd { padding: 4px 12px; border-radius: 99px; background: rgba(255,255,255,.14); font-size: 13px; white-space: nowrap; }
.ico { min-width: 52px; min-height: 52px; border: 0; border-radius: 14px; background: rgba(255,255,255,.14); color: #fff; font-size: 20px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ico small { font-size: 11px; font-weight: 700; } .ico.on { background: var(--gold); color: var(--navy); }
.sc-side { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; }
.sc-side .ico { width: 64px; height: 64px; }
.sc-zoom { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 18px; background: rgba(255,255,255,.14); }
.sc-zoom button { width: 52px; height: 52px; border: 0; border-radius: 13px; background: none; color: #fff; font-weight: 700; } .sc-zoom button.on { background: #fff; color: var(--navy); }
.sc-hint { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); max-width: 90%; padding: 8px 18px; border-radius: 99px; background: rgba(11,26,38,.85); font-weight: 700; font-size: 14px; text-align: center; }
.sc-hint.gold { background: rgba(212,160,23,.95); color: var(--navy); }
.sc-ext { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px; }
.sc-ext b { font-size: 22px; } .sc-ext span { color: #C9D6E3; }
.sc-bottom { position: absolute; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.sc-bottom input { background: rgba(255,255,255,.96); color: var(--ink); }
.sc-res { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 16px; background: rgba(255,255,255,.97); color: var(--ink); }
.sc-res i { width: 8px; align-self: stretch; border-radius: 4px; background: var(--teal); } .sc-res.y i { background: var(--gold); } .sc-res.r i { background: #C0392B; }
.sc-res b { display: block; color: var(--navy); font-size: 15px; } .sc-res small { color: var(--mut); font-size: 12px; }
#recent .recent { color: #E8EEF4; background: rgba(11,26,38,.6); border-radius: 10px; padding: 6px 12px; border: 0; margin-top: 4px; } #recent .recent span { color: #C9D6E3; }
.sc-sheet { position: absolute; inset: auto 0 0 0; max-height: 88dvh; overflow-y: auto; background: #fff; color: var(--ink); border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.35); z-index: 5; }
@media (min-width: 700px) { .sc-sheet { inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(560px, 94vw); border-radius: 20px; } }
.sh-h { position: sticky; top: 0; z-index: 2; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--navy); color: #fff; }
.sh-h b { font-size: 16px; } .sh-h b span { font-weight: 500; } .sh-h small { font-weight: 500; font-size: 12px; color: #C9D6E3; }
.sh-h.y { background: #8A6A00; } .sh-h.r { background: #9B2C24; }
.db0 { display: flex; flex-direction: column; gap: 10px; }
.chk { display: flex; gap: 10px; align-items: center; font-size: 13px; font-weight: 600; } .chk input { width: 20px; height: 20px; accent-color: var(--teal); }
.sug > div { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); } .sug b { color: var(--navy); width: 92px; flex: none; }
.sug small { display: block; color: var(--mut); font-size: 12px; }
.set-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.set-row small { display: block; color: var(--mut); font-size: 12px; }
.sseg { display: inline-flex; padding: 3px; border-radius: 10px; background: #EEF1F5; flex: none; }
.sseg button { border: 0; background: none; padding: 7px 11px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--mut); }
.sseg button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.tog { width: 50px; height: 30px; flex: none; border: 0; border-radius: 99px; background: #C9D1DB; position: relative; padding: 0; }
.tog i { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 99px; background: #fff; transition: right .15s; }
.tog.on { background: var(--teal); } .tog.on i { right: 23px; }
.diag { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 14px; border-radius: 14px; background: #0B1A26; color: #E8EEF4; }
.diag span { display: block; color: #9FB0C2; font-size: 12px; } .diag b { display: block; font-size: 16px; direction: ltr; text-align: right; unicode-bidi: isolate; }

@media (max-width: 699px) {
  .row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; padding: 10px 4px 10px 40px; position: relative; }
  .row.head { display: none; }
  .row > * { padding: 0 8px; }
  .row .sel { position: absolute; left: 6px; top: 12px; padding: 0; }
  .row .c.no { order: 1; flex: 1; } .row .st { order: 2; } .row .c.b { order: 3; flex: 0 0 100%; white-space: normal; font-size: 15px; }
  .row .c:not(.b):not(.no) { order: 4; flex: 0 1 auto; font-size: 12px; color: var(--mut); padding: 0 8px 0 0; }
  .row .c:not(.b):not(.no) + .c:not(.b):not(.no)::before { content: '· '; }
  .row .act { order: 5; flex: 0 0 100%; margin-top: 6px; } .row .act .btn.ok, .row .act .btn.ph { flex: 1; display: inline-flex; min-height: 42px; }
  .row .det { order: 6; flex: 0 0 100%; padding: 6px 8px 0; }
  .sc-side { right: 10px; } .sc-side .ico { width: 54px; height: 54px; } .sc-zoom { left: 10px; } .sc-zoom button { width: 44px; height: 44px; }
  .sc-roi { left: 8%; right: 8%; } .sc-guide { left: 8%; right: 8%; }
  dialog.scan { width: 100vw; height: 92dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  dialog.scan .sc-side .ico { width: 48px; height: 48px; } dialog.scan .sc-zoom button { width: 40px; height: 40px; }
  .sc-top { gap: 6px; padding: 10px 12px; } .sc-top b { font-size: 15px; white-space: nowrap; } .sc-top .ico { min-width: 44px; min-height: 44px; }
  .sc-side, .sc-zoom { top: 66px; transform: none; flex-direction: row; } .sc-side { right: 12px; } .sc-zoom { left: 12px; }
  .sc-hint { top: 128px; font-size: 13px; }
  .bulk { bottom: 8px; } .diag { grid-template-columns: repeat(2, 1fr); }
}

/* إضاءة نتيجة القراءة — التصميم المعتمد E: حواف + إطار + أيقونة + شريط نتيجة ملوّن */
.sc-flash { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; border-radius: inherit; --fx: transparent; box-shadow: inset 0 0 0 3px var(--fx), inset 0 0 70px 14px var(--fx); }
.sc-flash.g { --fx: #2E9E7E; animation: fxfade .6s ease-out; }
.sc-flash.y { --fx: #E3A21A; animation: fxfade .9s ease-out; }
.sc-flash.r { --fx: #D0352A; animation: fxpulse 1.2s ease-out; }
@keyframes fxfade { 0% { opacity: 0; } 8% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fxpulse { 0% { opacity: 0; } 7% { opacity: 1; } 30% { opacity: .25; } 45% { opacity: 1; } 100% { opacity: 0; } }
.sc-cam.fx-g .sc-roi { border-color: #2E9E7E; box-shadow: 0 0 0 100vmax rgba(5,12,20,.55), 0 0 22px 5px #2E9E7E; }
.sc-cam.fx-y .sc-roi { border-color: #E3A21A; box-shadow: 0 0 0 100vmax rgba(5,12,20,.55), 0 0 22px 5px #E3A21A; }
.sc-cam.fx-r .sc-roi { border-color: #D0352A; box-shadow: 0 0 0 100vmax rgba(5,12,20,.55), 0 0 22px 5px #D0352A; }
.sc-icon { position: absolute; left: 50%; top: 50%; z-index: 4; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 99px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 28px; font-weight: 800; pointer-events: none; opacity: 0; }
.sc-icon.g { background: #2E9E7E; box-shadow: 0 0 0 7px rgba(46,158,126,.3); animation: fxicon .6s ease-out; }
.sc-icon.y { background: #E3A21A; box-shadow: 0 0 0 7px rgba(227,162,26,.3); animation: fxicon .9s ease-out; }
.sc-icon.r { background: #D0352A; box-shadow: 0 0 0 7px rgba(208,53,42,.3); animation: fxicon 1.2s ease-out; }
@keyframes fxicon { 0% { opacity: 0; transform: scale(.6); } 12% { opacity: 1; transform: scale(1.08); } 22% { transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
.sc-res.g { background: #E3F2EE; } .sc-res.y { background: #FBF1D6; } .sc-res.r { background: #FBE7E6; }
.sc-res.g i { background: #2E9E7E; }
@media (prefers-reduced-motion: reduce) { .sc-flash, .sc-icon { animation-duration: .01s !important; } }
