/* ═══════════════════════════════════════════════════════════════
   MazKal Portal — Design System
   Rubik typeface · RTL Hebrew · Green village theme
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }

/* ── Design Tokens ───────────────────────────────────────────────── */
:root {
  /* Brand greens */
  --c-900: #1b3a1c;
  --c-800: #1b5e20;
  --c-700: #256427;
  --c-600: #2e7d32;
  --c-500: #388e3c;
  --c-400: #4caf50;
  --c-300: #81c784;
  --c-200: #c8e6c9;
  --c-100: #e8f5e9;
  --c-50:  #f1f8f1;

  /* Neutrals */
  --n-900: #1a1a1a;
  --n-700: #374151;
  --n-500: #6b7280;
  --n-400: #9ca3af;
  --n-200: #e5e7eb;
  --n-100: #f3f4f6;
  --n-50:  #f9fafb;
  --white: #ffffff;

  /* Semantic */
  --danger:  #dc2626;
  --warn:    #d97706;
  --info:    #2563eb;
  --success: var(--c-600);

  /* Surface */
  --bg:      var(--n-50);
  --surface: var(--white);
  --border:  var(--n-200);

  /* Typography */
  --font: 'Rubik', 'Segoe UI', Arial, sans-serif;
  --text: var(--n-900);
  --text-muted: var(--n-500);

  /* Radii */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:  0 10px 30px rgba(0,0,0,.1),  0 4px 8px rgba(0,0,0,.06);
  --shadow-focus: 0 0 0 3px rgba(46,125,50,.25);

  /* Transitions */
  --ease: cubic-bezier(.4,0,.2,1);
  --t-fast:   120ms var(--ease);
  --t-normal: 200ms var(--ease);

  /* Layout */
  --content-width: 920px;
  --header-h: 60px;
}

/* ── Dark / high-contrast theme ─────────────────────────────────────
   Overrides the semantic surface/text tokens above; brand greens,
   header, hero, and buttons keep their own colors and are unaffected. */
:root[data-theme="dark"] {
  --bg:      #121212;
  --surface: #1e1e1e;
  --border:  #3a3a3a;
  --text:       #f0f0f0;
  --text-muted: #b0b0b0;
  --n-50:  #1a1a1a;
  --n-100: #262626;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.3);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.5), 0 4px 8px rgba(0,0,0,.3);
}

/* ── Large text ──────────────────────────────────────────────────── */
html[data-a11y-text="large"] { font-size: 18px; }
html[data-a11y-text="xl"]    { font-size: 22px; }

/* ── Base ────────────────────────────────────────────────────────── */
html {
  direction: rtl;
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--c-600);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--c-800); }

/* ═══════════════════════════════════════════════════════════════
   HEADER & NAV
   ═══════════════════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: rgba(46,125,50,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -.02em;
  flex-shrink: 0;
  transition: opacity var(--t-fast);
}
.site-header .logo:hover { opacity: .85; }
.site-header .logo-icon { height: 22px; width: auto; }

.site-nav {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  align-items: center;
  margin-right: auto;      /* push to left in RTL */
}

.site-nav a,
.nav-dropdown > summary {
  color: rgba(255,255,255,.9);
  padding: .38rem .7rem;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.site-nav a:hover,
.nav-dropdown > summary:hover {
  background: rgba(255,255,255,.15);
  color: var(--white);
  text-decoration: none;
}

.nav-username {
  color: rgba(255,255,255,.7);
  font-size: .8rem;
  padding: .38rem .5rem;
}

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown > summary { display: flex; align-items: center; gap: .3rem; }
.nav-dropdown > summary::marker,
.nav-dropdown > summary::-webkit-details-marker { display: none; }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + .4rem);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  min-width: 170px;
  overflow: hidden;
  z-index: 300;
}
.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text);
  padding: .55rem 1rem;
  font-size: .875rem;
  transition: background var(--t-fast);
}
.nav-dropdown-menu a:hover {
  background: var(--c-100);
  color: var(--c-800);
  text-decoration: none;
}

