*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-950: #0d2318;
  --green-900: #1a3a2a;
  --green-800: #1e5c3a;
  --green-700: #236b45;
  --green-600: #2a7d52;
  --green-500: #339966;
  --green-400: #4db380;
  --green-300: #80ccaa;
  --green-200: #b3e0cc;
  --green-100: #d9f0e6;
  --green-50:  #f0faf5;

  --sand-900: #2c2518;
  --sand-800: #4a3f28;
  --sand-700: #6b5b38;
  --sand-600: #8c7a50;
  --sand-500: #b09868;
  --sand-400: #c8b48a;
  --sand-300: #ddd0b0;
  --sand-200: #ede6d0;
  --sand-100: #f5f0e8;
  --sand-50:  #faf8f4;

  --text-primary: #1a1a1a;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --text-inverted: #ffffff;

  --bg-page: #f7f5f0;
  --bg-card: #ffffff;
  --bg-card-alt: #faf8f4;

  --border-light: rgba(0,0,0,0.07);
  --border-medium: rgba(0,0,0,0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-elevated: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
}

html { font-size: 16px; }
body {
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  direction: rtl;
}

/* ─── LAYOUT ─── */
.page-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-page);
}

/* ─── HEADER ─── */
.site-header {
  background: var(--green-900);
  padding: 20px 20px 24px;
  position: relative;
  overflow: hidden;
}
.site-header::before {
  content: '';
  position: absolute;
  top: -40px; left: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(51,153,102,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.header-inner {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.header-text { flex: 1; }
.site-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-inverted);
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.site-desc {
  font-size: 12px;
  font-weight: 300;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
}
.header-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 6px 10px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.header-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green-400);
  animation: pulse 2s ease-in-out infinite;
}
.header-badge span {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  font-weight: 400;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ─── PRAYER TABS ─── */
.prayer-tabs-section {
  background: var(--green-900);
  padding: 0 16px 16px;
}
.prayer-tabs {
  display: flex;
  gap: 6px;
  padding: 12px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.08);
}
.prayer-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  border: none;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}
.prayer-tab:active { transform: scale(0.96); }
.prayer-tab .tab-name {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  transition: color 0.2s;
}
.prayer-tab .tab-count {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  transition: color 0.2s;
  min-height: 20px;
  display: flex;
  align-items: center;
}
.prayer-tab.active {
  background: var(--green-600);
}
.prayer-tab.active .tab-name  { color: rgba(255,255,255,0.9); font-weight: 500; }
.prayer-tab.active .tab-count { color: var(--text-inverted); }
.prayer-tab.past .tab-name  { color: rgba(255,255,255,0.3); }
.prayer-tab.past .tab-count { color: rgba(255,255,255,0.25); }

/* ─── COUNTDOWN ─── */
.countdown-section {
  background: var(--green-950);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.countdown-time {
  font-size: 36px;
  font-weight: 300;
  color: var(--text-inverted);
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.countdown-prayer-label {
  font-size: 13px;
  color: var(--green-400);
  font-weight: 500;
}
.countdown-prayer-time {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
  font-weight: 300;
}

/* ─── LAST UPDATED ─── */
.last-updated {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  background: var(--green-950);
}
.last-updated span {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  font-weight: 300;
}
.last-updated .refresh-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.3);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  transition: color 0.2s;
}
.last-updated .refresh-btn:hover { color: var(--green-400); }

/* ─── MAIN CONTENT ─── */
.main-content { padding: 16px 16px 32px; }

/* ─── SECTION TITLE ─── */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title h2 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0.3px;
}
.section-title .count-badge {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--sand-100);
  border: 1px solid var(--border-light);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ─── FAVORITES EMPTY ─── */
.favorites-empty {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 24px;
}
.favorites-empty .empty-icon {
  font-size: 28px;
  margin-bottom: 10px;
  opacity: 0.4;
}
.favorites-empty p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  font-weight: 300;
}

/* ─── MOSQUE LIST ─── */
.mosque-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }

/* ─── MOSQUE CARD ─── */
.mosque-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s;
}
.mosque-card.open { box-shadow: var(--shadow-elevated); border-color: var(--border-medium); }

