/* 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: #EDEFF2; --head: #F4F5F7; --line: #D5D9E0; --line-soft: #E6E9EE; --accent: #1B5FC1; --accent-dark: #144B9A; --accent-soft: #E6EFFB; --radius: 3px; --brand: #0F2D4A; --brand-soft: #E3EAF2; 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; }
.rapp button, .rapp input, .rapp textarea { font-size: 16px; }   /* 16px stops iOS from zooming into fields */

.rbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: calc(2px + env(safe-area-inset-top)) 16px 2px; min-height: 50px; }
.rbar .brand-logo { height: 38px; margin: -2px 0; }
.rchip { border: 1px solid var(--accent); background: #fff; color: var(--accent); border-radius: var(--radius); padding: 4px 12px; font-weight: 700; cursor: pointer; min-height: 32px; }
.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: 8px 16px; font-weight: 700; }

.rmain { max-width: 560px; margin: 0 auto; padding: 12px 12px calc(92px + env(safe-area-inset-bottom)); }

/* sections: panel with a title strip, like the staff app */
.rpanel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.rpanel > h2 { background: var(--head); border-bottom: 1px solid var(--line); padding: 8px 12px; font-size: 16px; font-weight: 800; color: var(--text); }
.rbody { padding: 12px 12px 2px; }
.rfield { margin-bottom: 14px; }
.rfield.rmissing { outline: 2px solid var(--bad); outline-offset: 2px; border-radius: var(--radius); }
.rlabel { font-weight: 700; font-size: 14.5px; color: var(--muted); margin-bottom: 5px; }
.rhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; min-height: 26px; }
.rhead .rlabel { margin-bottom: 0; }

