@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --bg: #f4f6f8; --card: #fff; --ink: #0f1f2a; --ink-2: #3d4f5c; --muted: #6b7c88; --line: #e3e8ed; --line-2: #eef1f4;
  --navy: #0b2530; --navy-2: #12323f; --brand: #0e7c86; --brand-d: #0a626a; --brand-bg: #e3f4f5;
  --ok: #15803d; --ok-bg: #e2f6e9; --warn: #b45309; --warn-bg: #fdf0d5; --bad: #c0271f; --bad-bg: #fde8e6;
  --info: #1d5fbf; --info-bg: #e4eefb; --off-bg: #eef1f4;
  --r: 14px; --shadow: 0 1px 2px rgba(15,31,42,.05), 0 4px 16px rgba(15,31,42,.05);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; }
body { background: var(--bg); color: var(--ink); font: 15px/1.65 "Plex Arabic", "Segoe UI", Tahoma, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 600; }
a { color: var(--brand-d); }
svg.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.center-msg { padding: 70px 16px; text-align: center; color: var(--muted); }
[hidden] { display: none !important; }

/* أزرار وحقول */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 15px; cursor: pointer; white-space: nowrap; font-weight: 500; text-decoration: none; color: var(--ink); transition: background .12s, border-color .12s; }
.btn:hover { background: #f7f9fa; border-color: #cfd8df; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-d); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.warn { background: #c2570c; border-color: #c2570c; color: #fff; }
.btn.danger { color: var(--bad); border-color: #f3c7c3; } .btn.danger:hover { background: var(--bad-bg); }
.btn.dangerfill { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; } .btn.big { padding: 13px 20px; font-size: 16px; border-radius: 12px; }
.btn.icon { padding: 7px; } .btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=password], input[type=date], input[type=month], input[type=time], input[type=number], input[type=search], select, textarea {
  border: 1px solid #cfd8df; border-radius: 10px; padding: 8px 11px; background: #fff; min-width: 0; max-width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.field { display: block; margin-bottom: 12px; } .field > span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; } .form-grid .full { grid-column: 1 / -1; }
.err { color: var(--bad); font-size: 13px; min-height: 20px; margin: 4px 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; } .checks label { display: flex; gap: 5px; align-items: center; }

/* بطاقات وشرائح */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card > h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 500; background: var(--off-bg); color: #4b5c68; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.info { background: var(--info-bg); color: var(--info); }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #dfe6eb; flex: none; }
.avatar.empty { display: inline-flex; align-items: center; justify-content: center; color: #93a3ae; }
.avatar.lg { width: 84px; height: 84px; } img.avatar, .thumb { cursor: zoom-in; }
.thumb { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: #dfe6eb; flex: none; }
.empty-box { text-align: center; color: var(--muted); padding: 36px 14px; background: #fff; border: 1px dashed #cfd8df; border-radius: var(--r); }

/* صفحة الدخول */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--navy) 0%, #0e3b47 60%, var(--brand) 130%); }
.auth .card { width: 100%; max-width: 400px; padding: 28px; }
.auth .brandmark { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.logo { width: 46px; height: 46px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.auth h1 { font-size: 19px; } .auth p { color: var(--muted); margin: 0; font-size: 13px; }

/* هيكل المدير */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #c9d6dd; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 12; }
.side .brandmark { display: flex; align-items: center; gap: 11px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side .brandmark b { color: #fff; font-size: 15px; line-height: 1.35; display: block; } .side .brandmark span { font-size: 12px; color: #8fa5b0; }
.side nav { padding: 10px; flex: 1; overflow-y: auto; }
.side nav button { display: flex; align-items: center; gap: 11px; width: 100%; background: none; border: 0; color: inherit; padding: 10px 12px; border-radius: 10px; cursor: pointer; text-align: start; font-weight: 500; }
.side nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav button.on { background: var(--brand); color: #fff; }
.side nav .badge { margin-inline-start: auto; background: #e5484d; color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; line-height: 19px; }
.side .me { padding: 12px 14px calc(12px + var(--sab)); border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.side .me b { color: #fff; font-size: 14px; display: block; } .side .me span { font-size: 12px; color: #8fa5b0; }
.side .me button { margin-inline-start: auto; background: none; border: 0; color: #c9d6dd; cursor: pointer; padding: 6px; border-radius: 8px; } .side .me button:hover { background: rgba(255,255,255,.08); color: #fff; }
.main { min-width: 0; }
.mobilebar { display: none; }
.page { padding: 24px 28px 48px; max-width: 1320px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin-bottom: 18px; }
.page-head h2 { font-size: 22px; font-weight: 700; flex: 1; min-width: 160px; } .page-head h2 small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--c, var(--line)); }
.kpi span { color: var(--muted); font-size: 13px; display: block; } .kpi b { font-size: 28px; font-weight: 700; line-height: 1.25; display: block; }
.kpi em { font-style: normal; font-size: 12px; color: var(--muted); }
.alerts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.alerts button { display: flex; align-items: center; gap: 8px; border: 1px solid #f3d9a4; background: var(--warn-bg); color: #7a3c06; border-radius: 10px; padding: 7px 12px; cursor: pointer; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 14px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-top: 8px; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.prog { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-2); } .prog:last-child { border: 0; }
.prog .bar { grid-column: 1 / -1; height: 7px; background: var(--off-bg); border-radius: 99px; overflow: hidden; display: flex; }
.prog .bar i { display: block; height: 100%; }
.feed .row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; } .feed .row:last-child { border: 0; }
.feed .row .t { margin-inline-start: auto; color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: start; padding: 10px 13px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { background: #f8fafb; font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
tbody tr:hover { background: #fafcfd; } tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: end; } td.actions .btn { margin-inline-start: 4px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 170px; } .who b { display: block; font-weight: 600; } .who span { font-size: 12.5px; color: var(--muted); }
.clickable { cursor: pointer; }

.muster { font-size: 12.5px; } .muster th, .muster td { padding: 5px 4px; text-align: center; border-inline-end: 1px solid var(--line-2); }
.muster th.name, .muster td.name { position: sticky; inset-inline-start: 0; background: #fff; text-align: start; min-width: 170px; padding-inline: 10px; z-index: 1; box-shadow: -1px 0 0 var(--line); }
.muster th.name { background: #f8fafb; z-index: 2; } .muster th.offd { color: var(--bad); }
.st { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-weight: 600; font-size: 11.5px; }
.st.P { background: var(--ok-bg); color: var(--ok); } .st.L { background: var(--warn-bg); color: var(--warn); } .st.A { background: var(--bad-bg); color: var(--bad); }
.st.V { background: var(--info-bg); color: var(--info); } .st.O { background: var(--off-bg); color: #8a99a4; }
.strip { display: grid; grid-template-columns: repeat(15, 1fr); gap: 4px; } .strip div { text-align: center; font-size: 10.5px; color: var(--muted); }

.seg { display: inline-flex; background: #e9eef2; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.rec { display: flex; gap: 12px; align-items: center; } .rec .body { flex: 1; min-width: 0; } .rec .title { font-weight: 600; }
.rec .meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.rec .side-a { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; } .rec.flag { border-color: #f0b9b4; background: #fffbfa; }
.list { display: grid; gap: 10px; } .pair { display: flex; gap: 4px; flex: none; }
.sect { margin-bottom: 22px; } .sect > .page-head { margin-bottom: 10px; } .sect h3 { font-size: 16px; flex: 1; }

/* النوافذ */
.overlay { position: fixed; inset: 0; background: rgba(11,37,48,.55); display: flex; align-items: center; justify-content: center; padding: 14px; z-index: 30; backdrop-filter: blur(2px); }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 480px; max-height: 94vh; overflow: auto; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 820px; } .modal h3 { font-size: 17px; margin-bottom: 14px; }
.modal .foot { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.cam-stage { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 3/4; max-height: 54vh; margin: 0 auto; }
.cam-stage video, .cam-stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-lines { display: grid; gap: 4px; margin-top: 10px; font-size: 14px; } .cam-lines div { display: flex; gap: 7px; align-items: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; flex: none; } .dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); }
.dot.wait { background: #f59e0b; animation: pulse 1s infinite; } @keyframes pulse { 50% { opacity: .3; } }
.viewer img { width: 100%; border-radius: 12px; background: #000; max-height: 60vh; object-fit: contain; }
.viewer .cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .viewer figure { margin: 0; } .viewer figcaption { font-size: 12px; color: var(--muted); text-align: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 12px 0 0; font-size: 14px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; } .gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; cursor: zoom-in; background: #dfe6eb; } .gallery figcaption { font-size: 11.5px; color: var(--muted); text-align: center; }
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
#toasts { position: fixed; bottom: calc(84px + var(--sab)); inset-inline: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 60; pointer-events: none; padding: 0 12px; }
.toast { background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 12px; max-width: 100%; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-weight: 500; }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); } .toast.warn { background: #c2570c; }

/* تطبيق المشرف */
.app { min-height: 100vh; padding-bottom: calc(78px + var(--sab)); }
.appbar { background: var(--navy); color: #fff; padding: calc(12px + var(--sat)) 16px 12px; display: flex; align-items: center; gap: 11px; position: sticky; top: 0; z-index: 10; }
.appbar b { display: block; font-size: 15px; line-height: 1.3; } .appbar span { font-size: 12px; color: #9fb4be; }
.appbar .btn { margin-inline-start: auto; background: rgba(255,255,255,.1); border-color: transparent; color: #fff; }
.app main { padding: 14px; max-width: 640px; margin: 0 auto; }
.tabbar { position: fixed; bottom: 0; inset-inline: 0; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: var(--sab); z-index: 10; }
.tabbar button { flex: 1; background: none; border: 0; padding: 9px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); cursor: pointer; font-weight: 500; position: relative; }
.tabbar button.on { color: var(--brand-d); } .tabbar button.on svg { stroke-width: 2.2; }
.hero { background: linear-gradient(135deg, var(--navy-2), var(--brand)); color: #fff; border-radius: 18px; padding: 18px; display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.hero h2 { font-size: 18px; } .hero p { margin: 2px 0 0; color: #d3e9ec; font-size: 13px; }
.ring { width: 84px; height: 84px; flex: none; position: relative; } .ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 19px; font-weight: 700; }
.mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.mini div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; text-align: center; } .mini b { display: block; font-size: 20px; line-height: 1.2; } .mini span { font-size: 11.5px; color: var(--muted); }
.cta { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--navy); color: #fff; border: 0; border-radius: 16px; padding: 15px 16px; cursor: pointer; text-align: start; margin-bottom: 14px; }
.cta b { display: block; font-size: 16px; } .cta span { font-size: 12.5px; color: #a9bfc8; } .cta svg.ic { width: 30px; height: 30px; color: #5fd3da; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; padding-bottom: 2px; }
.chips button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 13px; white-space: nowrap; cursor: pointer; font-size: 13px; font-weight: 500; }
.chips button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.wcard { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; box-shadow: var(--shadow); }
.wcard .body { flex: 1; min-width: 0; } .wcard .title { font-weight: 600; } .wcard .meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.wcard .act { flex: 1 1 100%; display: flex; gap: 8px; } .wcard .act .btn { flex: 1; }

/* التحضير السريع */
.scan { position: fixed; inset: 0; background: #000; z-index: 40; display: flex; flex-direction: column; color: #fff; }
.scan video { flex: 1; width: 100%; min-height: 0; object-fit: cover; }
.scan .top { position: absolute; top: 0; inset-inline: 0; padding: calc(12px + var(--sat)) 14px 26px; display: flex; gap: 10px; align-items: center; background: linear-gradient(#000a, #0000); }
.scan .top .seg { background: rgba(255,255,255,.18); } .scan .top .seg button { color: #fff; } .scan .top .seg button.on { background: #fff; color: var(--ink); }
.scan .top .x { margin-inline-start: auto; background: rgba(255,255,255,.18); border: 0; color: #fff; border-radius: 50%; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; }
.scan .frame { position: absolute; top: 50%; left: 50%; width: min(64vw, 300px); aspect-ratio: 3/4; transform: translate(-50%, -58%); border: 3px solid rgba(255,255,255,.75); border-radius: 26px; pointer-events: none; transition: border-color .2s; }
.scan .frame.hit { border-color: #34d399; } .scan .frame.miss { border-color: #f87171; }
.scan .bottom { position: absolute; bottom: 0; inset-inline: 0; padding: 30px 14px calc(16px + var(--sab)); background: linear-gradient(#0000, #000c 40%); }
.scan .status { text-align: center; font-size: 16px; font-weight: 500; min-height: 28px; }
.scan .sub { text-align: center; font-size: 12.5px; color: #cbd5e1; margin-top: 2px; }
.scan .hit-card { background: #fff; color: var(--ink); border-radius: 16px; padding: 12px; display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.scan .hit-card .body { flex: 1; } .scan .hit-card b { display: block; font-size: 16px; }
.scan .count { text-align: center; font-size: 12.5px; color: #cbd5e1; margin-top: 8px; }

@media (max-width: 960px) {
  .shell { display: block; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 264px; height: 100%; transform: translateX(110%); transition: transform .2s; padding-top: var(--sat); }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
  .mobilebar { display: flex; align-items: center; gap: 10px; background: var(--navy); color: #fff; padding: calc(10px + var(--sat)) 14px 10px; position: sticky; top: 0; z-index: 11; }
  .mobilebar b { font-size: 15px; } .mobilebar button { background: none; border: 0; color: #fff; padding: 4px; cursor: pointer; }
  .page { padding: 16px 14px 40px; } .grid2, .grid3 { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; } .form-grid { grid-template-columns: 1fr; }
  #toasts { bottom: calc(20px + var(--sab)); }
}
/* تطبيق العامل والتحضير الذاتي */
.linkbtn { display: block; width: 100%; margin-top: 14px; background: none; border: 0; color: var(--brand-d); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; padding: 6px; }
.en { display: inline-block; font-size: .78em; opacity: .7; font-weight: 400; margin-inline-start: 6px; }
.wtiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.wtile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; }
.wtile span { font-size: 13px; color: var(--muted); } .wtile b { font-size: 26px; color: #b6c2cb; } .wtile.on b { color: var(--ink); } .wtile em { font-style: normal; justify-self: start; }
.wgeo { display: flex; gap: 8px; align-items: center; font-size: 14px; padding: 12px 14px; margin-bottom: 10px; }
.wgo { padding: 18px; font-size: 19px; border-radius: 16px; display: flex; justify-content: center; align-items: center; gap: 12px; } .wgo svg { width: 30px; height: 30px; }
.wgo span { display: grid; text-align: start; line-height: 1.3; } .wgo .en { margin: 0; }
.notice { background: #fff8e6; border-color: #f1d99a; font-size: 14.5px; line-height: 1.7; } .notice.ok { background: #e9f7ee; border-color: #b7e0c5; color: #14532d; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.wday { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f3f5; font-size: 14px; } .wday:last-child { border: 0; }
.wscan .top b { font-size: 16px; } .wscan .arrow { text-align: center; font-size: 54px; line-height: 1; min-height: 58px; color: #34d399; }
.wscan .status { font-size: 19px; } .wscan .sub { font-size: 14px; }
.selfbox { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 14px; background: #f8fafb; }
.selfbox .acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* الخريطة */
.mapwrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: stretch; }
#map { height: calc(100vh - 250px); min-height: 420px; border-radius: 14px; border: 1px solid var(--line, #e3e9ee); z-index: 0; font-family: inherit; }
.maplist { display: flex; flex-direction: column; gap: 8px; padding: 12px; height: calc(100vh - 250px); min-height: 420px; margin: 0; }
.maplist .rows { overflow-y: auto; flex: 1; }
.maplist .row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; cursor: pointer; border-bottom: 1px solid #f0f3f5; }
.maplist .row:hover { background: var(--brand-bg); } .maplist .row > div { flex: 1; min-width: 0; } .maplist .row[hidden] { display: none; }
.maplist .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.mk { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--c); background: #fff; color: var(--c); font-weight: 700; font-size: 16px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.mk img { width: 100%; height: 100%; object-fit: cover; }
.mkc { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); font-variant-numeric: tabular-nums; }
.mkc.bad { border-color: #c0271f; }
.mpop { display: flex; gap: 10px; align-items: flex-start; font-family: 'IBM Plex Sans Arabic', sans-serif; font-size: 13px; text-align: start; }
.mpop > img { width: 84px; height: 104px; object-fit: cover; border-radius: 8px; flex: none; background: #dfe6eb; }
.leaflet-container a.btn { color: inherit; } .leaflet-control-layers { font-family: inherit; font-size: 13px; }
@media (max-width: 960px) {
  .mapwrap { grid-template-columns: 1fr; } #map { height: 60vh; min-height: 340px; } .maplist { height: auto; min-height: 0; max-height: 50vh; }
}
@media print {
  .side, .mobilebar, .filters, .page-head .btn, .tabbar, #toasts { display: none !important; }
  .shell { display: block; } .page { padding: 0; max-width: none; } body { background: #fff; font-size: 11px; }
  .table-wrap, .card, .kpi { box-shadow: none; } .table-wrap { overflow: visible; border: 0; }
  .muster th.name, .muster td.name { position: static; box-shadow: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: A4 landscape; margin: 10mm; }
}