.mosque-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
.mosque-icon-wrap {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mosque-icon-wrap svg {
  width: 18px; height: 18px;
  color: var(--green-700);
}
.mosque-info { flex: 1; min-width: 0; }
.mosque-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mosque-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}
.mosque-meta span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 300;
}
.mosque-meta .sep { color: var(--border-medium); }

.mosque-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.action-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.action-btn:hover { background: var(--sand-50); color: var(--text-primary); border-color: var(--border-medium); }
.action-btn:active { transform: scale(0.9); }
.action-btn.fav-active { color: var(--sand-600); background: var(--sand-50); border-color: var(--sand-300); }
.action-btn svg { width: 15px; height: 15px; }

.funeral-count-pill {
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-800);
  white-space: nowrap;
  flex-shrink: 0;
}
.funeral-count-pill.zero { background: var(--sand-100); border-color: var(--border-light); color: var(--text-muted); font-weight: 400; }

.chevron-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.chevron-btn svg { width: 14px; height: 14px; transition: transform 0.25s; }
.mosque-card.open .chevron-btn svg { transform: rotate(180deg); }

/* ─── MOSQUE DETAIL ─── */
.mosque-detail {
  display: none;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card-alt);
}
.mosque-card.open .mosque-detail { display: block; }

.funeral-summary {
  display: flex;
  gap: 1px;
  border-bottom: 1px solid var(--border-light);
  background: var(--border-light);
}
.summary-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: var(--bg-card-alt);
}
.summary-cell .cell-num {
  font-size: 20px;
  font-weight: 600;
  color: var(--green-800);
  line-height: 1;
}
.summary-cell .cell-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
}

.funeral-list { padding: 12px 16px; }
.funeral-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.funeral-item:last-child { border-bottom: none; }
.funeral-item-info { display: flex; flex-direction: column; gap: 2px; }
.funeral-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.funeral-sub { font-size: 11px; color: var(--text-muted); font-weight: 300; }
.gender-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.gender-badge.male   { background: #eef4ff; color: #3b5bdb; }
.gender-badge.female { background: #fff0fb; color: #9c36b5; }
.gender-badge.child  { background: #fff9db; color: #e67700; }

.detail-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px 14px;
}
.detail-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
.detail-btn:hover { background: var(--sand-50); border-color: var(--border-medium); }
.detail-btn:active { transform: scale(0.97); }
.detail-btn svg { width: 15px; height: 15px; }

.no-funerals-msg {
  padding: 20px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 300;
}

/* ─── LOADING SKELETON ─── */
.skeleton {
  background: linear-gradient(90deg, var(--sand-100) 25%, var(--sand-50) 50%, var(--sand-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  height: 68px;
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
}

/* ─── FOOTER ─── */
.site-footer {
  text-align: center;
  padding: 24px 20px 40px;
  border-top: 1px solid var(--border-light);
}
.footer-msg {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 12px;
  line-height: 1.6;
}
.footer-admin-link {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  transition: all 0.2s;
}
.footer-admin-link:hover { color: var(--green-700); border-color: var(--green-200); }

/* ─── SUBSCRIBE FAB ─── */
.subscribe-fab {
  position: fixed;
  bottom: 24px;
  left: 20px;
  background: var(--green-900);
  color: var(--text-inverted);
  border: none;
  border-radius: 24px;
  padding: 12px 20px;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(26,58,42,0.35);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  z-index: 100;
}
.subscribe-fab:hover { background: var(--green-800); transform: translateY(-1px); }
.subscribe-fab:active { transform: scale(0.97) translateY(0); }
.subscribe-fab svg { width: 16px; height: 16px; }

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%; transform: translateX(-50%);
  background: var(--green-900);
  color: white;
  font-size: 12px;
  padding: 8px 18px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 200;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
}
.toast.show { opacity: 1; }

/* ─── MODAL (SUBSCRIBE) ─── */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 300;
  align-items: flex-end;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal-sheet {
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px 20px 40px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-handle {
  width: 36px; height: 4px;
  background: var(--border-medium);
  border-radius: 2px;
  margin: 0 auto 20px;
}
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 20px; color: var(--text-primary); }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  color: var(--text-primary);
  background: var(--bg-page);
  outline: none;
  transition: border-color 0.2s;
  min-height: 44px;
  direction: rtl;
}
.form-input:focus { border-color: var(--green-600); background: white; }
.mosque-checkboxes { display: flex; flex-direction: column; gap: 8px; }
.mosque-checkbox-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 44px;
}
.mosque-checkbox-item:hover { border-color: var(--green-300); background: var(--green-50); }
.mosque-checkbox-item.checked { border-color: var(--green-500); background: var(--green-50); }
.mosque-checkbox-item input { accent-color: var(--green-700); width: 16px; height: 16px; cursor: pointer; }
.mosque-checkbox-item label { font-size: 13px; cursor: pointer; color: var(--text-primary); flex: 1; }
.submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--green-900);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.15s;
  min-height: 44px;
}
.submit-btn:hover { background: var(--green-800); }
.submit-btn:active { transform: scale(0.98); }