/* Accessibility control — always visible, never collapses into the
   hamburger nav. Desktop: sits last/leftmost, past the nav links.
   Mobile: sits just to the right (inward) of the hamburger — see the
   `order` overrides in the mobile media query below. */
.a11y-dropdown {
  position: relative;
  order: 2;
  flex-shrink: 0;
}
.a11y-dropdown > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  list-style: none;
  transition: background var(--t-fast);
}
.a11y-dropdown > summary::marker,
.a11y-dropdown > summary::-webkit-details-marker { display: none; }
.a11y-dropdown > summary:hover { background: rgba(255,255,255,.15); }

.a11y-dropdown-menu {
  position: absolute;
  top: calc(100% + .4rem);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: .4rem;
  z-index: 300;
}
.a11y-group-label {
  padding: .4rem .6rem .3rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.a11y-radio-row {
  display: flex;
  gap: .3rem;
  padding: 0 .4rem .5rem;
}
.a11y-radio {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .35rem .3rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .8rem;
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.a11y-radio input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.a11y-radio:hover { background: var(--c-100); color: var(--c-800); border-color: var(--c-300); }
.a11y-radio:has(input:checked) {
  background: var(--c-600);
  border-color: var(--c-600);
  color: var(--white);
}
.a11y-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text);
  padding: .5rem .6rem;
  font-size: .875rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.a11y-toggle:hover { background: var(--c-100); color: var(--c-800); }

/* Hamburger — hidden on desktop */
.nav-toggle { display: none; }

/* ═══════════════════════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

/* Full-width sections (hero, etc.) need to break out */
.full-bleed {
  width: 100vw;
  margin-right: calc(50% - 50vw);
  margin-left:  calc(50% - 50vw);
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--c-900);
  color: rgba(255,255,255,.55);
  text-align: center;
  padding: 1.1rem 1rem;
  font-size: .8rem;
  letter-spacing: .01em;
  margin-top: auto;
}
.site-footer a { color: rgba(255,255,255,.6); }
.site-footer a:hover { color: var(--white); }

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */
h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--c-800);
  margin-bottom: 1rem;
  letter-spacing: -.02em;
}
h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--c-700);
  margin-bottom: .75rem;
  letter-spacing: -.01em;
}
h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .4rem;
}
p { margin-bottom: .75rem; }
p:last-child { margin-bottom: 0; }

.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: .875rem; }
.text-xs      { font-size: .8rem; }
.font-bold    { font-weight: 700; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast),
              color var(--t-fast), box-shadow var(--t-fast),
              transform var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn:hover {
  background: var(--n-100);
  border-color: var(--n-400);
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.btn-primary {
  background: var(--c-600);
  border-color: var(--c-700);
  color: var(--white);
  box-shadow: 0 1px 3px rgba(46,125,50,.35);
}
.btn-primary:hover {
  background: var(--c-700);
  border-color: var(--c-800);
  color: var(--white);
  box-shadow: 0 3px 8px rgba(46,125,50,.35);
}

.btn-secondary {
  border-color: var(--c-300);
  color: var(--c-700);
  background: var(--c-50);
}
.btn-secondary:hover {
  background: var(--c-100);
  border-color: var(--c-500);
  color: var(--c-800);
}

.btn-danger {
  border-color: #fca5a5;
  color: var(--danger);
  background: #fff5f5;
}
.btn-danger:hover {
  background: #fee2e2;
  border-color: var(--danger);
}

.btn-sm {
  padding: .3rem .75rem;
  font-size: .8rem;
  border-radius: var(--r-sm);
}

.btn-lg {
  padding: .7rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--r-lg);
}

/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1.2rem; }

.form-group label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .35rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="search"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .575rem .875rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: .95rem;
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  appearance: none;
  -webkit-appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--n-400); }

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover { border-color: var(--n-400); }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--c-500);
  box-shadow: var(--shadow-focus);
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left .75rem center;
  padding-left: 2.25rem;
}

