/* SPJP components and app shell. Colours and sizes come from static/css/tokens.css (design/tokens.json). */
:root { --vz-primary: var(--brand); --bs-primary: var(--brand); --bs-primary-rgb: 15,107,79; }
.spjp, .spjp body { background: var(--surface-2); color: var(--ink); font-family: var(--font-body); }
.spjp h1, .spjp h2, .spjp h3, .spjp .display { font-family: var(--font-display); color: var(--ink); }
.btn-primary, .btn-primary:hover, .btn-primary:focus { background: var(--brand) !important; border-color: var(--brand) !important; color: var(--brand-ink) !important; }
.btn-outline-primary { color: var(--brand) !important; border-color: var(--brand) !important; }
.btn-outline-primary:hover { background: var(--brand-tint) !important; }
.text-brand { color: var(--brand) !important; } .bg-brand-tint { background: var(--brand-tint) !important; }
a { color: var(--brand); }

/* status pills: fixed words, fixed colours */
.sp-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; padding: 3px 12px; border-radius: var(--radius-pill); white-space: nowrap; }
.sp-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sp-pill.done { background: var(--brand-tint); color: var(--brand); }
.sp-pill.pending { background: var(--pending-tint); color: var(--pending); }
.sp-pill.missing { background: var(--alert-tint); color: var(--alert); }
.sp-pill.info { background: var(--info-tint); color: var(--info); }
.sp-pill.muted { background: var(--surface-2); color: var(--ink-muted); }

.sp-role { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: var(--radius-sm); border: 1.5px solid currentColor; }
.sp-role { color: var(--ink-muted); } /* role colours retired (DIRECTION.md rule 1) */