/* ══════════════════════════════════════════════
   ADDED COMPONENTS
   ══════════════════════════════════════════════ */

/* ─── HEADER ACTIONS (lang toggle) ─── */
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lang-toggle {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.75);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 500;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.lang-toggle:hover { background: rgba(255,255,255,0.16); color: #fff; }
.lang-toggle:active { transform: scale(0.95); }

/* ─── STATS STRIP ─── */
.stats-strip {
  display: flex;
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.stat-cell {
  flex: 1;
  background: var(--bg-card);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stat-cell .stat-num {
  font-size: 22px;
  font-weight: 600;
  color: var(--green-800);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-cell .stat-label { font-size: 10px; color: var(--text-muted); font-weight: 400; }

/* ─── SORT BAR ─── */
.sort-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sort-bar::-webkit-scrollbar { display: none; }
.sort-btn {
  flex: 1;
  white-space: nowrap;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 40px;
}
.sort-btn:hover { border-color: var(--green-200); color: var(--green-800); }
.sort-btn.active {
  background: var(--green-900);
  border-color: var(--green-900);
  color: var(--text-inverted);
}
.sort-btn:active { transform: scale(0.97); }

/* ─── MOSQUE AREA (district) ─── */
.mosque-area {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 300;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── ADMIN / MANAGER PAGES ─── */
.admin-main { padding: 20px 16px 40px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  margin-bottom: 4px;
  transition: color 0.2s;
}
.back-link:hover { color: #fff; }

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px 22px;
  text-align: center;
  margin-top: 32px;
}
.login-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.login-icon svg { width: 26px; height: 26px; color: var(--green-700); }
.login-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.login-hint { font-size: 12px; color: var(--text-muted); font-weight: 300; line-height: 1.6; margin-bottom: 20px; }
.pin-input {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 6px;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  background: var(--bg-page);
  outline: none;
  transition: border-color 0.2s;
  direction: ltr;
  min-height: 44px;
}
.pin-input:focus { border-color: var(--green-600); background: #fff; }

.alert {
  font-size: 12px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  line-height: 1.6;
  text-align: right;
}
.alert.error   { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }
.alert.success { background: var(--green-50); color: var(--green-800); border: 1px solid var(--green-200); }
.alert.info    { background: var(--sand-50); color: var(--text-secondary); border: 1px solid var(--border-light); }

/* ─── ADMIN TAB BAR ─── */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--sand-100);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.admin-tab {
  flex: 1;
  white-space: nowrap;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 40px;
}
.admin-tab.active { background: var(--green-900); color: var(--text-inverted); }

/* ─── PANEL ─── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 16px;
  margin-bottom: 16px;
}
.panel-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 14px; }

/* ─── SELECT ─── */
.form-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  color: var(--text-primary);
  background: var(--bg-page);
  outline: none;
  min-height: 44px;
  cursor: pointer;
  direction: rtl;
}
.form-select:focus { border-color: var(--green-600); background: #fff; }

/* ─── PRAYER CHIPS ─── */
.prayer-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.prayer-chip {
  flex: 1;
  min-width: 60px;
  padding: 9px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 40px;
}
.prayer-chip:hover { border-color: var(--green-300); }
.prayer-chip.active { background: var(--green-600); border-color: var(--green-600); color: #fff; }

/* ─── COUNTER ROW ─── */
.counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card-alt);
  margin-bottom: 8px;
}
.counter-row .counter-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.counter-controls { display: flex; align-items: center; gap: 12px; }
.counter-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--green-200);
  background: var(--green-50);
  color: var(--green-800);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.counter-btn:hover { background: var(--green-100); }
.counter-btn:active { transform: scale(0.9); }
.counter-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.counter-value {
  min-width: 32px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* ─── DATA ROWS (accounts / mosques) ─── */
.data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card-alt);
  margin-bottom: 8px;
}
.data-row-info { flex: 1; min-width: 0; }
.data-row-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.data-row-sub { font-size: 11px; color: var(--text-muted); font-weight: 300; margin-top: 2px; }
.code-input {
  width: 76px;
  padding: 8px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  color: var(--green-800);
  background: #fff;
  outline: none;
  direction: ltr;
  flex-shrink: 0;
}
.code-input:focus { border-color: var(--green-600); }

.link-danger {
  background: none;
  border: none;
  color: #c53030;
  font-size: 11px;
  font-weight: 500;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  cursor: pointer;
  padding: 2px 0;
  margin-top: 4px;
}
.link-danger:hover { text-decoration: underline; }

/* ─── FILTER BAR ─── */
.filter-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--sand-100);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}
.filter-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 36px;
}
.filter-btn.active { background: var(--bg-card); color: var(--green-800); box-shadow: var(--shadow-card); }