.form-group textarea { resize: vertical; min-height: 90px; }

.form-hint {
  margin-top: .3rem;
  font-size: .8rem;
  color: var(--text-muted);
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 500;
  cursor: pointer;
}

.form-group input[type="file"] {
  padding: .4rem .875rem;
  background: var(--n-50);
  color: var(--text);
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-normal), transform var(--t-normal);
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card h3 { color: var(--c-800); }
.card p  { font-size: .875rem; color: var(--text-muted); }

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.card-link:hover { text-decoration: none; }
.card-link:hover .card { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ═══════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, var(--c-700) 0%, var(--c-500) 60%, var(--c-400) 100%);
  color: var(--white);
  border-radius: var(--r-xl);
  padding: 3rem 2rem;
  margin-bottom: 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

/* Decorative circles */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  pointer-events: none;   /* decorative only — must never intercept taps */
}
.hero::before { width: 300px; height: 300px; top: -100px; left: -60px; }
.hero::after  { width: 200px; height: 200px; bottom: -60px; right: -40px; }

.hero h1 {
  color: var(--white);
  font-size: 2.1rem;
  margin-bottom: .5rem;
  position: relative;
}
.hero p {
  font-size: 1.05rem;
  opacity: .88;
  margin-bottom: 1.5rem;
  position: relative;
}
.hero-cta {
  display: inline-flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;   /* guarantee above ::before / ::after decorations */
}
/* Solid white — the primary "login" action */
.btn-hero-primary {
  background: rgba(255,255,255,.95);
  color: var(--c-700);
  border-color: transparent;
  font-weight: 700;
}
.btn-hero-primary:hover {
  background: #fff;
  color: var(--c-800);
}
/* Secondary "activate" action — visibly white but lighter than primary */
.btn-hero-outline {
  background: rgba(255,255,255,.82);
  color: var(--c-800);
  border-color: transparent;
}
.btn-hero-outline:hover {
  background: rgba(255,255,255,.95);
  color: var(--c-900);
}

/* ═══════════════════════════════════════════════════════════════
   HOME PAGE SECTIONS
   ═══════════════════════════════════════════════════════════════ */
.home-sections { display: flex; flex-direction: column; gap: 2.5rem; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--c-100);
}
.section-header h2 { margin-bottom: 0; }
.link-more {
  font-size: .85rem;
  font-weight: 600;
  color: var(--c-600);
  white-space: nowrap;
}
.link-more:hover { color: var(--c-800); }

/* Facility cards */
.facility-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}

.facility-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem .75rem;
  text-align: center;
  color: var(--text);
  font-weight: 600;
  font-size: .875rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-normal), transform var(--t-normal),
              border-color var(--t-fast), background var(--t-fast);
  text-decoration: none;
}
.facility-card:hover {
  background: var(--c-50);
  border-color: var(--c-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--c-800);
  text-decoration: none;
}
.facility-icon { font-size: 2rem; line-height: 1; }
.facility-name { line-height: 1.3; }

/* Events list */
.event-list { list-style: none; display: flex; flex-direction: column; gap: .6rem; }

.event-item {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: .75rem 1rem;
  box-shadow: var(--shadow-sm);
}

.event-date-badge {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--c-100);
  color: var(--c-800);
  border-radius: var(--r-sm);
  padding: .3rem .6rem;
  font-size: .75rem;
  font-weight: 700;
  min-width: 44px;
  text-align: center;
  line-height: 1.3;
}

.event-date { font-size: .8rem; color: var(--text-muted); }
.event-title { font-weight: 600; }
.event-location { font-size: .82rem; color: var(--text-muted); margin-top: .15rem; }

/* Announcements */
.announcement-list { list-style: none; display: flex; flex-direction: column; gap: .75rem; }

