/* Organizer (mobile-first, one hand in a dark mosque: big targets), Guardian pages and Admin (English-only). */

/* ---------- Shared app pieces ---------- */
.validation-summary-valid { display: none; }
.rf-auth { max-width: 480px; padding-block: clamp(1.5rem, 5vw, 3rem); }
.rf-narrow { max-width: 560px; margin-inline: auto; }
.rf-grow { flex: 1 1 auto; min-width: 0; }
.rf-pre { white-space: pre-line; }
html[dir="rtl"] .rf-flip { transform: scaleX(-1); }
.rf-big-icon { font-size: 3rem; color: var(--rf-success); }
.rf-code { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.rf-key { font-size: 1rem; word-break: break-all; }
.rf-qr { image-rendering: pixelated; border: 8px solid #fff; border-radius: .5rem; box-shadow: 0 0 0 1px var(--rf-line); }
.rf-recovery { columns: 2; list-style: none; padding: 0; margin: 1rem 0; font-size: 1.1rem; }
.rf-recovery code { color: var(--rf-navy); }
.rf-checks { margin: 1.25rem 0; padding: 1rem; border: 1px solid var(--rf-line); border-radius: .85rem; background: var(--rf-cream); }
.rf-checks .form-check { margin-bottom: .55rem; }
.rf-steps-list li { margin-bottom: .75rem; }
.rf-important { padding: .75rem .75rem .75rem 2.25rem; border: 1px dashed var(--rf-amber-600); border-radius: .75rem; background: #FFF8EA; }
.rf-status { padding: .5em .85em; border-radius: 999px; font-weight: 700; }
.rf-status--active { background: var(--rf-success); color: #fff; }
.rf-status--pending { background: var(--rf-amber); color: var(--rf-navy); }
.rf-status--suspended, .rf-status--rejected { background: var(--rf-danger); color: #fff; }
.rf-steps { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.rf-steps li { color: var(--rf-muted); }
.rf-steps li .bi { color: var(--rf-line); }
.rf-steps li.is-done { color: var(--rf-ink); }
.rf-steps li.is-done .bi { color: var(--rf-success); }

/* Fajr window card */
.rf-window { border-inline-start: 6px solid var(--rf-line); }
.rf-window.is-open { border-inline-start-color: var(--rf-success); }
.rf-window__times { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .75rem; text-align: center; }
.rf-window__times span { display: block; font-size: .8rem; color: var(--rf-muted); }
.rf-window__times strong { font-family: var(--rf-font-display); font-size: clamp(1.3rem, 5vw, 1.8rem); color: var(--rf-navy); font-variant-numeric: tabular-nums; }

/* Big action buttons */
.rf-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.rf-action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; min-height: 6.5rem; padding: 1rem; border-radius: var(--rf-radius); background: var(--rf-navy); color: var(--rf-cream); text-decoration: none; font-weight: 700; text-align: center; }
.rf-action .bi { font-size: 2rem; color: var(--rf-amber); }
.rf-action:hover, .rf-action:focus-visible { background: var(--rf-navy-700); color: #fff; }

/* Stats and the 7-day bars (heights via classes: no inline styles under the CSP) */
.rf-stat { display: flex; flex-direction: column; align-items: center; padding: .9rem .5rem; border: 1px solid var(--rf-line); border-radius: var(--rf-radius); background: var(--rf-white); text-decoration: none; color: var(--rf-ink); text-align: center; height: 100%; }
.rf-stat strong { font-family: var(--rf-font-display); font-size: 1.8rem; color: var(--rf-navy); }
.rf-stat span { font-size: .8rem; color: var(--rf-muted); }
.rf-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; align-items: end; height: 150px; }
.rf-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .25rem; }
.rf-bar__fill { width: 70%; min-height: 3px; border-radius: .4rem .4rem 0 0; background: var(--rf-navy); }
.rf-bar.is-low .rf-bar__fill { background: var(--rf-amber); }
.rf-bar__n { font-size: .8rem; font-weight: 700; color: var(--rf-navy); }
.rf-bar__d { font-size: .75rem; color: var(--rf-muted); }
.rf-h0 { height: 3px; } .rf-h1 { height: 10%; } .rf-h2 { height: 18%; } .rf-h3 { height: 26%; } .rf-h4 { height: 34%; } .rf-h5 { height: 42%; }
.rf-h6 { height: 50%; } .rf-h7 { height: 58%; } .rf-h8 { height: 64%; } .rf-h9 { height: 70%; } .rf-h10 { height: 76%; }
.rf-progress { height: .5rem; border-radius: 999px; background: var(--rf-line); overflow: hidden; margin-top: .35rem; }
.rf-progress span { display: block; height: 100%; background: var(--rf-success); }
.rf-w0 { width: 0; } .rf-w1 { width: 10%; } .rf-w2 { width: 20%; } .rf-w3 { width: 30%; } .rf-w4 { width: 40%; } .rf-w5 { width: 50%; }
.rf-w6 { width: 60%; } .rf-w7 { width: 70%; } .rf-w8 { width: 80%; } .rf-w9 { width: 90%; } .rf-w10 { width: 100%; }

/* Lists */
.rf-list { display: grid; gap: .5rem; }
.rf-list__item { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border: 1px solid var(--rf-line); border-radius: .85rem; background: var(--rf-white); }
.rf-team li { padding: .4rem 0; border-bottom: 1px solid var(--rf-line); }
.rf-team li:last-child { border-bottom: 0; }
.rf-board { padding-inline-start: 1.5rem; }
.rf-board li { padding: .45rem 0; border-bottom: 1px solid var(--rf-line); }
.rf-board li span { display: block; font-size: .85rem; color: var(--rf-muted); }
.rf-notice { border-inline-start: 6px solid var(--rf-amber); }
.rf-lesson { background: #FFF8EA; }
.rf-invite { border-inline-start: 6px solid var(--rf-amber); }
.rf-empty { padding-block: 2.5rem; }

/* Form controls */
.rf-months { display: flex; flex-wrap: wrap; gap: .4rem; }
.rf-month { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .6rem; border: 1px solid var(--rf-line); border-radius: 999px; background: var(--rf-white); cursor: pointer; }
.rf-modes { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.rf-mode { display: grid; gap: .2rem; padding: 1rem 1rem 1rem 2.5rem; position: relative; border: 2px solid var(--rf-line); border-radius: var(--rf-radius); background: var(--rf-white); cursor: pointer; }
.rf-mode input { position: absolute; inset-inline-start: 1rem; top: 1.2rem; }
.rf-mode span { font-size: .9rem; color: var(--rf-muted); }
.rf-mode:has(input:checked) { border-color: var(--rf-navy); box-shadow: 0 0 0 3px rgba(244, 166, 42, .35); }
.rf-mode.is-disabled { opacity: .5; cursor: not-allowed; }
.rf-segmented { display: flex; flex-wrap: wrap; gap: .4rem; }
.rf-segmented label { display: inline-flex; align-items: center; gap: .35rem; padding: .55rem .9rem; border: 1px solid var(--rf-line); border-radius: 999px; background: var(--rf-white); cursor: pointer; font-weight: 600; }
.rf-segmented label:has(input:checked) { border-color: var(--rf-navy); background: var(--rf-navy); color: var(--rf-cream); }
.rf-count__input { max-width: 220px; font-size: 3rem; text-align: center; font-family: var(--rf-font-display); font-weight: 700; }
.rf-count__closed { font-size: 1.2rem; color: var(--rf-muted); }
.rf-map { height: 360px; border-radius: var(--rf-radius); border: 1px solid var(--rf-line); z-index: 0; }
.rf-map--picker { height: 320px; }
.rf-grid th, .rf-grid td { white-space: nowrap; }

/* Tick list */
.rf-ticks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.rf-tick { display: flex; align-items: center; gap: .5rem; min-height: 3.5rem; padding: .6rem .9rem; border: 2px solid var(--rf-line); border-radius: .9rem; background: var(--rf-white); font-weight: 700; color: var(--rf-ink); text-align: start; }
.rf-tick .bi { font-size: 1.4rem; color: var(--rf-line); }
.rf-tick.is-on { border-color: var(--rf-success); background: #EAF6EF; }
.rf-tick.is-on .bi { color: var(--rf-success); }

/* Scan page: dark by default, big camera view, big result */
.rf-scan { display: flex; flex-direction: column; gap: .75rem; margin: -1.5rem calc(var(--bs-gutter-x) * -.5) 0; padding: 1rem; min-height: calc(100vh - 8rem); background: var(--rf-navy-900); color: var(--rf-cream); }
.rf-scan__top, .rf-scan__bottom { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.rf-scan__count { text-align: center; }
.rf-scan__count span { display: block; font-family: var(--rf-font-display); font-size: 2.2rem; line-height: 1; color: var(--rf-amber); }
.rf-scan__count small { color: var(--rf-dawn); }
.rf-scan__camera { flex: 1; display: flex; align-items: center; justify-content: center; border-radius: var(--rf-radius); overflow: hidden; background: #000; min-height: 320px; }
.rf-scan__camera #rfReader { width: 100%; max-width: 560px; }
.rf-scan__result { min-height: 4.5rem; display: flex; align-items: center; justify-content: center; padding: .75rem 1rem; border-radius: var(--rf-radius); font-size: 1.5rem; font-weight: 700; text-align: center; transition: background .2s; }
.rf-scan__result.is-ok { background: var(--rf-success); color: #fff; }
.rf-scan__result.is-info { background: var(--rf-dawn); color: var(--rf-navy); }
.rf-scan__result.is-warn { background: var(--rf-amber); color: var(--rf-navy); }
.rf-scan__result.is-error { background: var(--rf-danger); color: #fff; }
.rf-geo--ok { color: #7BD6A3; }
.rf-geo--far { color: var(--rf-amber); }

/* Guardian calendar */
.rf-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; text-align: center; }
.rf-cal__h { font-size: .75rem; color: var(--rf-muted); }
.rf-cal__d { padding: .45rem 0; border-radius: .5rem; background: var(--rf-white); border: 1px solid var(--rf-line); font-variant-numeric: tabular-nums; }
.rf-cal__d.is-on { background: var(--rf-navy); border-color: var(--rf-navy); color: var(--rf-cream); font-weight: 700; }
.rf-cal__d.is-today { box-shadow: 0 0 0 2px var(--rf-amber); }
.rf-cal__d.is-empty { background: transparent; border-color: transparent; }
.rf-toggle { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem; border: 1px solid var(--rf-line); border-radius: .85rem; background: var(--rf-white); margin-bottom: .6rem; }
.rf-toggle .form-check-input { width: 2.6em; height: 1.4em; margin: .1rem 0 0; flex: none; }
.rf-toggle span { display: block; font-size: .85rem; color: var(--rf-muted); }

/* ---------- Organizer layout ---------- */
.rf-org { min-height: 100vh; padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
.rf-org__bar { color: var(--rf-cream); background: var(--rf-navy); }
.rf-org__bar > .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.75rem; }
.rf-org__brand { display: inline-flex; align-items: center; gap: .6rem; font-family: "Outfit", sans-serif; font-size: 1.15rem; font-weight: 700; color: var(--rf-cream); text-decoration: none; }
.rf-org__brand:hover { color: var(--rf-cream); }
.rf-org__mosque { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-org__main { padding-block: 1.5rem; }
.rf-org__nav { position: fixed; bottom: 0; inset-inline: 0; z-index: 1030; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding-bottom: env(safe-area-inset-bottom); background: var(--rf-white); border-top: 1px solid var(--rf-line); }
.rf-org__nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 3.75rem; padding: .4rem .25rem; font-size: .78rem; font-weight: 600; color: var(--rf-muted); text-decoration: none; }
.rf-org__nav a .bi { font-size: 1.4rem; line-height: 1; }
.rf-org__nav a.active { color: var(--rf-navy); box-shadow: inset 0 3px 0 var(--rf-amber); }
@media (min-width: 992px) {
    .rf-org { padding-bottom: 0; }
    .rf-org__nav { position: sticky; top: 0; display: flex; justify-content: center; gap: .25rem; padding: 0; border-top: 0; border-bottom: 1px solid var(--rf-line); }
    .rf-org__nav a { flex-direction: row; gap: .5rem; min-height: 0; padding: .85rem 1.1rem; font-size: .95rem; }
    .rf-org__nav a .bi { font-size: 1.1rem; }
    .rf-org__nav a.active { box-shadow: inset 0 -3px 0 var(--rf-amber); }
    .rf-scan { margin: 0; border-radius: var(--rf-radius); min-height: 70vh; }
}

/* ---------- Admin ---------- */
.rf-admin { min-height: 100vh; background: #F4F1EA; }
#adminSidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 1040; width: 250px; overflow-y: auto; padding: 1rem .75rem 2rem; color: var(--rf-cream); background: var(--rf-navy); }
.rf-admin__brand { display: flex; align-items: center; gap: .65rem; padding: .25rem .5rem 1rem; font-family: "Outfit", sans-serif; font-size: 1.15rem; font-weight: 700; line-height: 1.1; color: var(--rf-cream); text-decoration: none; }
.rf-admin__brand small { display: block; font-family: var(--rf-font-body); font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--rf-dawn); }
.rf-admin__brand:hover { color: var(--rf-cream); }
.rf-side-head { margin: 1.1rem .8rem .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rf-dawn); }
#adminSidebar .nav-link { display: flex; align-items: center; gap: .65rem; padding: .55rem .8rem; border-radius: .6rem; font-weight: 600; color: rgba(251, 248, 242, .82); }
#adminSidebar .nav-link:hover { color: #FFFFFF; background: rgba(255, 255, 255, .08); }
#adminSidebar .nav-link.active { color: var(--rf-navy); background: var(--rf-amber); }
.rf-admin__main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; margin-inline-start: 250px; }
.rf-admin__top { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.5rem; background: var(--rf-white); border-bottom: 1px solid var(--rf-line); }
.rf-admin__content { flex: 1; padding: 1.5rem; }
.rf-admin__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .9rem 1.5rem; font-size: .85rem; color: var(--rf-muted); background: var(--rf-white); border-top: 1px solid var(--rf-line); }
.rf-admin .table { --bs-table-bg: var(--rf-white); }
.rf-flag { border-inline-start: 4px solid var(--rf-danger); }
@media (max-width: 991.98px) {
    #adminSidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
    #adminSidebar.is-open { transform: none; }
    .rf-admin__main { margin-inline-start: 0; }
}
.rf-card--soft { background: var(--rf-cream); box-shadow: none; }
/* My Fajr calendar: mosque = navy (is-on), home = dawn, verified at the mosque = green ring */
.rf-cal__d.is-home { background: var(--rf-dawn); border-color: var(--rf-dawn); color: var(--rf-ink); font-weight: 700; }
.rf-cal__d.is-verified { box-shadow: inset 0 0 0 3px var(--rf-success); }
.rf-cal__d.is-verified.is-today { box-shadow: inset 0 0 0 3px var(--rf-success), 0 0 0 2px var(--rf-amber); }
.rf-dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; vertical-align: -.1rem; }
.rf-dot--mosque { background: var(--rf-navy); }
.rf-dot--home { background: var(--rf-dawn); }
.rf-dot--verified { background: transparent; box-shadow: inset 0 0 0 3px var(--rf-success); }