.export-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--green-200);
  background: var(--green-50);
  color: var(--green-800);
  font-size: 11px;
  font-weight: 500;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.export-btn:hover { background: var(--green-100); }

.btn-secondary {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 44px;
}
.btn-secondary:hover { background: var(--sand-50); }

/* ─── SUBSCRIBER ITEM ─── */
.sub-item {
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card-alt);
  margin-bottom: 8px;
}
.sub-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.sub-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.sub-contact { font-size: 12px; color: var(--text-secondary); direction: ltr; text-align: left; }
.sub-mosques { font-size: 11px; color: var(--text-muted); font-weight: 300; line-height: 1.6; margin-top: 4px; }
.method-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 500; flex-shrink: 0; }
.method-badge.whatsapp { background: var(--green-50); color: var(--green-800); }
.method-badge.email    { background: #eef4ff; color: #3b5bdb; }

/* ─── RADIO GROUP ─── */
.radio-group { display: flex; gap: 8px; }
.radio-option {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.15s;
  min-height: 44px;
}
.radio-option:hover { border-color: var(--green-300); }
.radio-option.checked { border-color: var(--green-500); background: var(--green-50); color: var(--green-800); font-weight: 500; }
.radio-option input { accent-color: var(--green-700); width: 15px; height: 15px; cursor: pointer; }

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 32px 20px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.7;
}

/* ─── ARCHIVE ─── */
.archive-day { margin-bottom: 20px; }
.archive-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: var(--sand-100);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.archive-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  margin-bottom: 6px;
}
.archive-row-info { flex: 1; min-width: 0; }
.archive-mosque { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.archive-meta { font-size: 11px; color: var(--text-muted); font-weight: 300; margin-top: 2px; }
.archive-total {
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-800);
  flex-shrink: 0;
}

/* ─── LTR (English) OVERRIDES ─── */
html[dir="ltr"] body { direction: ltr; }
html[dir="ltr"] .form-input,
html[dir="ltr"] .form-select { direction: ltr; }
html[dir="ltr"] .subscribe-fab { left: auto; right: 20px; }
html[dir="ltr"] .site-header::before { left: auto; right: -40px; }
html[dir="ltr"] .alert { text-align: left; }
html[dir="ltr"] .sub-contact { text-align: right; }

/* ══════════════════════════════════════════════
   RESPONSIVE — tablet & desktop
   Everything above is the phone layout (mobile-first).
   These blocks widen it for larger screens only.
   ══════════════════════════════════════════════ */

:root { --container: 1200px; }