.announcement-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: 4px solid var(--c-400);
  border-radius: var(--r-md);
  padding: .9rem 1rem;
  box-shadow: var(--shadow-sm);
}
.announcement-item strong { display: block; font-size: 1rem; margin-bottom: .25rem; }
.announcement-item p { font-size: .875rem; color: var(--text-muted); margin: 0; }

.committee-badge {
  display: inline-block;
  background: var(--c-100);
  color: var(--c-800);
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: var(--r-full);
  margin-bottom: .4rem;
  letter-spacing: .02em;
}

/* ═══════════════════════════════════════════════════════════════
   AUTH CARDS
   ═══════════════════════════════════════════════════════════════ */
.auth-wrap {
  min-height: calc(100vh - var(--header-h) - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
}

.auth-card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-600), var(--c-400));
  color: var(--white);
  font-size: 1.6rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(46,125,50,.35);
}

.auth-card h1 {
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: .35rem;
}

.auth-card .auth-subtitle {
  text-align: center;
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: .875rem;
  color: var(--text-muted);
}
.auth-footer a { font-weight: 600; }

.login-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: .85rem;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  padding: .6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: .95rem;
  box-sizing: border-box;
}
.btn-google:hover { background: var(--surface-hover, #f7f7f7); }
.btn-google svg { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   ALERTS & FLASH MESSAGES
   ═══════════════════════════════════════════════════════════════ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .75rem 1rem;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
  font-size: .875rem;
  border: 1px solid transparent;
  line-height: 1.5;
}

.alert::before { flex-shrink: 0; font-size: 1rem; line-height: 1.5; }

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}
.alert-success::before { content: '✓'; }

.alert-error {
  background: #fef2f2;
  color: var(--danger);
  border-color: #fecaca;
}
.alert-error::before { content: '✕'; }

.alert-info {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}
.alert-info::before { content: 'ℹ'; }

.alert-warn {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}
.alert-warn::before { content: '⚠'; }

/* Flash at top of page (above main) */
.flash-banner {
  padding: .75rem 1.5rem;
  font-size: .9rem;
  font-weight: 500;
  text-align: center;
}
.flash-banner.flash-success { background: #dcfce7; color: #15803d; }
.flash-banner.flash-error   { background: #fee2e2; color: var(--danger); }

/* PWA install prompt (above main, below flash) */
.pwa-install-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .6rem;
  padding: .65rem 1.25rem;
  background: var(--c-100);
  color: var(--c-800);
  font-size: .9rem;
  font-weight: 500;
  text-align: center;
  border-bottom: 1px solid var(--c-200);
}
.pwa-install-banner #pwa-install-action {
  background: var(--c-600);
  color: var(--white);
  border: none;
  border-radius: var(--r-md);
  padding: .3rem .9rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.pwa-install-banner .pwa-install-dismiss {
  background: none;
  border: none;
  color: var(--c-700);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: .2rem .4rem;
}

.pwa-install-banner--warn {
  background: #fffbeb;
  color: #92400e;
  border-bottom-color: #fde68a;
}
.pwa-install-banner--warn .pwa-install-dismiss { color: #92400e; }

/* ═══════════════════════════════════════════════════════════════
   REPORT FORM
   ═══════════════════════════════════════════════════════════════ */
.report-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  max-width: 560px;
}
.report-form-card h1 {
  margin-bottom: .35rem;
  font-size: 1.5rem;
}
.report-form-card > .form-intro {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════
   REPORT DETAIL
   ═══════════════════════════════════════════════════════════════ */
.report-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  max-width: 580px;
}

.report-fields {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .5rem 1.25rem;
  margin-top: 1.25rem;
}
.report-fields dt {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding-top: .1rem;
}
.report-fields dd { color: var(--text); }

/* ═══════════════════════════════════════════════════════════════
   STATUS & ROLE BADGES
   ═══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: var(--r-full);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.status-badge { display: inline-flex; align-items: center; gap: .3rem; }
.status-badge::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-new           { color: #1d4ed8; }
.status-new::before   { background: #3b82f6; }
.status-acknowledged  { color: #c2410c; }
.status-acknowledged::before { background: #fb923c; }
.status-in_progress   { color: #92400e; }
.status-in_progress::before  { background: #fbbf24; }
.status-resolved      { color: #166534; }
.status-resolved::before     { background: var(--c-400); }
.status-closed        { color: var(--text-muted); }
.status-closed::before       { background: var(--n-400); }

.role-badge {
  display: inline-flex;
  padding: .18rem .55rem;
  border-radius: var(--r-sm);
  font-size: .72rem;
  font-weight: 700;
  margin-inline-start: .25rem;
}
.role-admin    { background: #fce7f3; color: #9d174d; }
.role-official { background: #ede9fe; color: #5b21b6; }
.role-resident { background: var(--c-100); color: var(--c-800); }

/* ═══════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.data-table th {
  background: var(--n-50);
  color: var(--text-muted);
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .65rem .9rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: .6rem .9rem;
  border-bottom: 1px solid var(--n-100);
  vertical-align: middle;
  color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  transition: background var(--t-fast);
}
.data-table tbody tr:hover td { background: var(--c-50); }
.empty-row {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem !important;
  font-size: .9rem;
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN
   ═══════════════════════════════════════════════════════════════ */
.admin-section { max-width: 960px; }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-normal), transform var(--t-normal);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card h3 { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .5rem; }
.stat-num { font-size: 2.4rem; font-weight: 800; color: var(--c-600); line-height: 1; }

.admin-links {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 2.5rem;
}

.recent-sync { margin-top: 2.5rem; }

/* ═══════════════════════════════════════════════════════════════
   PAGE SECTIONS (public content pages)
   ═══════════════════════════════════════════════════════════════ */
.page-title {
  margin-bottom: 1.75rem;
}
.page-title h1 { margin-bottom: .25rem; }
.page-title p  { color: var(--text-muted); font-size: .9rem; }

/* Report type tabs */
.report-type-tabs {
  display: flex;
  gap: .4rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  padding-bottom: -.1rem;
}
.tab {
  padding: .45rem 1rem;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  font-size: .875rem;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}
.tab:hover { background: var(--c-50); color: var(--c-700); text-decoration: none; }
.tab.active {
  background: var(--surface);
  color: var(--c-700);
  border-color: var(--border);
  font-weight: 700;
  position: relative;
}
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--surface);
}

