/* ══════════════════════════════════════════════════════════
   TVT Temple Voter Check-in — DigiYatra / Android Mobile UI
   ══════════════════════════════════════════════════════════ */

:root {
  --primary: #6C1A1A;
  --primary-dark: #4a1010;
  --primary-light: #962828;
  --accent: #E8A020;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --text: #111827;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --error: #dc2626;
  --error-bg: #fee2e2;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.12);
  --topbar-h: 60px;
  --bottomnav-h: 66px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; font-family: var(--font); background: var(--bg); color: var(--text); }

.screen { display: none; height: 100vh; overflow: hidden; }
.screen.active { display: flex; flex-direction: column; }
.text-left { text-align: left; }

/* ═══════════════ LOGIN ═══════════════ */
.login-bg {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(155deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
  padding: 20px;
  overflow-y: auto;
}
.login-card {
  background: #fff;
  border-radius: 26px;
  padding: 34px 26px;
  width: 100%;
  max-width: 390px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  text-align: center;
  animation: slideUp 0.35s ease;
}
@keyframes slideUp { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }
.temple-badge {
  width: 72px; height: 72px; margin: 0 auto 10px;
  border-radius: 22px; background: #fdf3e3;
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
}
.login-title { font-size: 30px; font-weight: 900; color: var(--primary); letter-spacing: 2px; }
.login-sub { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 4px; }
.login-sub2 { font-size: 12px; color: var(--text-secondary); margin: 2px 0 24px; }

/* ═══════════════ TOP APP BAR ═══════════════ */
.topbar {
  height: var(--topbar-h);
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hamburger { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; padding: 6px; border-radius: 8px; }
.topbar-title { display: flex; flex-direction: column; min-width: 0; }
.topbar-logo { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: 0.5px; }
.topbar-sub { font-size: 11px; color: rgba(255,255,255,0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.gate-chip {
  background: rgba(255,255,255,0.16);
  color: #fde6c4;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  max-width: 90px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.live-badge {
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 99px;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.55; } }

/* ═══════════════ DRAWER ═══════════════ */
.drawer-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.48); z-index: 200; }
.drawer-overlay.open { display: block; }
.drawer {
  position: fixed; left: -285px; top: 0; bottom: 0; width: 280px;
  background: #fff; z-index: 300;
  transition: left 0.28s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,0.18);
}
.drawer.open { left: 0; }
.drawer-header { background: linear-gradient(135deg, var(--primary-dark), var(--primary-light)); padding: 42px 22px 22px; }
.drawer-temple { color: #fff; font-size: 20px; font-weight: 800; }
.drawer-role { color: #fde6c4; font-size: 13px; margin-top: 4px; }
.drawer-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 22px; cursor: pointer;
  color: var(--text); font-size: 15px; font-weight: 600;
  user-select: none;
}
.nav-item:hover, .nav-item.active { background: #fdf2f2; color: var(--primary); }
.nav-icon { font-size: 19px; width: 24px; text-align: center; }
.nav-divider { height: 1px; background: var(--border); margin: 8px 20px; }

/* ═══════════════ PAGE AREA ═══════════════ */
#screen-app { flex-direction: column; }
.page-content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding-bottom: calc(var(--bottomnav-h) + 84px);
  -webkit-overflow-scrolling: touch;
}
.page { display: none; padding: 14px; }
.page.active { display: block; animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* ═══════════════ HERO & DASHBOARD ═══════════════ */
.hero-card {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 65%, #8b2323 100%);
  color: #fff;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
}
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hero-kicker { font-size: 10px; font-weight: 800; letter-spacing: 1.2px; color: var(--accent); margin-bottom: 4px; }
.hero-big { font-size: 38px; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
.hero-slash { opacity: 0.5; font-size: 28px; }
.hero-sub { font-size: 12.5px; color: rgba(255,255,255,0.85); margin-top: 4px; }
.hero-ring-wrap { position: relative; width: 78px; height: 78px; flex-shrink: 0; }
.hero-ring { width: 78px; height: 78px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.18); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.hero-ring-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff;
}
.hero-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.btn-gold { background: var(--accent); color: #2b0909; font-weight: 800; }
.btn-glass { background: rgba(255,255,255,0.16); color: #fff; border: 1px solid rgba(255,255,255,0.28); }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.stat-card {
  background: #fff; border-radius: 14px; padding: 14px 10px; text-align: center;
  box-shadow: var(--shadow); border-bottom: 3px solid var(--border);
}
.stat-num { font-size: 26px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-top: 3px; }
.stat-total { border-bottom-color: var(--primary); } .stat-total .stat-num { color: var(--primary); }
.stat-voted { border-bottom-color: var(--success); } .stat-voted .stat-num { color: var(--success); }
.stat-pending { border-bottom-color: var(--warning); } .stat-pending .stat-num { color: var(--warning); }

.progress-card { background: #fff; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.progress-label { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.progress-track { height: 12px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--success), #4ade80); border-radius: 99px; transition: width 0.5s ease; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.section-title { font-size: 14.5px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }

.ward-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.ward-item { background: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); }
.ward-row { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.ward-bar-bg { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.ward-bar-fill { height: 100%; background: var(--success); border-radius: 99px; }

.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-item {
  background: #fff; border-radius: 12px; padding: 11px 13px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow);
}
.recent-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px; flex-shrink: 0; overflow: hidden;
}
.recent-avatar img { width: 100%; height: 100%; object-fit: cover; }
.recent-info { flex: 1; min-width: 0; }
.recent-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-ward { font-size: 11.5px; color: var(--text-secondary); }
.recent-time { font-size: 11px; color: var(--success); font-weight: 700; text-align: right; white-space: nowrap; }

/* ═══════════════ SCANNER & DIGIYATRA PASS ═══════════════ */
.scanner-container { max-width: 500px; margin: 0 auto; }
.scanner-tabs {
  display: flex; background: #fff; border-radius: 14px;
  padding: 4px; margin-bottom: 14px; box-shadow: var(--shadow); gap: 4px;
}
.tab-btn {
  flex: 1; padding: 10px 6px; border: none; background: none;
  border-radius: 10px; font-size: 13px; font-weight: 700;
  cursor: pointer; color: var(--text-secondary);
}
.tab-btn.active { background: var(--primary); color: #fff; }

.card-panel { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.qr-box-wrapper {
  position: relative; border-radius: 18px; overflow: hidden;
  background: #000; margin-bottom: 10px; min-height: 280px;
}
#qr-reader { width: 100%; }
#qr-reader video { width: 100% !important; border-radius: 14px; }

.qr-frame-corner { position: absolute; width: 24px; height: 24px; border-color: var(--accent); border-style: solid; pointer-events: none; z-index: 10; }
.tl { top: 14px; left: 14px; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.tr { top: 14px; right: 14px; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.bl { bottom: 14px; left: 14px; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.br { bottom: 14px; right: 14px; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }

.scan-hint-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.scan-hint { font-size: 12.5px; color: var(--text-secondary); font-weight: 600; }
.qr-status { text-align: center; font-size: 12px; color: var(--text-secondary); padding: 4px; font-weight: 600; }

.quick-lookup-results { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; max-height: 360px; overflow-y: auto; }
.ql-item {
  border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer;
}
.ql-item:hover { background: #fafafa; }

/* DigiYatra Verified Pass */
.digiyatra-pass {
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-md);
  border-top: 6px solid var(--success);
  animation: popIn 0.25s ease;
}
@keyframes popIn { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }
.pass-badge {
  background: var(--success-bg); color: var(--success);
  font-size: 11.5px; font-weight: 800; padding: 6px 12px;
  border-radius: 99px; display: inline-block; margin-bottom: 10px;
}
.pass-voter-name { font-size: 22px; font-weight: 900; color: var(--text); }
.pass-voter-rel { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.pass-meta-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: var(--bg); border-radius: 12px; padding: 10px; margin: 12px 0;
}
.pass-meta-grid span { display: block; font-size: 10.5px; color: var(--text-secondary); }
.pass-meta-grid strong { font-size: 12.5px; color: var(--text); }

.photo-box { margin-bottom: 14px; }
.photo-header { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.photo-video-wrap { border-radius: 14px; overflow: hidden; background: #111; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; }
.photo-video { width: 100%; height: 100%; object-fit: cover; }
.pass-actions { display: flex; flex-direction: column; gap: 8px; }
.pass-sub-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Final Result Banner */
.scan-result-banner {
  background: #fff; border-radius: 22px; padding: 28px 20px;
  text-align: center; box-shadow: var(--shadow-md); animation: popIn 0.3s ease;
}
.scan-result-banner.success-banner { border-top: 7px solid var(--success); }
.scan-result-banner.warning-banner { border-top: 7px solid var(--warning); }
.scan-result-banner.error-banner { border-top: 7px solid var(--error); }
.result-icon { font-size: 60px; margin-bottom: 6px; }
.result-badge-pill {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.8px;
  padding: 4px 12px; border-radius: 99px; margin-bottom: 12px;
}
.success-banner .result-badge-pill { background: var(--success-bg); color: var(--success); }
.warning-banner .result-badge-pill { background: var(--warning-bg); color: var(--warning); }
.error-banner .result-badge-pill { background: var(--error-bg); color: var(--error); }
.result-photo {
  width: 110px; height: 110px; border-radius: 50%; object-fit: cover;
  margin: 0 auto 12px; border: 4px solid var(--success); display: block;
}
.warning-banner .result-photo { border-color: var(--warning); }
.result-name { font-size: 22px; font-weight: 900; margin-bottom: 6px; }
.result-info { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.result-time { font-size: 12.5px; color: var(--text-secondary); margin-top: 6px; font-weight: 600; }
.result-live-counter {
  margin-top: 14px; background: var(--bg); padding: 10px 14px;
  border-radius: 12px; font-size: 13.5px; font-weight: 800; color: var(--primary);
}

/* ═══════════════ VOTER LIST ═══════════════ */
.toolbar { margin-bottom: 10px; }
.search-input {
  width: 100%; padding: 12px 15px; border: 2px solid var(--border); border-radius: 12px;
  font-size: 14px; font-family: var(--font); background: #fff; outline: none; margin-bottom: 9px;
}
.search-input:focus { border-color: var(--primary); }
.toolbar-filters { display: flex; gap: 8px; }
.filter-btn {
  padding: 7px 14px; border-radius: 20px; border: 2px solid var(--border);
  font-size: 12.5px; font-weight: 700; cursor: pointer; background: #fff; color: var(--text-secondary);
}
.filter-btn.active { border-color: var(--primary); color: var(--primary); background: #fdf2f2; }
.voter-count-bar { font-size: 12.5px; color: var(--text-secondary); font-weight: 600; margin-bottom: 9px; }

.voters-list { display: flex; flex-direction: column; gap: 8px; }
.voter-card {
  background: #fff; border-radius: 13px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow);
  cursor: pointer; border-left: 4px solid transparent;
}
.voter-card.voted-card { border-left-color: var(--success); }
.voter-card.pending-card { border-left-color: var(--warning); }
.voter-avatar {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: #fff; flex-shrink: 0; overflow: hidden;
}
.voted-avatar { background: linear-gradient(135deg, var(--success), #4ade80); }
.pending-avatar { background: linear-gradient(135deg, var(--warning), #fbbf24); }
.voter-info { flex: 1; min-width: 0; }
.voter-name { font-size: 14.5px; font-weight: 700; }
.voter-meta { font-size: 12px; color: var(--text-secondary); }
.voter-aadhar { font-size: 11px; color: var(--text-secondary); letter-spacing: 0.7px; margin-top: 1px; }
.voter-status { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.status-voted { background: var(--success-bg); color: var(--success); }
.status-pending { background: var(--warning-bg); color: var(--warning); }

/* ═══════════════ REPORTS & SLIPS ═══════════════ */
.slips-card {
  background: #fff; border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); border-left: 5px solid var(--accent);
}
.slips-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; line-height: 1.5; }
.slips-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.slip-info-box {
  font-size: 12px; color: #6b4e00; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 8px; padding: 9px 11px; margin-top: 10px;
}

.reports-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.report-card {
  background: #fff; border-radius: var(--radius); padding: 16px 12px;
  text-align: center; box-shadow: var(--shadow); cursor: pointer;
}
.report-icon { font-size: 32px; margin-bottom: 6px; }
.report-title { font-size: 13.5px; font-weight: 800; margin-bottom: 3px; }
.report-desc { font-size: 11px; color: var(--text-secondary); margin-bottom: 10px; }
.report-voted { border-top: 4px solid var(--success); }
.report-pending { border-top: 4px solid var(--warning); }
.report-print { border-top: 4px solid var(--primary); }

.upload-card {
  background: #fff; border-radius: var(--radius); padding: 20px; text-align: center;
  box-shadow: var(--shadow); border: 2px dashed #d1d5db;
}
.upload-icon { font-size: 34px; margin-bottom: 6px; }
.upload-text { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.upload-hint { font-size: 11.5px; color: var(--text-secondary); margin-bottom: 12px; }
.upload-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.upload-result { margin-top: 12px; padding: 10px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.upload-result.ok { background: var(--success-bg); color: var(--success); }
.upload-result.fail { background: var(--error-bg); color: var(--error); }

/* ═══════════════ SETTINGS ═══════════════ */
.settings-card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.settings-title { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.danger-card { border: 2px solid #fecaca; }
.danger-title { color: var(--error); }
.danger-desc { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 12px; }

/* ═══════════════ FORMS & BUTTONS ═══════════════ */
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); margin-bottom: 5px; }
.form-input {
  width: 100%; padding: 12px 14px; border: 2px solid var(--border); border-radius: 12px;
  font-size: 14.5px; font-family: var(--font); outline: none; background: #fff;
}
.form-input:focus { border-color: var(--primary); }
.form-input.large { font-size: 20px; letter-spacing: 2px; text-align: center; font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 18px; border-radius: 12px; border: none;
  font-size: 14px; font-weight: 700; cursor: pointer; font-family: var(--font);
  transition: transform 0.1s; user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 12px; border-radius: 9px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-outline { background: #fff; color: var(--primary); border: 2px solid var(--primary); }
.btn-danger { background: var(--error); color: #fff; }
.btn-success { background: var(--success); color: #fff; }

.error-msg { color: var(--error); font-size: 13px; margin-top: 8px; text-align: center; font-weight: 600; }
.success-msg { color: var(--success); font-size: 13px; margin-top: 10px; padding: 10px; background: var(--success-bg); border-radius: 10px; font-weight: 600; }
.hidden { display: none !important; }
.empty-state { text-align: center; padding: 26px 12px; color: var(--text-secondary); font-size: 13.5px; }
.loading-spinner { text-align: center; padding: 28px; color: var(--text-secondary); }

/* ═══════════════ FAB & BOTTOM NAV ═══════════════ */
.fab-area { position: fixed; bottom: calc(var(--bottomnav-h) + 14px); right: 14px; z-index: 50; }
.fab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border: 2px solid var(--accent);
  box-shadow: 0 6px 18px rgba(108,26,26,0.42); cursor: pointer;
}
.fab-icon { font-size: 20px; }
.fab-label { font-size: 9px; font-weight: 800; margin-top: 1px; }

.bottom-nav {
  height: var(--bottomnav-h); background: #fff; display: flex;
  border-top: 1px solid var(--border); flex-shrink: 0; z-index: 90;
  padding-bottom: env(safe-area-inset-bottom);
}
.bnav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; border: none; background: none; cursor: pointer;
  color: var(--text-secondary); position: relative;
}
.bnav-item.active { color: var(--primary); }
.bnav-item.active::after {
  content: ''; position: absolute; top: 0; left: 22%; right: 22%;
  height: 3px; background: var(--primary); border-radius: 0 0 4px 4px;
}
.bnav-icon { font-size: 20px; }
.bnav-label { font-size: 11px; font-weight: 700; }

/* ═══════════════ MODALS ═══════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.52);
  z-index: 400; display: flex; align-items: flex-end; justify-content: center;
}
.modal-card {
  background: #fff; border-radius: 24px 24px 0 0; padding: 22px 18px 28px;
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
  animation: slideUp 0.25s ease;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; font-size: 17px; font-weight: 800; margin-bottom: 16px; }
.modal-close {
  background: var(--bg); border: none; border-radius: 50%; width: 32px; height: 32px;
  cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.modal-actions-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.modal-actions-wrap .btn { flex: 1 1 45%; }

.vd-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.vd-label { color: var(--text-secondary); font-weight: 600; }
.vd-val { font-weight: 700; text-align: right; }
.vd-photo { display: block; width: 92px; height: 92px; border-radius: 50%; object-fit: cover; margin: 0 auto 14px; border: 3px solid var(--success); }

/* ═══════════════ TOAST ═══════════════ */
.toast {
  position: fixed; bottom: calc(var(--bottomnav-h) + 18px); left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 11px 22px; border-radius: 99px;
  font-size: 13.5px; font-weight: 600; z-index: 999; white-space: nowrap; max-width: 92vw;
  box-shadow: var(--shadow-md);
}
.toast.toast-success { background: var(--success); }
.toast.toast-error { background: var(--error); }
.toast.toast-warning { background: var(--warning); }

@media (min-width: 640px) {
  .reports-grid { grid-template-columns: repeat(4, 1fr); }
  .page { padding: 20px 24px; max-width: 760px; margin: 0 auto; }
  .modal-card { border-radius: 22px; margin: auto; }
  .modal-overlay { align-items: center; }
  .ward-list { grid-template-columns: repeat(3, 1fr); }
}