/* checklist rows */
.sp-check { display: flex; align-items: center; gap: var(--space-3); min-height: 64px; padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); font-size: 18px; color: var(--ink); text-decoration: none; }
.sp-check:hover { color: var(--ink); border-color: var(--brand); }
.sp-check .box { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.sp-check.done .box { background: var(--brand); color: var(--brand-ink); }
.sp-check.pending .box { border: 2.5px solid var(--pending); color: var(--pending); }
.sp-check.todo .box { border: 2.5px solid var(--pending); color: var(--pending); }
.sp-check.missing .box { border: 2.5px solid var(--alert); color: var(--alert); }
.sp-check.waived .box { border: 2.5px solid var(--ink-muted); color: var(--ink-muted); }
.sp-check .txt { flex: 1; display: grid; line-height: 1.3; }
.sp-check .txt small { font-size: 15px; color: var(--ink-muted); }
.sp-check .go { color: var(--ink-muted); font-size: 22px; }

/* QR card (always light: it is printed) */
.sp-qr { width: 100%; max-width: 340px; border: 2px solid #0f6b4f; border-radius: var(--radius-lg); overflow: hidden; background: #fff; color: #17211d; margin: 0 auto; }
.sp-qr .top { background: #0f6b4f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cg fill='%23ffffff' fill-opacity='0.16' transform='translate(12 12)'%3E%3Crect x='-5' y='-5' width='10' height='10'/%3E%3Crect x='-5' y='-5' width='10' height='10' transform='rotate(45)'/%3E%3C/g%3E%3C/svg%3E") repeat; color: #fff; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; font-family: var(--font-display); font-weight: 800; }
.sp-qr .jawi { font-family: var(--font-arabic); font-weight: 400; font-size: 15px; margin-left: 8px; display: inline-block; }
.sp-qr .body { padding: 14px; display: grid; grid-template-columns: 1fr 120px; gap: 12px; align-items: center; }
.sp-qr .name { font-family: var(--font-display); font-weight: 800; font-size: 19px; line-height: 1.15; }
.sp-qr .meta { font-size: 13px; color: #56625d; }
.sp-qr .code img, .sp-qr .code svg { width: 120px; height: 120px; display: block; }
.sp-qr .foot { border-top: 1px dashed #dfe6e2; padding: 8px 14px; font-size: 13px; font-weight: 600; }

/* alert banner */
.sp-alert { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--alert-tint); color: var(--ink); border: 1.5px solid var(--alert); }
.sp-alert .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--alert); flex: none; }
.sp-alert .t { flex: 1; display: grid; min-width: 0; }
.sp-alert .t b { color: var(--alert); } .sp-alert .t small { color: var(--ink-muted); font-size: 14px; }
.sp-alert.info { background: var(--info-tint); border-color: var(--info); } .sp-alert.info .dot { background: var(--info); } .sp-alert.info .t b { color: var(--info); }
.sp-alert.closed { background: var(--surface); border-color: var(--line); } .sp-alert.closed .dot { background: var(--ink-muted); } .sp-alert.closed .t b { color: var(--ink-muted); }
.sp-alert.done { background: var(--brand-tint); border-color: transparent; } .sp-alert.done .dot { background: var(--brand); } .sp-alert.done .t b { color: var(--brand); }
.sp-alert.ack { background: var(--pending-tint); border-color: var(--pending); } .sp-alert.ack .dot { background: var(--pending); } .sp-alert.ack .t b { color: var(--pending); }

/* number cards */
.sp-stat { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4); display: grid; gap: 2px; background: var(--surface); height: 100%; color: var(--ink); text-decoration: none; }
a.sp-stat:hover { border-color: var(--brand); color: var(--ink); }
.sp-stat .n { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sp-stat .l { font-size: 14px; color: var(--ink-muted); }
.sp-stat.ready .n { color: var(--brand); } .sp-stat.pending .n { color: var(--pending); } .sp-stat.alert .n { color: var(--alert); }

.sp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.sp-muted { color: var(--ink-muted); }
.sp-label { font-size: 14px; font-weight: 700; color: var(--ink-muted); }
.sp-arabic { font-family: var(--font-arabic); font-size: 24px; line-height: 1.75; direction: rtl; }
.sp-progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.sp-progress > span { display: block; height: 100%; background: var(--brand); }
.sp-pattern { background: #0f6b4f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg fill='%23ffffff' fill-opacity='0.08' transform='translate(16 16)'%3E%3Crect x='-7' y='-7' width='14' height='14'/%3E%3Crect x='-7' y='-7' width='14' height='14' transform='rotate(45)'/%3E%3C/g%3E%3C/svg%3E") repeat; color: #fff; }

/* phone app shell (Jemaah, Waris, Mutawwif) */
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--surface-2); padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
.app-top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px max(16px, env(safe-area-inset-left, 0px)); display: flex; align-items: center; gap: 10px; min-height: 56px; }
.app-top h1 { font-size: 21px; font-weight: 800; margin: 0; flex: 1; letter-spacing: -0.01em; }
.app-top .back { font-size: 24px; color: var(--ink); text-decoration: none; }
.app-body { padding: 16px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 14px; }
.app.big { font-size: 18px; }
.app.big .btn { min-height: var(--touch-min); font-size: 18px; font-weight: 700; border-radius: var(--radius-md); }
.app .btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.app .form-control, .app .form-select { min-height: 48px; font-size: 17px; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.bottom-nav .in { max-width: 560px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.bottom-nav a { min-height: 62px; display: grid; place-items: center; align-content: center; gap: 2px; font-size: 14px; font-weight: 600; color: var(--ink-muted); text-decoration: none; position: relative; }
.bottom-nav a i { font-size: 24px; line-height: 1; }
.bottom-nav a.on { color: var(--brand); }
.bottom-nav a .badge { position: absolute; top: 6px; right: calc(50% - 22px); }
.sos-fab { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 40; width: var(--touch-sos); height: var(--touch-sos); border-radius: 50%; background: var(--alert); color: #fff; border: 4px solid var(--surface); box-shadow: var(--shadow-float); font-family: var(--font-display); font-weight: 800; font-size: 20px; display: grid; place-items: center; text-decoration: none; }
.sos-fab:hover { color: #fff; }

/* public site */
.pub-nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.pub-nav .navbar-brand img { height: 46px; }
.pub-hero { padding: 64px 0 48px; }
.pub-section { padding: 48px 0; }
.pub-foot { background: #0b2a20; color: #cfe3da; padding: 32px 0; font-size: 14px; }
.pub-foot a { color: #fff; }
.pkg-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.pkg-card .ph { height: 150px; background-size: cover; background-position: center; }
.pkg-card .b { padding: 16px; display: grid; gap: 6px; flex: 1; }
.verified { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 700; }
.not-verified { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-muted); font-weight: 700; }
.step-dots { display: flex; gap: 6px; } .step-dots span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); } .step-dots span.on { background: var(--brand); }
.map-box { height: 420px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); }
@media print { .no-print { display: none !important; } body { background: #fff !important; } }

/* The phone shell loads Bootstrap without the admin theme, so the theme variables Bootstrap reads are set here from the tokens. */
.spjp {
  --vz-body-bg: var(--surface-2); --vz-body-color: var(--ink); --vz-border-color: var(--line); --vz-input-border: var(--line);
  --vz-input-bg: var(--surface); --vz-input-border-custom: var(--line); --vz-secondary-color: var(--ink-muted);
  --vz-primary: var(--brand); --vz-primary-rgb: 15,107,79; --vz-link-color: var(--brand); --vz-heading-color: var(--ink);
  --vz-card-bg: var(--surface); --vz-light: var(--surface-2); --vz-light-rgb: 244,247,245; --vz-dark: var(--ink);
}
.app .form-control, .app .form-select, .app select.form-control { display: block; width: 100%; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); }
.app .form-control:focus, .app .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); outline: 0; }
.app .form-control::placeholder { color: var(--ink-muted); }
.app .form-label { font-weight: 600; margin-bottom: 4px; }
.app .form-check-input { border: 2px solid var(--ink-muted); background-color: var(--surface); }
.app .form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.btn-soft-primary { background: var(--brand-tint); color: var(--brand); border: 0; }
.btn-soft-success { background: var(--brand-tint); color: var(--brand); border: 0; }
.btn-soft-secondary { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn-soft-danger { background: var(--alert-tint); color: var(--alert); border: 0; }
.app .btn-outline-secondary { color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
.app .btn-outline-danger { color: var(--alert); border: 1px solid var(--alert); background: var(--surface); }
.app .btn-warning { background: var(--pending); color: #fff; border: 0; }
.app .btn-sm { min-height: 40px; }
.app details > summary { cursor: pointer; }
.app .table { --bs-table-bg: transparent; }
.spjp .form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.spjp .form-check-input:focus { box-shadow: 0 0 0 3px var(--brand-tint); border-color: var(--brand); }
.nowrap { white-space: nowrap; }

/* nav pills / tabs in brand (no template navy) */
.spjp .nav-pills .nav-link { color: var(--ink-muted); font-weight: 600; border-radius: 8px; }
.spjp .nav-pills .nav-link.active, .spjp .nav-pills .show > .nav-link { background: var(--brand-tint); color: var(--brand); }
.spjp .bg-primary { background-color: var(--brand) !important; } .spjp .text-primary { color: var(--brand) !important; }
.spjp .btn-dark { background: var(--ink); border-color: var(--ink); }

/* scrolled-to buttons never sit under the fixed title bar or tab bar (A-Z U16) */
html:has(.bottom-nav) { scroll-padding-bottom: 96px; scroll-padding-top: 72px; }