/* ═══════════════════════════════════════════════════════════════
   FACILITY OPEN/CLOSED & SCHEDULE
   ═══════════════════════════════════════════════════════════════ */
.open-now-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .9rem;
  border-radius: var(--r-full);
  font-size: .875rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.open-now-badge.open  { background: #dcfce7; color: #166534; }
.open-now-badge.closed{ background: #fee2e2; color: #991b1b; }

.open-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.open-now-badge.open  .open-dot { background: #22c55e; animation: pulse 2s infinite; }
.open-now-badge.closed .open-dot { background: #ef4444; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

.schedule-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.schedule-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--n-100);
  transition: background var(--t-fast);
}
.schedule-row:last-child { border-bottom: none; }
.schedule-row:hover { background: var(--c-50); }
.schedule-row.schedule-closed { color: var(--text-muted); }

.schedule-day-name { font-weight: 600; font-size: .9rem; padding-top: .1rem; }
.schedule-hours { font-size: .9rem; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; gap: .2rem; }
.schedule-period { display: block; }

/* ═══════════════════════════════════════════════════════════════
   CARDS GRID (for committees)
   ═══════════════════════════════════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* ═══════════════════════════════════════════════════════════════
   GPS / CAMERA
   ═══════════════════════════════════════════════════════════════ */
.gps-btn-row {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin-bottom: .5rem;
}
#gps-status { font-size: .8rem; color: var(--text-muted); }
#meter-select-container { margin-top: .5rem; }

/* ═══════════════════════════════════════════════════════════════
   OFFLINE PAGE
   ═══════════════════════════════════════════════════════════════ */
.offline-hero {
  text-align: center;
  padding: 5rem 1rem;
}
.offline-hero .icon { font-size: 4rem; margin-bottom: 1.5rem; opacity: .7; }

/* ═══════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════ */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}
.stack   { display: flex; flex-direction: column; gap: .75rem; }
.cluster { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ═══════════════════════════════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  :root { --content-width: 100%; }

  h1 { font-size: 1.45rem; }

  .site-header { padding: 0 1rem; }

  /* Hamburger menu */
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,.15);
    border: none;
    border-radius: var(--r-sm);
    cursor: pointer;
    color: var(--white);
    font-size: 1.2rem;
    flex-shrink: 0;
    order: 2;   /* stays the true outer-left edge item */
  }

  /* a11y control sits just to the hamburger's right (inward), not past it.
     The push-to-left-edge margin moves here (off .nav-toggle) so the two
     end up flush adjacent instead of split apart by empty space. */
  .a11y-dropdown {
    order: 1;
    margin-right: auto;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    right: 0;
    left: 0;
    background: var(--c-700);
    padding: .75rem;
    gap: .3rem;
    flex-direction: column;
    border-bottom: 2px solid var(--c-800);
    box-shadow: 0 8px 16px rgba(0,0,0,.2);
  }
  .site-nav.open { display: flex; }

  .nav-dropdown { width: 100%; }

  .site-nav a,
  .nav-dropdown > summary {
    display: block;
    width: 100%;
    padding: .6rem .9rem;
    border-radius: var(--r-sm);
  }

  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background: rgba(0,0,0,.15);
    border-radius: var(--r-sm);
    margin-top: .25rem;
  }
  .nav-dropdown-menu a {
    color: rgba(255,255,255,.85);
    padding: .45rem 1.2rem;
  }
  .nav-dropdown-menu a:hover { background: rgba(255,255,255,.1); color: var(--white); }

  .nav-username { padding: .6rem .9rem; }

  .hero { padding: 2rem 1.25rem; }
  .hero h1 { font-size: 1.6rem; }

  .auth-card { padding: 1.75rem 1.25rem; }

  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .data-table  { font-size: .8rem; }
  .data-table th, .data-table td { padding: .45rem .6rem; }

  .facility-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}


