/* pivi reporting app: same look as the staff web UI (gray page, white bordered panels, small radius), made touch-sized. Font: Tajawal. */
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/fonts/tajawal-arabic-500.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/fonts/tajawal-latin-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/fonts/tajawal-arabic-700.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/fonts/tajawal-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 800; font-display: swap; src: url('/static/fonts/tajawal-arabic-800.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 800; font-display: swap; src: url('/static/fonts/tajawal-latin-800.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
body.rapp { --bg: #F2F4F7; --head: #FFFFFF; --line: #E2E8F0; --line-soft: #EEF2F6; --accent: #0F2D4A; --accent-dark: #091E33; --accent-soft: #EBF1F8; --radius: 12px; --brand: #0F2D4A; --brand-soft: #EBF1F8; --muted: #64748B; --text: #0F172A; background: var(--bg); font-family: 'Tajawal', 'Plex Arabic', 'Segoe UI', Tahoma, Arial, sans-serif; font-weight: 500; font-size: 16px; line-height: 1.5; overscroll-behavior: contain; -webkit-tap-highlight-color: transparent; color: var(--text); }
.rapp button, .rapp input, .rapp textarea { font-size: 16px; font-family: inherit; }   /* 16px stops iOS from zooming into fields */

.rbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid rgba(15, 23, 42, .08); display: flex; align-items: center; justify-content: center; padding: calc(6px + env(safe-area-inset-top)) 16px 6px; min-height: 54px; }
.rbar .brand-logo { height: 34px; margin: 0; }
.rchip { border: 1px solid var(--accent); background: #fff; color: var(--accent); border-radius: 999px; padding: 5px 14px; font-weight: 700; cursor: pointer; min-height: 34px; }
.rpending { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--yellow-bg); border-bottom: 1px solid var(--yellow-bd); color: var(--yellow-tx); padding: 10px 16px; font-weight: 700; }

.rmain { max-width: 520px; margin: 0 auto; padding: 14px 14px calc(104px + env(safe-area-inset-bottom)); }

/* sections: clean native mobile cards, one unified calm visual language */
.rpanel { background: #fff; border: 1px solid rgba(15, 23, 42, .06); border-radius: 16px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(15, 23, 42, .04); overflow: hidden; }
.rpanel > h2 { background: #fff; border-bottom: 1px solid var(--line-soft); padding: 13px 16px 11px; font-size: 16px; font-weight: 800; color: var(--text); display: flex; align-items: center; }
.rbody { padding: 14px 16px 4px; }
.rfield { margin-bottom: 16px; }
.rfield.rmissing { outline: 2px solid var(--bad); outline-offset: 4px; border-radius: 12px; }
.rlabel { font-weight: 700; font-size: 14px; color: #334155; margin-bottom: 7px; }
.rhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; min-height: 26px; }
.rhead .rlabel { margin-bottom: 0; }

.rinput { width: 100%; min-height: 48px; border: 1px solid #E2E8F0; border-radius: 12px; padding: 10px 14px; background: #F8FAFC; outline: none; color: var(--text); transition: border-color .15s, background .15s, box-shadow .15s; }
.rinput::placeholder { color: #94A3B8; opacity: 1; font-weight: 500; }
textarea.rinput { min-height: 92px; line-height: 1.55; resize: none; }
.rinput:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 45, 74, .1); }
.rinput:disabled { background: #F1F5F9; color: #94A3B8; }
.rdate { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 8px; }
.rdate .rinput { text-align: center; }
.rquick { display: flex; gap: 8px; margin-bottom: 10px; }
.rqbtn { flex: 1; min-height: 40px; border: 1px solid #E2E8F0; border-radius: 10px; background: #F8FAFC; color: var(--text); font-weight: 700; font-size: 14.5px; cursor: pointer; }
.rqbtn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.rqbtn:disabled { opacity: .45; cursor: default; }
.rdate-col { display: block; }
.rsub { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; text-align: center; }
.rdate-auto { background: #F8FAFC; color: var(--muted); font-weight: 700; }
.rdate-auto:focus { background: #fff; color: var(--text); }
.rdate-day { border-color: #CBD5E1; font-weight: 700; background: #fff; }
.rdate-hint { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: #FFF8E5; border: 1px solid #F3DF9E; color: #7C4A03; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.rdate-fix { border: 1px solid #B45309; background: #fff; color: #B45309; border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 700; cursor: pointer; }

/* choices: native iOS/Android segmented pills */
.rseg { display: grid; gap: 5px; padding: 4px; border: 0; border-radius: 12px; background: #F1F5F9; }
.rseg.c4 { grid-template-columns: repeat(4, 1fr); }
.rseg.c3 { grid-template-columns: repeat(3, 1fr); }
.rseg.c2 { grid-template-columns: 1fr 1fr; }
.rseg label { position: relative; display: block; }
.rseg input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.rseg span { display: flex; align-items: center; justify-content: center; min-height: 42px; height: 100%; padding: 6px 8px; text-align: center; font-weight: 700; font-size: 14.5px; color: #475569; border-radius: 9px; border: 0; transition: background .15s, color .15s, box-shadow .15s; }
.rseg input:checked + span { background: #fff; color: var(--brand); box-shadow: 0 1px 4px rgba(15, 23, 42, .12); }
.rseg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.rseg small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.rseg input:checked + span small { color: #475569; }
.rseg .two { flex-direction: column; }

/* small checkbox: "I don't know" */
.rtoggle { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.rtoggle input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.rtoggle span { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; color: #475569; padding: 2px 0; }
.rtoggle span::before { content: ""; width: 20px; height: 20px; border: 1.5px solid #94A3B8; border-radius: 6px; background: #fff; }
.rtoggle input:checked + span::before { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 10.5l3.6 3.6 7.4-7.6' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/15px no-repeat; border-color: var(--brand); }
.rtoggle input:focus-visible + span::before { outline: 2px solid var(--brand); outline-offset: 2px; }
.rnone { border: 0; background: none; padding: 0; font: inherit; }
.rnone span::before { display: none; }
.rnone span { color: var(--brand); text-decoration: underline; }

.rbtn { min-height: 50px; border-radius: 14px; border: 1px solid #CBD5E1; background: #fff; color: var(--text); font-weight: 700; padding: 0 18px; cursor: pointer; }
.rbtn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-size: 17px; font-weight: 800; box-shadow: 0 4px 12px rgba(15, 45, 74, .18); }
.rbtn.primary:active { background: var(--accent-dark); transform: scale(.99); }
.rbtn:disabled { opacity: .55; }
.rbtn.block { width: 100%; }

.rnav { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid rgba(15, 23, 42, .08); }
.rnav-in { max-width: 520px; margin: 0 auto; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); }
.rbarline { height: 3px; background: var(--line-soft); }
.rbarline i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s ease; }
.rmsg { background: var(--red-bg); border: 1px solid var(--red-bd); color: var(--red-tx); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; font-weight: 700; font-size: 14.5px; }

.rdone { text-align: center; padding-top: 26px; }
.rdone h1 { font-size: 25px; font-weight: 800; margin-bottom: 4px; }
.rlead { color: var(--muted); margin-bottom: 12px; }
.rdone .rbtn { width: 100%; margin-top: 10px; }
.rcheckmark { width: 84px; height: 84px; fill: none; stroke: var(--ok); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rcase { display: inline-block; direction: ltr; background: #fff; border: 1.5px dashed #94A3B8; border-radius: 12px; padding: 10px 18px; margin: 10px 0 14px; font-family: Consolas, monospace; font-size: 22px; font-weight: 700; letter-spacing: .5px; }

@media (min-width: 700px) { .rmain { padding-top: 20px; } }

/* ---------- locked down: no selecting, copying, dragging or zooming outside the form fields ---------- */
html, body.rapp { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.rapp *, .rapp *::before, .rapp *::after { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.rapp input, .rapp textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.rapp select { -webkit-user-select: none; user-select: none; }
.rapp img, .rapp svg { -webkit-user-drag: none; user-drag: none; pointer-events: none; }
.rapp a { -webkit-user-drag: none; }

.rhint { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.55; }

/* ---------- unified calm section headers (no rainbow pastel bars) ---------- */
.rnum { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 800; margin-inline-end: 9px; flex: 0 0 auto; }
/* semantic colours only where meaning matters (serious / recovered / fatal) */
.rpanel .rseg input[value="NON_SERIOUS"]:checked + span, .rpanel .rseg input[value="RECOVERED"]:checked + span { background: #15803D; color: #fff; }
.rpanel .rseg input[value="RECOVERING"]:checked + span { background: #2F7D4F; color: #fff; }
.rpanel .rseg input[value="NOT_RECOVERED"]:checked + span { background: #B45309; color: #fff; }
.rpanel .rseg input[value="SERIOUS"]:checked + span, .rpanel .rseg input[value="HOSPITALIZED"]:checked + span { background: #B42318; color: #fff; }
.rpanel .rseg input[value="FATAL"]:checked + span { background: #7F1D1D; color: #fff; }
.rpanel .rseg input[value="UNKNOWN"]:checked + span, .rpanel .rseg input[value="UNK"]:checked + span { background: #475569; color: #fff; }
.rpanel .rseg input[value="SERIOUS"]:checked + span small { color: #FDE2E2; }
.rnav.complete .rbarline i { background: #15803D; }
.rnav.complete .rbtn.primary { background: #15803D; border-color: #15803D; box-shadow: 0 4px 12px rgba(21, 128, 61, .22); }

/* compact dosage-form pill selector */
.rchips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.rchips label { position: relative; display: block; }
.rchips input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.rchips span { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 6px 8px; text-align: center; font-weight: 700; font-size: 13.5px; line-height: 1.25; border: 1px solid #E2E8F0; border-radius: 10px; background: #F8FAFC; color: #334155; transition: background .15s, border-color .15s, color .15s; }
.rchips input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.rchips input[value="UNK"]:checked + span { background: #475569; border-color: #475569; color: #fff; }
.rchips input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.rchips.sub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.rchips.sub label { flex: 1 1 auto; }
.rchips.sub span { min-height: 36px; font-size: 13px; padding: 4px 10px; background: #F8FAFC; }

/* compact native photo strip + bottom action sheet */
.rapp .hidden { display: none !important; }
.rphoto-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rphoto-pill { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 10px 16px; border: 1px solid #CBD5E1; border-radius: 12px; background: #F8FAFC; color: var(--brand); font-size: 15px; font-weight: 700; cursor: pointer; transition: background .15s, border-color .15s; }
.rphoto-pill:active { background: #EBF1F8; border-color: var(--brand); }
.rphoto-pill svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.rphoto-thumb { position: relative; width: 70px; height: 70px; border-radius: 12px; overflow: hidden; border: 1.5px solid var(--brand); background: #F8FAFC; flex-shrink: 0; }
.rphoto-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rphoto-del { position: absolute; top: 3px; inset-inline-end: 3px; z-index: 3; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(15, 23, 42, .82); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.rphoto-add { width: 70px; height: 70px; border-radius: 12px; border: 1.5px dashed #94A3B8; background: #F8FAFC; color: var(--brand); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.rphoto-add:active { background: #EBF1F8; border-color: var(--brand); }
.rphoto-add svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.rsheet-bg { position: fixed; inset: 0; z-index: 999; background: rgba(15, 23, 42, .48); display: flex; align-items: flex-end; justify-content: center; padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.rsheet { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 8px; }
.rsheet-card { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 12px 32px rgba(15, 23, 42, .22); }
.rsheet-head { padding: 12px 16px; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); border-bottom: 1px solid #E2E8F0; }
.rsheet-item { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 15px 16px; border: 0; border-bottom: 1px solid #F1F5F9; background: #fff; color: var(--brand); font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.rsheet-item:last-child { border-bottom: 0; }
.rsheet-item:active { background: #F1F5F9; }
.rsheet-ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.rsheet-cancel { width: 100%; padding: 14px 16px; border: 0; border-radius: 14px; background: #fff; color: #DC2626; font-family: inherit; font-size: 16px; font-weight: 800; cursor: pointer; box-shadow: 0 6px 18px rgba(15, 23, 42, .16); }
.rsheet-cancel:active { background: #FEF2F2; }