@media (min-width: 640px) {
  /* The wrapper goes full-bleed so the dark bands span the window,
     while the content inside each band stays centred. */
  .page-wrapper { max-width: none; }

  .header-inner,
  .prayer-tabs,
  .main-content { max-width: var(--container); margin-inline: auto; }

  .site-header        { padding: 24px 24px 28px; }
  .prayer-tabs-section{ padding: 0 24px 20px; }
  .main-content       { padding: 24px 24px 48px; }

  .site-name     { font-size: 24px; }
  .site-desc     { font-size: 13px; }
  .countdown-time{ font-size: 44px; }
  .countdown-section { padding: 22px 24px; gap: 24px; }

  .prayer-tab           { padding: 12px 8px; }
  .prayer-tab .tab-name { font-size: 13px; }
  .prayer-tab .tab-count{ font-size: 16px; }

  /* Mosque cards become a grid instead of one long column.
     align-items:start so an expanded card grows alone. */
  .mosque-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    align-items: start;
  }

  .stats-strip  { margin-bottom: 24px; }
  .stat-cell    { padding: 18px 12px; }
  .stat-cell .stat-num { font-size: 26px; }

  .sort-bar     { justify-content: flex-start; }
  .sort-btn     { flex: 0 1 auto; min-width: 150px; }

  .section-title h2 { font-size: 14px; }

  /* The bottom sheet becomes a centred dialog. */
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal-sheet {
    border-radius: var(--radius-xl);
    max-width: 540px;
    max-height: 82vh;
    padding: 28px 28px 32px;
  }
  .modal-handle { display: none; }

  /* Admin/manager screens read better at a narrower measure. */
  .admin-main  { max-width: 780px; margin-inline: auto; padding: 28px 24px 56px; }
  .login-card  { max-width: 440px; margin-inline: auto; }

  .subscribe-fab { bottom: 32px; left: 32px; padding: 14px 24px; font-size: 14px; }
}

@media (min-width: 1024px) {
  .mosque-list { grid-template-columns: repeat(3, 1fr); gap: 14px; }

  .site-header         { padding: 32px 32px 36px; }
  .prayer-tabs-section { padding: 0 32px 24px; }
  .main-content        { padding: 32px 32px 64px; }

  .site-name      { font-size: 28px; }
  .countdown-time { font-size: 52px; }

  .mosque-card-header { padding: 16px 18px; }
  .mosque-name        { font-size: 15px; }
}

/* Wider than the container: keep the footer text aligned with the content. */
@media (min-width: 1280px) {
  .site-footer { padding: 32px 20px 56px; }
}

/* ─── Desktop hover affordances (skipped on touch) ─── */
@media (hover: hover) and (min-width: 640px) {
  .mosque-card { transition: box-shadow 0.2s, transform 0.15s; }
  .mosque-card:hover { box-shadow: var(--shadow-elevated); transform: translateY(-1px); }
}

/* ─── Header subscribe button (desktop only) ─── */
.header-subscribe {
  display: none;              /* mobile keeps the floating button instead */
  align-items: center;
  gap: 7px;
  background: var(--green-600);
  border: 1px solid var(--green-500);
  color: var(--text-inverted);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.header-subscribe:hover { background: var(--green-500); }
.header-subscribe svg { width: 14px; height: 14px; }

@media (min-width: 640px) {
  .header-subscribe { display: inline-flex; }
  .subscribe-fab    { display: none; }   /* header button takes over */
}

/* ─── Consent + field notes ─── */
.field-note {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.6;
  margin-top: 8px;
}

.radio-option.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--sand-50);
}
.radio-option.disabled:hover { border-color: var(--border-light); }
.radio-option small { font-size: 10px; opacity: 0.8; }

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card-alt);
  margin-bottom: 14px;
  cursor: pointer;
}
.consent-row input {
  accent-color: var(--green-700);
  width: 16px; height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}
.consent-row span {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-weight: 300;
}
.consent-row a { color: var(--green-700); }

/* ─── Legal / prose pages ─── */
.prose { font-size: 14px; line-height: 1.9; color: var(--text-secondary); }
.prose h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 26px 0 10px;
}
.prose h2:first-child { margin-top: 0; }
.prose p  { margin-bottom: 12px; font-weight: 300; }
.prose ul { margin: 0 20px 14px 0; }
.prose li { margin-bottom: 7px; font-weight: 300; }
.prose strong { font-weight: 500; color: var(--text-primary); }
.prose a { color: var(--green-700); }
.prose .updated {
  font-size: 12px;
  color: var(--text-muted);
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}