/* ── Photo-capture widget ─────────────────────────────────────────────────── */
.photo-capture-widget { margin-top: .35rem; }

.pc-state-idle {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}
.pc-or {
  color: var(--text-muted);
  font-size: .9rem;
}
.pc-gallery-label { cursor: pointer; }

.pc-video {
  width: 100%;
  max-height: 280px;
  border-radius: var(--r-md);
  background: #000;
  display: block;
  object-fit: cover;
}
.pc-cam-btns {
  display: flex;
  gap: .65rem;
  margin-top: .55rem;
}

.pc-state-preview {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.pc-preview-img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--n-100);
  display: block;
}

/* ── SW update notification ───────────────────────────────────────────────── */

/* Red dot on the hamburger button (mobile) */
.update-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 9px;
  height: 9px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--c-700);   /* matches header background */
  pointer-events: none;
}

/* "Update Now" link in the nav */
.nav-update-link {
  color: #ef4444 !important;
  font-weight: 700;
  animation: pulse-text 2s ease-in-out infinite;
}
.nav-update-link:hover { color: #dc2626 !important; }

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50%       { opacity: .65; }
}

/* Version label in footer */
.version-label {
  display: block;
  margin-top: .25rem;
  font-size: .72rem;
  opacity: .45;
  letter-spacing: .03em;
}

/* ── Hero welcome (logged-in state) ──────────────────────────────────────── */
.hero-welcome {
  font-size: 1.15rem;
  font-weight: 600;
  color: rgba(255,255,255,.95);
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

/* ── Force 24-hour display in time inputs (Chrome/Edge/Safari on en-US) ──── */
input[type="time"]::-webkit-datetime-edit-ampm-field,
input[type="datetime-local"]::-webkit-datetime-edit-ampm-field {
  display: none;
}
