/* Al Adwaa portal – style guide tokens, phone layout for the field, desktop layout for managers, print layout for PDF */
@font-face { font-family: Cairo; font-weight: 400; font-display: swap; src: url(/fonts/cairo-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Cairo; font-weight: 500; font-display: swap; src: url(/fonts/cairo-arabic-500-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Cairo; font-weight: 600; font-display: swap; src: url(/fonts/cairo-arabic-600-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Cairo; font-weight: 700; font-display: swap; src: url(/fonts/cairo-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Poppins; font-weight: 400; font-display: swap; src: url(/fonts/poppins-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2010-2027; }
@font-face { font-family: Poppins; font-weight: 500; font-display: swap; src: url(/fonts/poppins-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2010-2027; }
@font-face { font-family: Poppins; font-weight: 600; font-display: swap; src: url(/fonts/poppins-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2010-2027; }
@font-face { font-family: Poppins; font-weight: 700; font-display: swap; src: url(/fonts/poppins-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2010-2027; }

:root {
  --bg: #EEF1F4; --surface: #FFFFFF; --ink: #2D2D3C; --muted: #5B6270; --line: #E1E6EB;
  --brand: #0BBBEF; --brand-ink: #0779A1; --brand-soft: #E3F6FD; --pale: #F4F8FA;
  --pill: #2D2D3C; --pill-ink: #FFFFFF; --track: #E1E5EA; --alert: #E5484D; --alert-ink: #C6282E;
  --shadow: 0 6px 20px rgba(45, 45, 60, .07);
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root.mgr:not([data-theme="light"]) {
    --bg: #0E1216; --surface: #181E25; --ink: #EEF2F5; --muted: #A6B0BA; --line: #2C343D;
    --brand: #22C3F2; --brand-ink: #6AD6F7; --brand-soft: #16323F; --pale: #1B232B;
    --pill: #22C3F2; --pill-ink: #0E1216; --track: #1F262E; --shadow: none; color-scheme: dark;
  }
}
:root.mgr[data-theme="dark"] {
  --bg: #0E1216; --surface: #181E25; --ink: #EEF2F5; --muted: #A6B0BA; --line: #2C343D;
  --brand: #22C3F2; --brand-ink: #6AD6F7; --brand-soft: #16323F; --pale: #1B232B;
  --pill: #22C3F2; --pill-ink: #0E1216; --track: #1F262E; --shadow: none; color-scheme: dark;
}
*, *::before, *::after { box-sizing: inherit; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: Cairo, Poppins, Tahoma, Arial, sans-serif; font-size: 16px; line-height: 1.6; -webkit-text-size-adjust: 100%; }
:root.mgr[lang="en"] body { font-family: Poppins, Cairo, system-ui, Arial, sans-serif; font-size: 15px; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
a { color: var(--brand-ink); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.num, input[type=tel], input[type=number], td.n, .n { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: .92em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--surface); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.demo { padding: 6px 16px; background: var(--brand-soft); color: var(--ink); font-weight: 600; font-size: 13px; text-align: center; }

/* ---------- buttons, inputs, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; background: var(--pill); color: var(--pill-ink); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.sec { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--surface); color: var(--alert-ink); border-color: var(--alert); }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: .92em; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 42px; height: 40px; border: 0; border-radius: 99px; background: transparent; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 700; position: relative; }
.icon-btn svg { width: 20px; height: 20px; }
.dot { position: absolute; top: 8px; inset-inline-end: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--alert); }
label.f { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
label.f > em { font-style: normal; font-weight: 400; font-size: .88em; color: var(--muted); }
.f-group { display: flex; flex-direction: column; gap: 8px; }
.f-group > b { font-weight: 700; }
input[type=text], input[type=tel], input[type=number], input[type=email], input[type=password], input[type=search], input[type=date], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
input[type=tel], input[type=number] { direction: ltr; text-align: end; }
textarea { min-height: 80px; resize: vertical; }
input.changed { border-color: var(--brand); background: var(--brand-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 8px 16px; border-radius: 99px; border: 2px solid var(--line); background: var(--pale); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--pill); border-color: var(--pill); color: var(--pill-ink); }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--track); flex-wrap: wrap; }
.seg button, .seg a { min-height: 38px; padding: 6px 16px; border: 0; border-radius: 99px; background: transparent; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.seg [aria-pressed="true"], .seg [aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 2px 8px rgba(45, 45, 60, .14); }
.seg.full { display: flex; flex-wrap: nowrap; } .seg.full > * { flex: 1; justify-content: center; white-space: nowrap; padding-inline: 8px; font-size: 15px; }
.utabs { display: flex; flex-wrap: wrap; gap: 22px; border-bottom: 1px solid var(--line); }
.utabs button { padding: 10px 2px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; }
.utabs button[aria-pressed="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--brand-soft); color: var(--brand-ink); }
.pill.wait { background: var(--pale); color: var(--ink); border: 1px solid var(--line); }
.pill.no { background: var(--pill); color: var(--pill-ink); }
.pill.flag { background: var(--pale); color: var(--alert-ink); border: 1px solid var(--line); }
.msg { padding: 12px 14px; border-radius: 12px; font-weight: 500; }
.msg.err { background: #FDECEC; color: var(--alert-ink); }
.msg.ok { background: var(--brand-soft); color: var(--brand-ink); }
.msg.info { background: var(--pale); color: var(--ink); border: 1px solid var(--line); }
.secret { direction: ltr; unicode-bidi: isolate; display: inline-block; padding: 6px 14px; border-radius: 10px; background: var(--pale); border: 2px dashed var(--brand); font: 700 22px/1.4 Poppins, monospace; letter-spacing: .08em; user-select: all; word-break: break-all; }
.toast { position: fixed; inset: auto 16px calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 50; max-width: 560px; margin: 0 auto; padding: 14px 16px; border-radius: 12px; background: var(--pill); color: var(--pill-ink); font-weight: 600; text-align: center; }

/* ---------- field app (phone first) ---------- */
.ftop { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--surface); z-index: 20; }
.ftop .title { flex: 1; font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.ftop .title img { width: 30px; height: 30px; }
.ftop .who { font-size: 13px; color: var(--muted); }
.ftop .back { width: 44px; height: 44px; border: 0; background: none; color: var(--ink); font-size: 26px; cursor: pointer; }
.fmain { max-width: 640px; margin: 0 auto; padding: 18px 16px 120px; display: flex; flex-direction: column; gap: 14px; }
.fmain.wide { max-width: 1100px; }
.dock { position: fixed; inset: auto 0 0; z-index: 10; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); }
.dock .inner { max-width: 640px; margin: 0 auto; display: flex; gap: 10px; }
.dock .btn { flex: 1; }
.hello h1 { font-size: 28px; }
.hello .role { color: var(--brand-ink); font-weight: 700; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 100px; padding: 20px 22px; border: 0; border-radius: 20px; background: var(--pill); color: var(--pill-ink);
  font: inherit; text-align: start; cursor: pointer; width: 100%; }
.hero b { display: block; font-size: 23px; }
.hero small { display: block; font-size: 14px; opacity: .85; }
.hero .ring { width: 46px; height: 46px; border-radius: 50%; border: 6px solid var(--brand); flex: none; }
.menu { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.menu li + li { border-top: 1px solid var(--line); }
.menu a { display: flex; align-items: center; gap: 10px; padding: 16px 18px; color: var(--ink); text-decoration: none; font-weight: 500; }
.menu a .count { margin-inline-start: auto; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; padding: 0 10px; border-radius: 99px; }
.steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.steps span { height: 6px; border-radius: 3px; background: var(--track); }
.steps .done { background: var(--ink); } .steps .now { background: var(--brand); }
.gps { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 0 6px; }
.gring { position: relative; width: min(64vw, 240px); aspect-ratio: 1; }
.gring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gring .track { fill: none; stroke: var(--track); stroke-width: 14; }
.gring .fill { fill: none; stroke: var(--brand); stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.gring .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gring .m { font-size: 56px; font-weight: 700; line-height: 1; }
.gstatus { font-weight: 700; font-size: 18px; text-align: center; }
.gstatus.ok { color: var(--brand-ink); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid var(--line); }
.pick { display: flex; width: 100%; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 6px; border: 0; background: none; color: var(--ink); font: inherit; text-align: start; cursor: pointer; border-radius: 10px; }
.pick[aria-pressed="true"] { background: var(--brand-soft); outline: 2px solid var(--brand); }
.pick .nm { font-weight: 700; }
.pick .dist { font-weight: 700; white-space: nowrap; }
.pick .dist.near { color: var(--brand-ink); }
.camera { position: relative; border-radius: 20px; overflow: hidden; background: #000; aspect-ratio: 3 / 4; }
.camera video, .camera img { width: 100%; height: 100%; object-fit: contain; display: block; }
.shutter { position: absolute; inset: auto 0 18px; margin: auto; width: 76px; height: 76px; border-radius: 50%; border: 6px solid #fff; background: var(--brand); cursor: pointer; }
.summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; }
.summary dt { color: var(--muted); } .summary dd { margin: 0; font-weight: 700; }
.vcard { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 12px 0; }
.vcard + .vcard { border-top: 1px solid var(--line); }
.vcard img { width: 92px; height: 122px; object-fit: cover; border-radius: 10px; background: var(--track); cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(10, 14, 20, .92); display: flex; align-items: center; justify-content: center; padding: 16px; border: 0; width: 100%; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 10px; }
.queue { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--pale); border: 1px solid var(--line); font-weight: 500; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.kpis > div { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.kpis .k { font-size: 13px; color: var(--muted); } .kpis .v { font-size: 22px; font-weight: 700; } .kpis .v small { font-size: 13px; font-weight: 500; color: var(--muted); }
.big { font-size: 48px; font-weight: 700; line-height: 1; }
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 24px; max-width: 440px; margin: 0 auto; padding: 24px 20px; }
.login .logo { width: 230px; height: auto; }

/* ---------- managers (desktop) ---------- */
.mbar { max-width: 1840px; margin: 0 auto; padding: 14px 28px 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.logo-pill { display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 8px; border-radius: 99px; background: var(--surface); font-weight: 600; color: var(--ink); text-decoration: none; }
.logo-pill img { width: 30px; height: 30px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 99px; background: var(--surface); }
.tabs a { padding: 9px 18px; border-radius: 99px; color: var(--ink); font-weight: 500; text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--pill); color: var(--pill-ink); }
.tools { display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-radius: 99px; background: var(--surface); }
.mmain { max-width: 1840px; margin: 0 auto; padding: 16px 28px 48px; display: flex; flex-direction: column; gap: 18px; }
.phead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.phead h1 { font-size: 32px; }
.phead h1 span { color: var(--brand-ink); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; }
.crumbs button { border: 0; background: none; padding: 2px 0; font: inherit; font-weight: 600; color: var(--brand-ink); cursor: pointer; }
.kgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.kcard { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: 22px; background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); border: 0; text-align: start; font: inherit; cursor: pointer; }
.kcard:hover { box-shadow: inset 0 0 0 2px var(--brand); }
.kcard .k { font-size: 14px; color: var(--muted); } .kcard .v { font-size: 28px; font-weight: 700; } .kcard .s { font-size: 13px; color: var(--muted); }
.bar { height: 6px; border-radius: 3px; background: var(--brand-soft); overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.box { padding: 22px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.box-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.hbars { display: flex; flex-direction: column; gap: 12px; direction: ltr; }
.hbar { display: grid; grid-template-columns: minmax(140px, 260px) minmax(0, 1fr); gap: 16px; align-items: center; }
.hbar .who { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.hbar .who button { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--brand-ink); cursor: pointer; text-align: left; }
.hbar .who b { font-weight: 700; }
.hbar .track { display: flex; align-items: center; gap: 10px; }
.hbar .tr { flex: 1; height: 24px; border-radius: 8px; background: var(--track); overflow: hidden; display: flex; }
.hbar .tr i { display: block; height: 100%; background: var(--brand); border-radius: 8px; }
.hbar .val { min-width: 170px; font-size: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: var(--muted); direction: ltr; }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--brand); margin-inline-end: 6px; vertical-align: -1px; }
.legend span.t::before { background: var(--track); }
.twrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.t th { background: var(--bg); color: var(--muted); font-size: 13px; font-weight: 700; text-align: start; padding: 11px 12px; white-space: nowrap; position: sticky; top: 0; }
table.t td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: top; }
table.t td.n, table.t th.n { text-align: end; }
table.t tr.total td { background: var(--brand-soft); font-weight: 700; border-top: 2px solid var(--brand); }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--pale); }
table.t img.thumb { width: 56px; height: 74px; object-fit: cover; border-radius: 8px; cursor: zoom-in; display: block; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.filters select, .filters input { min-height: 42px; border-radius: 99px; border-width: 1px; padding: 6px 14px; font-size: 14px; min-width: 150px; }
.uploads { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.report { white-space: pre-wrap; font-size: 13px; background: var(--pale); padding: 10px; border-radius: 10px; max-height: 260px; overflow: auto; direction: ltr; text-align: left; }
.dialog { position: fixed; inset: 0; z-index: 70; background: rgba(10, 14, 20, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog > .card { width: min(560px, 100%); max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.hist { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; }
.hist + .hist { border-top: 1px solid var(--line); }
.prof { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; }
.prof dt { color: var(--muted); } .prof dd { margin: 0; font-weight: 600; }
.print-head { display: none; }
.print-only { display: none; }

@media (max-width: 900px) {
  .mbar { padding: 12px 14px 0; } .mmain { padding: 14px 14px 40px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; } .tabs a { white-space: nowrap; }
  .hbar { grid-template-columns: 1fr; gap: 4px; } .phead h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { .gring .fill { transition: none; } }

/* ---------- PDF (print) ---------- */
@page { size: A4 landscape; margin: 12mm; }
@media print {
  :root, :root.mgr[data-theme="dark"] { --bg: #FFFFFF; --surface: #FFFFFF; --ink: #2D2D3C; --muted: #5B6270; --line: #E3E7EC; --brand: #0BBBEF; --brand-ink: #0779A1; --brand-soft: #E3F6FD; --track: #E3E7EC; --pale: #F4F8FA; --shadow: none; }
  html, body { background: #fff; }
  .mbar, .tools, .noprint, .seg, .utabs, .filters, .demo, .toast, .dock, .ftop, button.btn, .btn { display: none !important; }
  .mmain { padding: 0; max-width: none; }
  .print-only { display: block !important; margin-top: 10px; }
  .print-head { display: flex !important; justify-content: space-between; align-items: center; border-bottom: 2px solid #0BBBEF; padding-bottom: 8px; margin-bottom: 6px; }
  .print-head img { height: 34px; width: auto; }
  .box, .kcard, .card { box-shadow: none; border: 1px solid #E3E7EC; break-inside: avoid; }
  .kgrid { grid-template-columns: repeat(3, 1fr); }
  .twrap { overflow: visible; border: 0; }
  table.t th { background: #CDEFFB !important; color: #2D2D3C; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .hbar .tr i, .bar > i, tr.total td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}
