/* =====================================================================
   At-Taufiq Mosque Portal — public stylesheet
   Mobile-first, no external fonts or frameworks (fast on shared hosting).
   ===================================================================== */
:root {
    --green-900: #0b3d26;
    --green-800: #0f5132;
    --green-700: #146c43;
    --green-100: #e3f1e8;
    --green-50:  #f1f8f3;
    --gold:      #c9a227;
    --gold-dark: #a5831a;
    --cream:     #faf8f2;
    --ink:       #1d2a22;
    --muted:     #5d6b63;
    --line:      #dfe5e0;
    --white:     #fff;
    --danger:    #b42318;
    --danger-bg: #fdecea;
    --warning:   #8a5a00;
    --warning-bg:#fff4dc;
    --info-bg:   #e8f1fb;
    --info:      #1f4e85;
    --radius:    14px;
    --shadow:    0 6px 24px rgba(15, 81, 50, .08);
    --font:      system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-ar:   "Amiri", "Scheherazade New", "Traditional Arabic", "Noto Naskh Arabic", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.0625rem;           /* 17px: readable for all ages */
    line-height: 1.65;
    color: var(--ink);
    background: var(--cream);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-700); text-underline-offset: 3px; }
a:hover { color: var(--green-900); }
h1, h2, h3, h4 { line-height: 1.25; color: var(--green-900); margin: 0 0 .6em; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); }
h3, .h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .875rem; }
code { background: var(--green-50); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.container { width: min(1180px, 100% - 2rem); margin-inline: auto; }
.narrow { max-width: 760px; margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.is-hidden, [hidden] { display: none !important; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--gold); color: #000; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Header ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 72px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--green-900); margin-right: auto; }
.brand img { width: 44px; height: 44px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1rem; }
.brand-text small { color: var(--muted); font-size: .78rem; display: none; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch a { padding: .35rem .8rem; text-decoration: none; font-weight: 600; font-size: .9rem; color: var(--green-800); }
.lang-switch a.active { background: var(--green-800); color: var(--white); }
.nav-toggle { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after { display: block; width: 22px; height: 2px; background: var(--green-900); position: relative; content: ""; transition: .2s; }
.nav-toggle-bar::before { position: absolute; top: -7px; }
.nav-toggle-bar::after { position: absolute; top: 7px; }
.nav-open .nav-toggle-bar { background: transparent; }
.nav-open .nav-toggle-bar::before { top: 0; transform: rotate(45deg); }
.nav-open .nav-toggle-bar::after { top: 0; transform: rotate(-45deg); }
.main-nav { width: 100%; display: none; }
.nav-open .main-nav { display: block; }
.main-nav ul { list-style: none; margin: 0; padding: 0 0 1rem; }
.main-nav a { display: block; padding: .8rem .5rem; text-decoration: none; color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--line); }
.main-nav a.active { color: var(--green-700); }

@media (min-width: 640px) { .brand-text small { display: block; } }
@media (min-width: 1000px) {
    .nav-toggle { display: none; }
    .main-nav { display: block; width: auto; order: 2; }
    .lang-switch { order: 3; }
    .main-nav ul { display: flex; gap: .2rem; padding: 0; }
    .main-nav a { border: 0; padding: .5rem .75rem; border-radius: 8px; }
    .main-nav a:hover { background: var(--green-50); }
    .main-nav a.active { background: var(--green-100); }
    .site-header .container { width: min(1320px, 100% - 2rem); }
    .header-inner { flex-wrap: nowrap; }
    .brand { margin-right: 0; min-width: 0; flex: 0 1 auto; }
    .main-nav { margin-left: auto; }
    .main-nav a { padding: .5rem .6rem; font-size: .95rem; white-space: nowrap; }
}
@media (min-width: 1000px) and (max-width: 1239px) { .brand-text small { display: none; } .brand-text strong { font-size: .92rem; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .7rem 1.25rem; border-radius: 10px; border: 2px solid transparent;
       font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2; background: var(--green-100); color: var(--green-900); min-height: 46px; }
.btn:hover { filter: brightness(.96); }
.btn-primary { background: var(--green-800); color: var(--white); }
.btn-primary:hover { background: var(--green-900); color: var(--white); }
.btn-gold { background: var(--gold); color: #1d1600; }
.btn-gold:hover { background: var(--gold-dark); color: #000; }
.btn-outline { background: transparent; border-color: var(--green-700); color: var(--green-800); }
.btn-outline-light { background: transparent; border-color: rgba(255,255,255,.8); color: var(--white); }
.btn-outline-light:hover { background: rgba(255,255,255,.12); color: var(--white); }
.btn-lg { padding: .9rem 1.6rem; font-size: 1.08rem; }
.btn-sm { padding: .4rem .8rem; min-height: 36px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-copy { border: 1px solid var(--line); background: var(--white); border-radius: 6px; padding: .15rem .55rem; font-size: .8rem; cursor: pointer; color: var(--green-800); font-weight: 600; vertical-align: middle; }
.btn-copy.copied { background: var(--green-800); color: var(--white); }
.chip { display: inline-block; padding: .4rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; cursor: pointer; font-family: inherit; }
.chip.active, .chip:hover { background: var(--green-800); border-color: var(--green-800); color: var(--white); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }

/* ---------- Sections & layout ---------- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-alt { background: var(--white); }
.section-green { background: var(--green-800); color: var(--white); }
.section-green h2 { color: var(--white); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.section-head h2 { margin: 0; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.layout-sidebar { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 960px) { .layout-sidebar { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.sidebar-stack { display: grid; gap: 1.25rem; }
.stack { display: grid; gap: 1rem; }

.page-head { background: linear-gradient(135deg, var(--green-900), var(--green-700)); color: var(--white); padding: clamp(2.2rem, 6vw, 3.5rem) 0; position: relative; overflow: hidden; }
.page-head::after, .hero::after { content: ""; position: absolute; inset: 0; background-image: url("../img/pattern.svg"); background-size: 120px; opacity: .08; pointer-events: none; }
.page-head h1 { color: var(--white); margin-bottom: .3em; }
.page-head .lead, .page-head p { color: rgba(255,255,255,.9); max-width: 760px; }
.page-head-compact { padding: 2rem 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .82rem; font-weight: 700; color: var(--gold); margin-bottom: .4rem; }
.lead { font-size: 1.15rem; }
.inline-form { display: inline-flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.page-head .inline-form label { color: var(--white); font-weight: 600; }
.page-head select { min-width: 110px; }

/* ---------- Hero & prayer card ---------- */
.hero { background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 55%, var(--green-700) 100%); color: var(--white); position: relative; overflow: hidden; }
.hero-inner { display: grid; gap: 2rem; padding: clamp(2.5rem, 7vw, 5rem) 0; position: relative; z-index: 1; }
@media (min-width: 960px) { .hero-inner { grid-template-columns: 1.2fr 1fr; align-items: center; } }
.hero h1 { color: var(--white); font-size: clamp(2rem, 5vw, 3.1rem); }
.hero .lead { color: rgba(255,255,255,.92); }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.5rem; }
.prayer-card { background: var(--white); color: var(--ink); border-radius: 18px; padding: 1.4rem; box-shadow: 0 20px 50px rgba(0,0,0,.25); border-top: 5px solid var(--gold); }
.prayer-card-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.prayer-card-head h2 { font-size: 1.2rem; margin: 0; }
.prayer-card-head p { margin: 0; text-align: right; font-size: .9rem; color: var(--muted); }
.hijri { color: var(--gold-dark); font-weight: 600; }
.next-prayer { background: var(--green-50); color: var(--green-900); border-radius: 10px; padding: .55rem .8rem; margin: .9rem 0 .4rem; font-weight: 600; }
.prayer-list { list-style: none; padding: 0; margin: .6rem 0; }
.prayer-list li { display: flex; justify-content: space-between; padding: .55rem .4rem; border-bottom: 1px dashed var(--line); font-size: 1.05rem; }
.prayer-list li:last-child { border-bottom: 0; }
.prayer-list li strong { font-variant-numeric: tabular-nums; font-size: 1.15rem; color: var(--green-900); }
.prayer-list li.is-next { background: var(--gold); border-radius: 8px; border-color: transparent; }
.prayer-list li.is-next strong, .prayer-list li.is-next span { color: #1d1600; font-weight: 700; }
.prayer-more { font-weight: 600; }

/* ---------- Cards ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-pad { padding: clamp(1.1rem, 3vw, 1.75rem); }
.card-body { padding: 1.15rem 1.25rem 1.3rem; }
.card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card h3 { margin: .4rem 0 .5rem; font-size: 1.12rem; }
.card h3 a { text-decoration: none; color: var(--green-900); }
.card h3 a:hover { text-decoration: underline; }
.card-img-link { display: block; position: relative; }
.card-img-link.is-video::after { content: "▶"; position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.meta { color: var(--muted); font-size: .9rem; margin-bottom: .5rem; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--green-700); background: var(--green-50); padding: .2rem .55rem; border-radius: 6px; }
.tag-video { color: #8b1d1d; background: #fbeaea; }
.tag-sermon { color: #6b4b00; background: #fbf3dd; }
.tag-announcement { color: var(--info); background: var(--info-bg); }
.badge { display: inline-block; font-size: .76rem; font-weight: 700; padding: .18rem .55rem; border-radius: 999px; white-space: nowrap; }
.badge-success { background: var(--green-100); color: var(--green-900); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: #eef0ee; color: var(--muted); }

.service-card { display: block; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.service-card:hover { transform: translateY(-3px); border-color: var(--gold); color: var(--ink); }
.service-card h2 { font-size: 1.2rem; margin: .5rem 0 .3rem; }
.service-card p { margin: 0; color: var(--muted); }
.service-icon { font-size: 2rem; }
.quick-links { margin-top: -2.2rem; position: relative; z-index: 2; padding-top: 0; }

.info-card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--line); border-top: 4px solid var(--gold); padding: 1.4rem; box-shadow: var(--shadow); }
.price { font-size: 1.35rem; font-weight: 800; color: var(--green-800); margin: .3rem 0 .6rem; }
.price small { font-size: .85rem; color: var(--muted); font-weight: 500; }

.announcements { display: grid; gap: 1rem; }
@media (min-width: 900px) { .announcements { grid-template-columns: repeat(3, 1fr); } }
.announcement { background: var(--cream); border-left: 4px solid var(--green-700); padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0; }
.announcement.pinned { border-left-color: var(--gold); background: #fffbef; }
.announcement time { font-size: .85rem; color: var(--muted); }
.announcement h3 { margin: .25rem 0 .4rem; font-size: 1.1rem; }
.announcement h3 a { text-decoration: none; color: var(--green-900); }
.announcement p { margin: 0; color: var(--muted); }

.about-grid { display: grid; gap: 2rem; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.3fr 1fr; } }
.vision-card { background: var(--green-50); border-radius: var(--radius); padding: 1.5rem; border: 1px solid var(--green-100); }
.vision-card ol { padding-left: 1.2rem; margin: 0; }
.vision-card li { margin-bottom: .4rem; }
.info-box { background: #fffbef; border: 1px solid #f0e2b0; padding: .9rem 1.1rem; border-radius: 10px; }

.stats { margin: 2rem 0; text-align: center; }
.stat strong { display: block; font-size: clamp(1.4rem, 3vw, 2rem); color: var(--gold); }
.stat span { color: rgba(255,255,255,.88); }
.stats-cards { margin-bottom: 2rem; }
.stat-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; box-shadow: var(--shadow); }
.stat-card span { color: var(--muted); display: block; }
.stat-card strong { font-size: 1.55rem; color: var(--green-800); }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: 0 0 1rem; }
.mini-stats dt { font-size: .85rem; color: var(--muted); }
.mini-stats dd { margin: 0; font-weight: 800; color: var(--green-800); }

.event-card .card-body { display: flex; gap: 1rem; align-items: flex-start; }
.event-date { flex: 0 0 62px; text-align: center; background: var(--green-800); color: var(--white); border-radius: 12px; padding: .5rem .2rem; line-height: 1.1; }
.event-date strong { display: block; font-size: 1.6rem; }
.event-date span { font-size: .8rem; text-transform: uppercase; }

.step { background: var(--cream); border-radius: var(--radius); padding: 1.4rem; position: relative; }
.step-no { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 50%; background: var(--gold); font-weight: 800; margin-bottom: .6rem; }
.package-card.sold-out { opacity: .65; }
.package-card .card-body { display: flex; flex-direction: column; height: 100%; }
.package-card .btn { margin-top: auto; }

/* ---------- Forms ---------- */
.form .field { margin-bottom: 1.05rem; }
label { font-weight: 600; display: block; margin-bottom: .35rem; }
.req { color: var(--danger); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=datetime-local],
input[type=search], input[type=url], input[type=password], input[type=file], select, textarea {
    width: 100%; font: inherit; padding: .7rem .85rem; border: 1.5px solid #c9d3cc; border-radius: 10px; background: var(--white); color: var(--ink); min-height: 48px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green-700); outline: 3px solid rgba(20,108,67,.18); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .9rem; margin-top: .3rem; font-weight: 600; }
.help { display: block; color: var(--muted); margin-top: .3rem; font-size: .88rem; }
.field-check label { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; cursor: pointer; }
.field-check input { width: 22px; height: 22px; margin-top: .15rem; flex: 0 0 auto; accent-color: var(--green-800); }
.fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
.fieldset legend { font-weight: 800; font-size: 1.12rem; color: var(--green-900); margin-bottom: .8rem; padding: 0; }
.choice-cards { display: grid; gap: .7rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 560px) { .choice-cards { grid-template-columns: 1fr 1fr; } .choice-cards.three { grid-template-columns: repeat(3, 1fr); } }
.choice-card { position: relative; margin: 0; cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; }
.choice-card > span { display: flex; flex-direction: column; gap: .2rem; border: 2px solid var(--line); border-radius: 12px; padding: .9rem 1rem; background: var(--white); height: 100%; }
.choice-card small { color: var(--muted); font-weight: 400; }
.choice-card input:checked + span { border-color: var(--green-700); background: var(--green-50); box-shadow: inset 0 0 0 1px var(--green-700); }
.choice-card input:focus-visible + span { outline: 3px solid var(--gold); }
.quick-amounts { display: flex; flex-wrap: wrap; gap: .45rem; margin: -.4rem 0 1rem; }
.total-line { background: var(--green-50); padding: .7rem 1rem; border-radius: 10px; font-size: 1.05rem; }
.total-line strong { color: var(--green-800); font-size: 1.2rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.filter-bar .chips { margin: 0; }
.search-form { display: flex; gap: .5rem; flex: 1 1 280px; max-width: 420px; }

/* ---------- Tabs (calculator) ---------- */
.tab-list, .tr-tabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tr-tab { border: 1.5px solid var(--line); background: var(--white); padding: .5rem 1rem; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; color: var(--green-800); }
.tr-tab.active { background: var(--green-800); color: var(--white); border-color: var(--green-800); }
.tr-pane { display: none; }
.tr-pane.active { display: block; }
.calculator { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.calc-result { margin-top: 1.2rem; background: var(--white); border-radius: 12px; padding: 1.1rem; text-align: center; border: 2px dashed var(--gold); }
.calc-amount { font-size: 1.9rem; font-weight: 800; color: var(--green-800); margin: .2rem 0 .8rem; }
.calc-status { margin: 0; font-weight: 600; }

/* ---------- Payment ---------- */
.bank-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .7rem; }
.bank-item { display: grid; gap: .15rem; border: 1px solid var(--line); border-radius: 10px; padding: .75rem .9rem; background: var(--cream); }
.bank-name { font-weight: 700; color: var(--green-900); }
.bank-number strong { font-size: 1.2rem; letter-spacing: .03em; font-variant-numeric: tabular-nums; margin-right: .4rem; }
.bank-holder { font-size: .9rem; color: var(--muted); }
.qris-box { text-align: center; }
.qris-img { margin: 0 auto .6rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: .4rem; width: 100%; max-width: 320px; }
.qris-layout { display: grid; gap: 1.5rem; }
@media (min-width: 720px) { .qris-layout { grid-template-columns: 300px 1fr; align-items: start; } }
.instructions { padding-left: 1.2rem; }
.instructions li { margin-bottom: .45rem; }
.pay-amount { text-align: center; border-top: 5px solid var(--gold); margin-bottom: 1.25rem; }
.amount-big { font-size: clamp(2rem, 6vw, 2.6rem); font-weight: 800; color: var(--green-800); margin: 0 0 .4rem; }
.ref-code { font-size: 1.15rem; letter-spacing: .04em; }
.layout-sidebar > div > .card + .card { margin-top: 1.25rem; }
.progress-steps { list-style: none; display: flex; padding: 0; margin: 0 0 1.25rem; counter-reset: step; }
.progress-steps li { flex: 1; text-align: center; position: relative; font-size: .88rem; color: var(--muted); padding-top: 2.4rem; }
.progress-steps li::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 32px; height: 32px; border-radius: 50%; background: #e3e7e4; display: flex; align-items: center; justify-content: center; font-weight: 700; z-index: 1; }
.progress-steps li::after { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 3px; background: #e3e7e4; }
.progress-steps li:first-child::after { display: none; }
.progress-steps li.done::before, .progress-steps li.current::before { background: var(--green-800); color: #fff; }
.progress-steps li.done::after, .progress-steps li.current::after { background: var(--green-700); }
.progress-steps li.current { color: var(--green-900); font-weight: 700; }
.details { margin: 0; display: grid; gap: .55rem; }
.details > div { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: .6rem; border-bottom: 1px dashed var(--line); padding-bottom: .45rem; }
.details dt { color: var(--muted); font-size: .92rem; }
.details dd { margin: 0; word-break: break-word; }
.receipt { margin-top: 1.25rem; }
.receipt-head { display: flex; gap: .9rem; align-items: center; border-bottom: 2px solid var(--green-800); padding-bottom: .8rem; margin-bottom: 1rem; }
.receipt-doa { font-style: italic; color: var(--green-800); margin-top: 1rem; }

/* ---------- Alerts ---------- */
.flash-stack { display: grid; gap: .6rem; margin-top: 1rem; }
.alert { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: 12px; border: 1px solid; margin-bottom: 1rem; }
.alert-success { background: var(--green-50); border-color: #b7dcc4; color: var(--green-900); }
.alert-error { background: var(--danger-bg); border-color: #f3c2bd; color: var(--danger); }
.alert-info { background: var(--info-bg); border-color: #c4d8f1; color: var(--info); }
.alert-close { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: inherit; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; background: var(--white); font-size: .97rem; }
.table th, .table td { padding: .7rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table thead th { background: var(--green-800); color: var(--white); font-weight: 700; white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tbody tr:hover { background: var(--green-50); }
.prayer-table td { text-align: center; font-variant-numeric: tabular-nums; }
.prayer-table tr.today { background: #fff6d6 !important; font-weight: 700; }
.prayer-table tr.friday th { color: var(--green-700); }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.month-nav h2 { margin: 0; text-align: center; }

.bar-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.bar-label { display: flex; justify-content: space-between; gap: 1rem; font-size: .95rem; flex-wrap: wrap; }
.bar { height: 12px; background: var(--green-50); border-radius: 999px; overflow: hidden; margin-top: .25rem; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-700), var(--gold)); border-radius: 999px; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { display: flex; justify-content: space-between; padding: .6rem 0; border-bottom: 1px dashed var(--line); }

/* ---------- Calendar ---------- */
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-head div { text-align: center; font-weight: 700; padding: .5rem 0; color: var(--green-800); font-size: .85rem; }
.cal-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--white); border-radius: 0 0 var(--radius) var(--radius); }
.cal-cell { min-height: 76px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .3rem; overflow: hidden; }
.cal-cell.empty { background: #f8f9f8; }
.cal-cell.today { background: #fff8de; }
.cal-day { font-weight: 700; font-size: .9rem; }
.cal-event { display: block; font-size: .72rem; line-height: 1.25; margin-top: .2rem; padding: .15rem .3rem; border-radius: 4px; background: var(--green-100); color: var(--green-900); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event.cat-social { background: #fdf0d5; color: #6b4b00; }
.cal-event.cat-youth { background: #e5eefc; color: #1f4e85; }
.cal-event.cat-education { background: #efe6fa; color: #4c2a85; }
.cal-event.cat-ramadan { background: #fde7e7; color: #8b1d1d; }
.cal-event.cancelled { text-decoration: line-through; opacity: .6; }
.cal-time { font-weight: 700; }
@media (max-width: 640px) {
    .cal-cell { min-height: 54px; }
    .cal-event { font-size: 0; height: 8px; padding: 0; }
    .cal-event .cal-time { display: none; }
}

/* ---------- Article ---------- */
.breadcrumb { font-size: .9rem; margin-bottom: 1rem; color: var(--muted); }
.article-head { margin-bottom: 1.25rem; }
.article-cover { border-radius: var(--radius); margin-bottom: 1.5rem; width: 100%; }
.prose { font-size: 1.08rem; }
.prose h2 { margin-top: 1.6em; }
.prose blockquote { margin: 1.5em 0; padding: 1rem 1.25rem; border-left: 4px solid var(--gold); background: #fffbef; border-radius: 0 10px 10px 0; font-style: italic; }
.prose .arabic, .arabic { font-family: var(--font-ar); font-size: 1.7rem; line-height: 2.1; text-align: right; direction: rtl; color: var(--green-900); }
.prose img { border-radius: 10px; margin: 1rem 0; }
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { border: 1px solid var(--line); padding: .5rem; }
.video-embed, .map-embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; background: #000; }
.map-embed { aspect-ratio: 16 / 7; background: var(--green-50); }
.video-embed iframe, .map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.download-box { display: flex; gap: .8rem; align-items: center; background: var(--green-50); padding: 1rem; border-radius: 12px; }
.share { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 2rem; }

.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.pagination a, .pagination span { padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--line); background: var(--white); text-decoration: none; }
.pagination .current { background: var(--green-800); color: var(--white); border-color: var(--green-800); }
.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-900); color: rgba(255,255,255,.85); padding-top: 3rem; margin-top: 0; }
.site-footer a { color: #f5e3a3; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; padding-bottom: 2rem; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-title { color: var(--white); font-size: 1.1rem; }
.footer-links, .footer-contact { list-style: none; padding: 0; margin: 0; }
.footer-links li, .footer-contact li { margin-bottom: .4rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); padding: 1rem 0 1.4rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .88rem; }

/* ---------- Minimal layout (login / errors / installer) ---------- */
.minimal-main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; background: linear-gradient(160deg, var(--green-900), var(--green-700)); }
.minimal-brand { display: flex; flex-direction: column; align-items: center; gap: .5rem; color: var(--white); text-decoration: none; font-weight: 700; margin-bottom: 1.5rem; text-align: center; }
.minimal-main .flash-stack { width: min(440px, 100%); }
.login-card, .error-page { width: min(440px, 100%); }
.error-page { text-align: center; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--gold); margin: 0; line-height: 1; }
.lang-inline { display: flex; gap: 1rem; justify-content: center; margin: 1rem 0 0; font-size: .9rem; }
.lang-inline a.active { font-weight: 700; text-decoration: none; color: var(--ink); }

/* ---------- Print (receipts, reports) ---------- */
@media print {
    .site-header, .site-footer, .no-print, .flash-stack, .page-head .btn-copy, .sidebar-stack, .progress-steps, .btn, .skip-link { display: none !important; }
    body { background: #fff; font-size: 12pt; }
    .page-head { background: none; color: #000; padding: 0; }
    .page-head h1, .page-head p { color: #000; }
    .page-head::after { display: none; }
    .layout-sidebar { display: block; }
    .layout-sidebar > div > .card:not(.receipt) { display: none; }
    .card { box-shadow: none; border: 1px solid #999; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