.rinput { width: 100%; min-height: 46px; border: 1px solid #A9B1BD; border-radius: var(--radius); padding: 8px 12px; background: #fff; outline: none; color: var(--text); }
.rinput::placeholder { color: #667286; opacity: 1; font-weight: 500; }
textarea.rinput { min-height: 84px; line-height: 1.5; resize: none; }
.rinput:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.rinput:disabled { background: var(--gray-bg); }
.rdate { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 8px; }
.rdate .rinput { text-align: center; }
.rquick { display: flex; gap: 8px; margin-bottom: 8px; }
.rqbtn { flex: 1; min-height: 38px; border: 1px solid #A9B1BD; border-radius: var(--radius); background: #fff; color: var(--text); font-weight: 700; font-size: 14.5px; cursor: pointer; }
.rqbtn.on { background: var(--c, var(--accent)); border-color: var(--c, var(--accent)); 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: 3px; text-align: center; }
.rdate-auto { background: #F8F9FB; color: var(--muted); font-weight: 700; }
.rdate-auto:focus { background: #fff; color: var(--text); }
.rdate-day { border-color: var(--c, var(--accent)); font-weight: 700; }
.rdate-hint { margin-top: 7px; padding: 6px 9px; border-radius: var(--radius); background: #FFF8E5; border: 1px solid #E8D9A8; color: #6E4005; 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 #B4460F; background: #fff; color: #B4460F; border-radius: var(--radius); padding: 3px 10px; font-size: 13px; font-weight: 700; cursor: pointer; }

/* choices: one joined strip, the chosen one is filled */
.rseg { display: grid; border: 1px solid #A9B1BD; border-radius: var(--radius); overflow: hidden; background: #fff; }
.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: 46px; height: 100%; padding: 4px 6px; text-align: center; font-weight: 700; font-size: 15.5px; border-inline-start: 1px solid var(--line); border-top: 1px solid var(--line); margin-top: -1px; }
.rseg label:first-child span { border-inline-start: 0; }
.rseg.c3 label:nth-child(3n+1) span { border-inline-start: 0; }
.rseg input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.rseg input:focus-visible + span { outline: 3px solid #7FA8E0; outline-offset: -3px; }
.rseg small { display: block; font-weight: 500; font-size: 12.5px; color: var(--muted); }
.rseg input:checked + span small { color: #DCE8FA; }
.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: 14.5px; color: var(--text); padding: 2px 0; }
.rtoggle span::before { content: ""; width: 20px; height: 20px; border: 1.5px solid #8A95A5; border-radius: 3px; background: #fff; }
.rtoggle input:checked + span::before { background: var(--accent) 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/16px no-repeat; border-color: var(--accent); }
.rtoggle input:focus-visible + span::before { outline: 3px solid #7FA8E0; outline-offset: 1px; }
.rnone { border: 0; background: none; padding: 0; font: inherit; }
.rnone span::before { display: none; }
.rnone span { color: var(--accent); text-decoration: underline; }

.rbtn { min-height: 48px; border-radius: var(--radius); border: 1px solid #A9B1BD; background: #fff; color: var(--text); font-weight: 700; padding: 0 18px; cursor: pointer; }
.rbtn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-size: 18px; font-weight: 800; }
.rbtn.primary:active { background: var(--accent-dark); }
.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 var(--line); }
.rnav-in { max-width: 560px; margin: 0 auto; padding: 9px 12px calc(10px + env(safe-area-inset-bottom)); }
.rbarline { height: 3px; background: var(--line-soft); }
.rbarline i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.rmsg { background: var(--red-bg); border: 1px solid var(--red-bd); color: var(--red-tx); border-radius: var(--radius); padding: 6px 10px; margin-bottom: 8px; font-weight: 700; font-size: 15px; }

.rdone { text-align: center; padding-top: 26px; }
.rdone h1 { font-size: 26px; 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: 1px dashed #8A95A5; border-radius: var(--radius); 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: #5B6573; margin-top: 6px; line-height: 1.6; }

/* ---------- small colour touches: each section a soft colour and its number; choices coloured by meaning ---------- */
.s-who     { --c: #1B5FC1; --c-soft: #EEF3FB; --c-line: #C9D8F0; }
.s-drug    { --c: #0E7C66; --c-soft: #ECF6F2; --c-line: #C4E2D8; }
.s-event   { --c: #B4460F; --c-soft: #FBF1EB; --c-line: #EDD2C2; }
.s-patient { --c: #6D3FB8; --c-soft: #F3EFFA; --c-line: #DCD0F0; }
.rpanel[class*="s-"] > h2 { background: var(--c-soft); color: var(--c); border-bottom-color: var(--c-line); display: flex; align-items: center; }
.rnum { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; font-size: 13px; font-weight: 800; margin-inline-end: 8px; flex: 0 0 auto; }
.rpanel[class*="s-"] .rinput:focus { border-color: var(--c); box-shadow: 0 0 0 2px var(--c-soft); }
.rpanel[class*="s-"] .rseg input:checked + span { background: var(--c); border-color: var(--c); color: #fff; }
.rpanel[class*="s-"] .rtoggle input:checked + span::before { background-color: var(--c); border-color: var(--c); }
.rpanel[class*="s-"] .rnone span { color: var(--c); }
/* the meaning of the answer wins over the section colour */
.rpanel .rseg input[value="NON_SERIOUS"]:checked + span, .rpanel .rseg input[value="RECOVERED"]:checked + span { background: #15803D; border-color: #15803D; color: #fff; }
.rpanel .rseg input[value="RECOVERING"]:checked + span { background: #2F7D4F; border-color: #2F7D4F; color: #fff; }
.rpanel .rseg input[value="NOT_RECOVERED"]:checked + span { background: #B45309; border-color: #B45309; color: #fff; }
.rpanel .rseg input[value="SERIOUS"]:checked + span, .rpanel .rseg input[value="HOSPITALIZED"]:checked + span { background: #B42318; border-color: #B42318; color: #fff; }
.rpanel .rseg input[value="FATAL"]:checked + span { background: #7F1D1D; border-color: #7F1D1D; color: #fff; }
.rpanel .rseg input[value="UNKNOWN"]:checked + span, .rpanel .rseg input[value="UNK"]:checked + span { background: #4B5563; border-color: #4B5563; 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; }
.rbarline { height: 4px; }

.rseg.c2 label:nth-child(2n+1) span { border-inline-start: 0; }

/* compact dosage-form pill selector */
.rchips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.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: 38px; padding: 5px 8px; text-align: center; font-weight: 700; font-size: 14px; line-height: 1.25; border: 1px solid #A9B1BD; border-radius: var(--radius); background: #fff; color: var(--text); }
.rpanel[class*="s-"] .rchips input:checked + span { background: var(--c); border-color: var(--c); color: #fff; }
.rpanel .rchips input[value="UNK"]:checked + span { background: #4B5563; border-color: #4B5563; color: #fff; }
.rchips input:focus-visible + span { outline: 3px solid #7FA8E0; outline-offset: -2px; }
.rchips.sub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--c-line, var(--line)); }
.rchips.sub label { flex: 1 1 auto; }
.rchips.sub span { min-height: 34px; font-size: 13px; padding: 4px 10px; background: #F8FAFC; }
