/* ============================================================
   Balatan LGU — design system
   Restrained civic / government dashboard aesthetic.
   ============================================================ */
:root {
  /* Brand */
  --navy: #0f2c47;          /* header, dark surfaces */
  --navy-700: #16395c;
  --primary: #1d5b8f;       /* primary actions / links */
  --primary-600: #1a4f7d;
  --primary-050: #eef4fa;
  --accent: #b7791f;        /* rare emphasis (priority) */
  --accent-050: #fbf3e4;

  /* Neutrals */
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e4e8ee;
  --border-strong: #d3d9e2;
  --text: #16202c;
  --text-2: #3f4b59;
  --muted: #6b7684;

  /* Functional status palette (used as soft tints) */
  --c-slate: #64748b;
  --c-blue: #2372a8;
  --c-violet: #7c5cbf;
  --c-green: #2b8a63;
  --c-amber: #b7791f;
  --c-orange: #cf6a2e;
  --c-red: #c23b52;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 34, 56, .06), 0 1px 3px rgba(16, 34, 56, .04);
  --shadow-md: 0 4px 16px rgba(16, 34, 56, .10);
  --ring: 0 0 0 3px rgba(29, 91, 143, .18);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { letter-spacing: -0.011em; color: var(--text); }

/* ---------- Header ---------- */
.app-header {
  background: var(--navy);
  color: #fff;
  height: 60px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 13px;
  position: sticky;
  top: 0;
  z-index: 900;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.app-header .logo {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex: none; overflow: hidden;
}
.app-header .logo svg { width: 22px; height: 22px; }
.app-header .logo img { width: 100%; height: 100%; object-fit: cover; }
.app-header h1 {
  font-size: 1rem; margin: 0; line-height: 1.15; font-weight: 600;
  letter-spacing: -0.01em; color: #fff;
}
.app-header .sub {
  font-size: .72rem; opacity: .68; font-weight: 400; letter-spacing: .01em;
}
.app-header .spacer { flex: 1; }
.header-link {
  color: rgba(255, 255, 255, .92);
  font-size: .82rem; font-weight: 500;
  padding: 7px 13px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, .16);
  transition: background .15s, border-color .15s;
}
.header-link:hover { background: rgba(255, 255, 255, .10); text-decoration: none; }
.header-user {
  color: rgba(255, 255, 255, .92);
  font-size: .82rem; font-weight: 600;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px; background: none;
}
.icon-btn svg { width: 18px; height: 18px; }
.header-user-btn {
  display: flex; align-items: center; gap: 8px; background: none; border: none;
  cursor: pointer; padding: 5px 10px 5px 5px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16); transition: background .15s;
}
.header-user-btn:hover { background: rgba(255, 255, 255, .10); }
.avatar-circle {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: rgba(255, 255, 255, .14); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.avatar-circle svg { width: 15px; height: 15px; }

/* Narrow phones: a signed-in resident's header (theme, bell, profile, Sign
   out, Home) does not fit one 60px row. Instead of widening the page, the
   header may wrap: the logo + title stay on the first row (title truncated),
   and the controls continue right-aligned on the next row. Every control
   stays visible and usable; wider screens are unaffected. */
@media (max-width: 600px) {
  .app-header {
    height: auto; min-height: 56px; padding: 8px 12px;
    flex-wrap: wrap; justify-content: flex-end; gap: 6px 8px;
  }
  .app-header > div:not(.logo):not(.spacer) { flex: 1 1 140px; min-width: 0; }
  .app-header h1 { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app-header .sub { display: none; }
  .app-header .spacer { display: none; }
  .header-link { padding: 6px 10px; font-size: .78rem; white-space: nowrap; }
  .header-user { max-width: 72px; }
  .header-user-btn { padding: 4px 8px 4px 4px; gap: 6px; }
}

/* ---------- Layout ---------- */
.container { max-width: 1220px; margin: 0 auto; padding: 24px 22px 48px; }
.grid { display: grid; gap: 18px; }
.two-col { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}
/* The report form is the primary element on the resident page — a single
   focused column, not a form-vs-map split. */
.report-card { max-width: 640px; margin: 0 auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card h2 { margin: 0 0 3px; font-size: 1.02rem; font-weight: 600; }
.card .hint { color: var(--muted); font-size: .82rem; margin: 0 0 18px; line-height: 1.5; }
.section-title { font-size: 1.15rem; margin: 4px 0 16px; font-weight: 600; }

/* ---------- Forms ---------- */
label {
  display: block; font-size: .78rem; font-weight: 600; color: var(--text-2);
  margin: 15px 0 6px; letter-spacing: .005em;
}
input, select, textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: .9rem; font-family: inherit; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #9aa4b1; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: var(--ring);
}
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7684' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px;
}
.field-row { display: flex; gap: 14px; }
.field-row > div { flex: 1; min-width: 0; }

/* Required-field indicator — visually obvious, not just HTML validation */
.req-mark { color: var(--c-red); font-weight: 700; }
.field-note { margin: 6px 0 0; font-size: .78rem; }

/* Reporter-type fieldset + segmented control */
.form-fieldset { border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 16px; margin: 4px 0 18px; }
.form-fieldset legend { font-size: .78rem; font-weight: 600; color: var(--text-2);
  padding: 0 6px; letter-spacing: .005em; }
.segmented { display: flex; gap: 8px; }
.seg-btn {
  flex: 1; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text-2); font-family: inherit; font-size: .86rem; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.seg-btn:hover { border-color: var(--primary); }
.seg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Compact variant — pill-shaped, sized to content, for secondary in-page
   toggles (e.g. the map color-mode switch) that shouldn't compete visually
   with primary form controls. */
.segmented.compact {
  display: inline-flex; width: auto; gap: 2px; padding: 2px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; margin-bottom: 14px;
}
.segmented.compact .seg-btn {
  flex: 0 0 auto; padding: 4px 12px; font-size: .74rem;
  border: none; border-radius: 999px; background: transparent; color: var(--text-2);
}
.segmented.compact .seg-btn:hover { background: rgba(0, 0, 0, .05); }
.segmented.compact .seg-btn.active { background: var(--primary); color: #fff; }

/* ---------- Searchable barangay combobox ---------- */
.combobox { position: relative; }
.combobox-list {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 220px; overflow-y: auto; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); z-index: 30;
}
.combobox-list.open { display: block; }
.combobox-item { padding: 9px 12px; font-size: .88rem; cursor: pointer; }
.combobox-item:hover { background: var(--primary-050); color: var(--primary); }
.combobox-empty { padding: 9px 12px; font-size: .82rem; color: var(--muted); }

/* ---------- Location box (compact, map collapsed by default) ---------- */
.location-box { background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; }
.link-btn {
  display: block; background: none; border: none; color: var(--primary);
  font-family: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
  padding: 8px 0 0; text-align: left;
}
.link-btn:hover { text-decoration: underline; }
#map-wrap { margin-top: 10px; }
#report-map { height: 220px; }

/* ---------- Multi-photo upload with removable thumbnails ---------- */
.photo-upload-box { background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; }
.photo-count-hint { display: inline-block; margin-left: 10px; }
.photo-thumb { position: relative; width: 84px; height: 84px; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; }
.photo-remove {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px;
  border-radius: 50%; border: 1px solid var(--border-strong); background: #fff;
  color: var(--c-red); font-size: 1rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.photo-remove:hover { background: var(--c-red); color: #fff; border-color: var(--c-red); }

/* ---------- Account status box (profile modal) ---------- */
.account-status-box { font-size: .84rem; color: var(--text-2); margin-top: 6px; }
.account-status-box > div { padding: 6px 0; }
.acct-warn { color: var(--c-amber); }
.acct-danger { color: var(--c-red); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border: 1px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; font-size: .86rem; font-weight: 600; font-family: inherit;
  background: var(--primary); color: #fff; line-height: 1.2;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .04s;
}
.btn:hover { background: var(--primary-600); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--text-2); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--surface-2); border-color: var(--muted); }
.btn.accent { background: #fff; color: var(--accent); border-color: #e7d3ac; }
.btn.accent:hover { background: var(--accent-050); }
.btn.small { padding: 6px 11px; font-size: .78rem; }
.btn.block { width: 100%; }
.btn svg { width: 15px; height: 15px; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border);
  margin-bottom: 22px; flex-wrap: wrap;
}
.tab {
  padding: 11px 15px; cursor: pointer; border: none; background: none;
  font-size: .88rem; font-weight: 600; color: var(--muted); font-family: inherit;
  border-bottom: 2px solid transparent; margin-bottom: -1px; letter-spacing: -0.005em;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Map ---------- */
#report-map, #admin-map, #heatmap {
  border-radius: var(--radius); z-index: 1; border: 1px solid var(--border);
}
#report-map { height: 340px; }
.leaflet-container { font-family: var(--font); }
.map-hint { font-size: .76rem; color: var(--muted); margin-top: 10px; }
.gps-status {
  font-size: .8rem; padding: 8px 11px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); margin-top: 10px;
}

/* ---------- Badges (soft tinted, not saturated) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 6px;
  font-size: .72rem; font-weight: 600; letter-spacing: .005em;
  text-transform: capitalize; line-height: 1.4;
  --bc: var(--c-slate);
  color: var(--bc); background: color-mix(in srgb, var(--bc) 13%, #fff);
  border: 1px solid color-mix(in srgb, var(--bc) 26%, #fff);
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--bc); flex: none;
}
.badge.plain::before { display: none; }

.badge.low,        .badge.impact-Low        { --bc: var(--c-green); }
.badge.medium,     .badge.impact-Moderate   { --bc: var(--c-amber); }
.badge.high,       .badge.impact-High       { --bc: var(--c-orange); }
.badge.critical,   .badge.impact-Critical   { --bc: var(--c-red); }
.badge.status-pending    { --bc: var(--c-slate); }
.badge.status-validation { --bc: var(--c-amber); }
.badge.status-verified   { --bc: var(--c-blue); }
.badge.status-ongoing    { --bc: var(--c-violet); }
.badge.status-resolved   { --bc: var(--c-green); }
.badge.status-fake       { --bc: var(--c-red); }
.badge.status-unresolved { --bc: var(--c-orange); }
.badge.status-not_in_scope,
.badge.status-neutral    { --bc: #94a3b8; }

/* ---------- Report list ---------- */
.report-list { display: grid; gap: 11px; }
.report-item {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px;
  background: var(--surface); cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.report-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
/* Thumbnail + content row — gives each list card a visual anchor instead of
   text-only rows. */
.report-item .ri-row { display: flex; gap: 12px; align-items: flex-start; }
.report-item .ri-thumb {
  width: 64px; height: 64px; flex: none; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2);
}
/* Placeholder when a thumbnail file cannot be loaded (see common.js). */
.report-item .ri-thumb-missing {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .62rem; text-align: center; line-height: 1.2;
}
.report-item .ri-thumb-missing::after { content: "No photo"; }
.photo-missing {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-width: 120px; min-height: 90px; padding: 8px; box-sizing: border-box;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--muted); font-size: .75rem;
}
.report-item .ri-body { flex: 1; min-width: 0; }
.report-item .top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.report-item .title { font-weight: 600; margin: 0; font-size: .95rem; }
.report-item .meta { color: var(--muted); font-size: .78rem; margin: 5px 0 9px; }
.report-item .badges { display: flex; gap: 6px; flex-wrap: wrap; }
.report-item.pinned { border-left: 3px solid var(--accent); }

/* ---------- Clickable operational dashboard cards ---------- */
.op-card-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 1100px) { .op-card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .op-card-grid { grid-template-columns: repeat(2, 1fr); } }
.op-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 14px; box-shadow: var(--shadow); text-align: left; cursor: pointer;
  font-family: inherit; transition: transform .18s var(--ease-civic), box-shadow .18s, border-color .15s;
}
.op-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.op-card .label { color: var(--muted); font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.op-card .value { font-size: 1.55rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }

/* ---------- KPI tiles ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 820px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
/* Admin Transparency Dashboard: 6 summary tiles as 3 x 2 */
.kpi-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .kpi-grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .kpi-grid.cols-3 { grid-template-columns: 1fr; } }
.tr-empty { padding: 60px 12px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 17px; box-shadow: var(--shadow);
}
.kpi .label {
  color: var(--muted); font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px;
}
.kpi .value { font-size: 1.7rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.kpi .value.warn { color: var(--c-red); }
.kpi .value.ok { color: var(--c-green); }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filters > div { flex: 1; min-width: 130px; }
.filters label { margin-top: 0; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 27, 43, .48);
  backdrop-filter: blur(2px);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 1000; padding: 40px 16px; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: 12px; max-width: 680px; width: 100%;
  box-shadow: var(--shadow-md); padding: 24px; margin: auto 0;
}
/* Admin report-management modal carries more labeled sections — a bit wider. */
#admin-modal .modal { max-width: 760px; }
/* Reusable wide modal for the two report-detail views (resident detail and
   admin report management). Uses more of a desktop screen while staying
   width:100% (inside the backdrop's 16px gutter) on tablets and phones.
   Smaller dialogs (confirmations, duplicate warning, Valid ID, offenses,
   profile) do not use it. The #admin-modal selector is repeated so this
   wins over the 760px rule above. */
.modal.modal--wide,
#admin-modal .modal.modal--wide { max-width: min(1080px, 94vw); }
.modal.modal--wide #detail-mini-map,
.modal.modal--wide .mini-map { height: 260px; }
.modal h3 { margin-top: 0; margin-bottom: 4px; font-size: 1.15rem; }
.modal h4 { margin: 20px 0 6px; font-size: .82rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); }
.close-x {
  float: right; cursor: pointer; font-size: 1.3rem; line-height: 1;
  color: var(--muted); border: none; background: none; padding: 4px;
}
.close-x:hover { color: var(--text); }
.modal .subhead { color: var(--muted); font-size: .8rem; margin: 0; }
.modal .inline-form { background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-top: 4px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 10px 0 4px; }
.timeline li { padding: 4px 0 14px 20px; border-left: 2px solid var(--border);
  position: relative; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 2px; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--primary); border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border-strong);
}
.timeline strong { font-size: .88rem; }
.timeline .when { font-size: .74rem; color: var(--muted); margin: 1px 0 2px; }

/* ---------- Data table ---------- */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; overflow-y: hidden; }
table.data { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.data th, table.data td { text-align: left; padding: 11px 14px; }
table.data thead th {
  color: var(--muted); font-size: .68rem; text-transform: uppercase;
  letter-spacing: .05em; background: var(--surface-2);
  border-bottom: 1px solid var(--border); font-weight: 600;
}
table.data tbody td { border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: var(--surface-2); }
.trend-rising { color: var(--c-red); font-weight: 600; }
.trend-declining { color: var(--c-green); font-weight: 600; }
.trend-steady { color: var(--muted); }
.muted-cell { color: var(--muted); font-size: .78rem; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--navy); color: #fff; padding: 11px 18px; border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 500; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 1200; box-shadow: var(--shadow-md);
  max-width: 90vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--c-red); }
#toast.success { background: var(--c-green); }

/* ---------- Misc ---------- */
.photo-preview { max-width: 100%; border-radius: var(--radius-sm); margin-top: 10px;
  display: none; border: 1px solid var(--border); }
.photo-preview-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.photo-preview-list img { width: 84px; height: 84px; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--border); }
.report-photo { max-width: 100%; border-radius: var(--radius-sm); margin: 12px 0;
  border: 1px solid var(--border); }
.empty { text-align: center; color: var(--muted); padding: 44px 12px; font-size: .88rem; }
.chart-box { position: relative; height: 262px; }
.pill-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .76rem;
  color: var(--muted); margin-top: 12px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle; }

.install-banner {
  display: none; align-items: center; justify-content: center; gap: 12px;
  background: var(--navy-700); color: #fff; padding: 9px 16px;
  text-align: center; font-size: .84rem; font-weight: 500;
}
.install-banner .btn { padding: 5px 12px; }

.login-wrap { max-width: 400px; margin: 56px auto; }
.login-wrap .brandmark {
  width: 48px; height: 48px; border-radius: 50%; background: var(--primary-050);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; overflow: hidden;
}
.login-wrap .brandmark svg { width: 26px; height: 26px; }
.login-wrap .brandmark img { width: 100%; height: 100%; object-fit: cover; }

.callout {
  font-size: .8rem; color: var(--text-2); background: var(--primary-050);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, #fff);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 14px;
}
.drivers { font-size: .8rem; color: var(--text-2); }
.drivers strong { color: var(--text); }

/* Info-icon toggle (e.g. CII formula breakdown, affected-count clarification)
   — collapsed by default, expands on click instead of always being shown. */
.info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0; margin-left: 2px; vertical-align: middle;
  background: none; border: none; color: var(--muted); cursor: pointer;
  border-radius: 50%; transition: color .15s, background .15s;
}
.info-btn:hover { color: var(--primary); background: var(--primary-050); }
.info-btn svg { width: 15px; height: 15px; }
.info-panel {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; margin: 6px 0 12px;
}
.info-panel .drivers, .info-panel .hint { margin: 0; }

/* ============================================================
   Admin console shell — sidebar + topbar
   ============================================================ */
.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 246px; flex: none; background: var(--navy); color: #fff;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 18px 14px; gap: 4px;
  /* When an expanded sub-menu (or a zoomed/short window) makes the menu
     taller than the viewport, scroll inside the sidebar instead of letting
     items spill past the navy background. */
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .22) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); border-radius: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; }
.sb-brand .logo {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
  display: flex; align-items: center; justify-content: center; color: #fff;
  overflow: hidden;
}
.sb-brand .logo svg { width: 21px; height: 21px; }
.sb-brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.sb-brand .name { font-size: .95rem; font-weight: 600; line-height: 1.1; }
.sb-brand .role { font-size: .68rem; opacity: .6; letter-spacing: .04em;
  text-transform: uppercase; margin-top: 2px; }

.sb-label {
  font-size: .64rem; text-transform: uppercase; letter-spacing: .09em;
  color: rgba(255, 255, 255, .38); padding: 12px 12px 6px; font-weight: 600;
}
.sb-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: none; border: none; font-family: inherit; font-size: .89rem;
  font-weight: 500; color: rgba(255, 255, 255, .74);
  padding: 10px 12px; border-radius: 8px; cursor: pointer; transition: background .13s, color .13s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item .count {
  margin-left: auto; font-size: .7rem; font-weight: 700; background: rgba(255,255,255,.16);
  padding: 1px 7px; border-radius: 999px;
}
/* ---------- Manage reports: status sub-menu ---------- */
.nav-group { display: flex; flex-direction: column; }
.nav-caret { margin-left: auto; width: 14px; height: 14px; flex: none;
  opacity: .55; transition: transform .18s var(--ease-civic); }
.nav-group.open .nav-caret { transform: rotate(90deg); }
.nav-submenu {
  max-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 1px;
  padding-left: 30px; transition: max-height .22s var(--ease-civic);
}
.nav-group.open .nav-submenu { max-height: 320px; }
.nav-subitem {
  display: block; width: 100%; text-align: left; background: none; border: none;
  font-family: inherit; font-size: .82rem; font-weight: 500; color: rgba(255, 255, 255, .62);
  padding: 7px 10px; border-radius: 7px; cursor: pointer; transition: background .13s, color .13s;
}
.nav-subitem:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-subitem.active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }
@media (max-width: 900px) {
  .nav-group { width: auto; }
  .nav-submenu { padding-left: 12px; }
  .nav-group.open .nav-submenu { max-height: none; }
}

.sb-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px;
  padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
.sb-foot a {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255, 255, 255, .66); font-size: .85rem; font-weight: 500;
  padding: 9px 12px; border-radius: 8px;
}
.sb-foot a svg { width: 17px; height: 17px; }
.sb-foot a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 30px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 1.2rem; margin: 0; font-weight: 600; }
.topbar .page-sub { margin: 2px 0 0; color: var(--muted); font-size: .82rem; }
.topbar-spacer { flex: 1; }
/* Theme toggle + notification bell kept close together, not spread apart
   by flex space-between. */
.topbar-icons { display: flex; align-items: center; gap: 6px; flex: none; }
.admin-content { padding: 24px 30px 52px; }

/* KPI sub-metric line */
.kpi { display: flex; flex-direction: column; }
.kpi .sub { margin-top: 7px; font-size: .76rem; color: var(--muted); }
.kpi .sub strong { color: var(--text-2); font-weight: 600; }
.kpi .sub.alert strong { color: var(--c-red); }
.kpi .sub.good strong { color: var(--c-green); }

@media (max-width: 900px) {
  .admin-shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static; flex-direction: row;
    align-items: center; flex-wrap: wrap; padding: 10px 14px; gap: 8px;
  }
  .sb-brand { padding: 4px 8px; }
  .sb-brand .role { display: none; }
  .sb-label { display: none; }
  .sb-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .nav-item { width: auto; padding: 8px 11px; }
  .nav-item .count { display: none; }
  .sb-foot { margin: 0 0 0 auto; flex-direction: row; border: none; padding: 0; }
  .topbar { position: static; padding: 16px 20px; }
  .admin-content { padding: 20px; }
}

/* ==========================================================================
   Motion & depth
   One signature element (the 3D location pin on the sign-in card) plus
   quiet, meaningful motion: entrances, count-ups, urgency pulses.
   All non-essential movement respects prefers-reduced-motion.
   ========================================================================== */
:root { --ease-civic: cubic-bezier(.22, .68, .28, 1); }

/* --- Micro-interactions (small, always on) --- */
.btn { transition: transform .16s var(--ease-civic), box-shadow .16s, background .15s, border-color .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.report-item { transition: transform .18s var(--ease-civic), box-shadow .18s; }
.report-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tab { transition: color .15s, border-color .15s; }
.header-link { transition: background .15s, border-color .15s, transform .15s; }
.header-link:hover { transform: translateY(-1px); }

/* Toast: springy arrival */
#toast { transition: opacity .22s, transform .34s cubic-bezier(.34, 1.56, .64, 1); }

/* Modal: scale in */
.modal-backdrop.open .modal { animation: modal-in .26s var(--ease-civic); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
}

@media (prefers-reduced-motion: no-preference) {
  /* --- Orchestrated entrance: cards rise in with a slight stagger --- */
  .container .card, .kpi {
    animation: rise-in .45s var(--ease-civic) backwards;
  }
  .grid > .card:nth-child(2), .kpi:nth-child(2) { animation-delay: .07s; }
  .grid > .card:nth-child(3), .kpi:nth-child(3) { animation-delay: .14s; }
  .kpi:nth-child(4) { animation-delay: .21s; }
  @keyframes rise-in {
    from { opacity: 0; transform: translateY(12px); }
  }

  /* --- Section/tab switches --- */
  .view-anim { animation: view-in .3s var(--ease-civic); }
  @keyframes view-in {
    from { opacity: 0; transform: translateY(8px); }
  }

  /* --- Urgency pulse: only when something is actually critical --- */
  .kpi .sub.alert strong { animation: pulse-alert 2.4s ease-in-out infinite; }
  @keyframes pulse-alert {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
  }

  /* --- Timeline dots pop in sequence --- */
  .timeline li::before { animation: dot-pop .3s var(--ease-civic) backwards; }
  .timeline li:nth-child(2)::before { animation-delay: .08s; }
  .timeline li:nth-child(3)::before { animation-delay: .16s; }
  .timeline li:nth-child(4)::before { animation-delay: .24s; }
  .timeline li:nth-child(5)::before { animation-delay: .32s; }
  @keyframes dot-pop {
    from { transform: scale(0); }
  }
}

/* --- KPI depth (cursor tilt is applied by JS; keep transitions gentle) --- */
.kpi { transform-style: preserve-3d; transition: transform .25s var(--ease-civic), box-shadow .25s; }
.kpi.tilting { transition: box-shadow .25s; }
.kpi:hover { box-shadow: var(--shadow-md); }

/* ==========================================================================
   Signature: floating location pin over sonar rings (sign-in card)
   One clean teardrop pin, softly bobbing and swaying above the geofence
   rings that guard resident sign-in.
   ========================================================================== */
.pin-scene {
  display: flex; justify-content: center;
  margin: 2px 0 12px; pointer-events: none;
}
.pin-stage { position: relative; width: 150px; height: 108px; }
.pin-ground {
  position: absolute; left: 50%; bottom: 2px; width: 124px; height: 44px;
  margin-left: -62px; border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(31, 111, 235, .14) 0 22%, rgba(31, 111, 235, .05) 46%, transparent 66%);
}
.pin-ground .pulse {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(31, 111, 235, .45);
  transform: scale(.2); opacity: 0;
}
.pin-shadow {
  position: absolute; left: 50%; bottom: 18px; width: 30px; height: 8px;
  margin-left: -15px; border-radius: 50%;
  background: rgba(13, 45, 90, .25); filter: blur(3px);
}
.pin-3d { position: absolute; left: 50%; bottom: 26px; margin-left: -19px; }
.pin-body {
  display: block; width: 38px; height: 38px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, #4a94ff 0%, var(--primary) 48%, #12437e 100%);
  box-shadow: 0 6px 14px rgba(13, 45, 90, .3),
              inset 2px 2px 5px rgba(255, 255, 255, .28),
              inset -3px -3px 7px rgba(6, 26, 52, .28);
}
.pin-body::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%;
  background: #fff; box-shadow: inset 0 1.5px 3px rgba(13, 45, 90, .3);
}
@media (prefers-reduced-motion: no-preference) {
  .pin-3d { animation: pin-bob 3.2s ease-in-out infinite; }
  .pin-shadow { animation: shadow-bob 3.2s ease-in-out infinite; }
  .pin-ground .pulse { animation: sonar 3.2s ease-out infinite; }
  .pin-ground .pulse.p2 { animation-delay: 1.6s; }
}
@keyframes pin-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(-3deg); }
}
@keyframes shadow-bob {
  0%, 100% { transform: scale(1); opacity: .8; }
  50% { transform: scale(.7); opacity: .45; }
}
@keyframes sonar {
  0% { transform: scale(.2); opacity: .85; }
  100% { transform: scale(1); opacity: 0; }
}

/* ==========================================================================
   Soft ambience & polish
   ========================================================================== */
/* Hide status pills when they have nothing to say */
.gps-status:empty { display: none; }

/* Toast: keep tidy when messages run long */
#toast { text-align: center; line-height: 1.45; }

/* Inputs: a touch more glow on focus */
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .18);
}

/* Tab underline grows in from the center */
.tab { position: relative; }
.tab::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--primary);
  transform: scaleX(0); transition: transform .28s var(--ease-civic);
}
.tab.active { border-bottom-color: transparent; }
.tab.active::after { transform: scaleX(1); }

/* Cards breathe on hover */
.card { transition: transform .22s var(--ease-civic), box-shadow .22s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 44, 71, .08); }

/* Primary buttons: soft sheen sweep on hover */
.btn { position: relative; overflow: hidden; }
.btn::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -75%; width: 50%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: skewX(-18deg); transition: left .45s var(--ease-civic);
  pointer-events: none;
}
.btn:hover::before { left: 125%; }
.btn.secondary::before, .btn.accent::before { display: none; }

@media (prefers-reduced-motion: no-preference) {
  /* Ambient light: two soft blue washes drifting behind the page */
  body::before, body::after {
    content: ""; position: fixed; z-index: -1; border-radius: 50%;
    filter: blur(70px); pointer-events: none;
  }
  body::before {
    width: 520px; height: 520px; top: -180px; right: -140px;
    background: radial-gradient(circle, rgba(31, 111, 235, .10), transparent 65%);
    animation: drift-a 26s ease-in-out infinite alternate;
  }
  body::after {
    width: 420px; height: 420px; bottom: -160px; left: -120px;
    background: radial-gradient(circle, rgba(31, 111, 235, .08), transparent 65%);
    animation: drift-b 32s ease-in-out infinite alternate;
  }
  @keyframes drift-a {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-70px, 50px) scale(1.15); }
  }
  @keyframes drift-b {
    from { transform: translate(0, 0) scale(1.1); }
    to { transform: translate(60px, -45px) scale(1); }
  }
}

/* ==========================================================================
   Skeleton loaders
   ========================================================================== */
.skeleton-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 10px;
}
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%,
    var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; border-radius: 5px;
}
.skeleton.line { height: 12px; margin: 8px 0; }
.skeleton.w40 { width: 40%; } .skeleton.w60 { width: 60%; } .skeleton.w90 { width: 90%; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: shimmer 1.4s ease-in-out infinite; }
  @keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
}

/* ==========================================================================
   Notification bell
   ========================================================================== */
.bell {
  position: relative; background: none; border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius-sm); color: rgba(255,255,255,.92);
  padding: 7px 11px; cursor: pointer; font-size: .95rem; line-height: 1;
  transition: background .15s;
}
.bell:hover { background: rgba(255,255,255,.10); }
.bell-badge {
  position: absolute; top: -6px; right: -6px; background: var(--c-red);
  color: #fff; font-size: .62rem; font-weight: 700; border-radius: 999px;
  padding: 2px 5px; min-width: 16px; text-align: center;
}
.notif-panel {
  position: fixed; top: 64px; right: 18px; width: min(360px, 92vw);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  display: none; z-index: 1100; max-height: 65vh; overflow-y: auto;
}
.notif-panel.open { display: block; animation: modal-in .22s var(--ease-civic); }
.notif-panel h4 {
  margin: 0; padding: 13px 16px 10px; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border);
}
.notif-item { padding: 11px 16px; border-bottom: 1px solid var(--border);
  font-size: .84rem; color: var(--text-2); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--primary-050); }
.notif-item .when { font-size: .72rem; color: var(--muted); margin-top: 3px; }

/* ==========================================================================
   Status counter strip (admin overview) & I-am-affected button
   ========================================================================== */
.counter-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px; margin-top: 14px;
}
.counter-strip .ct {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--bc, var(--c-slate));
  border-radius: var(--radius-sm); padding: 9px 12px;
}
.counter-strip .ct .n { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.counter-strip .ct .l { font-size: .68rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); }

.affected-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); border-radius: 999px; padding: 8px 15px;
  font-size: .84rem; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all .18s var(--ease-civic);
}
.affected-btn:hover { border-color: var(--primary); color: var(--primary); }
.affected-btn.on {
  background: var(--primary-050); border-color: var(--primary); color: var(--primary);
}
.affected-btn .cnt { font-weight: 700; }
/* Community report card footer: Impact Score on the left, "I am affected"
   on the right; on narrow cards the button wraps onto its own line. */
.report-item .ri-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 12px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border);
}
.report-item .ri-actions .affected-btn { margin-left: auto; }
.affected-btn.sm { padding: 5px 12px; font-size: .78rem; gap: 6px; }
@media (max-width: 420px) {
  .report-item .ri-actions .affected-btn { margin-left: 0; }
}

.progress-photo { max-width: 180px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); margin-top: 6px; display: block; }

/* Mini-map inside the report detail modal (resident + admin) */
#detail-mini-map, .mini-map {
  height: 180px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  margin: 6px 0 4px; z-index: 1;
}

/* ==========================================================================
   Landing page
   ========================================================================== */
body.landing { overflow-x: hidden; }
.hero {
  background: linear-gradient(165deg, var(--navy) 0%, #123a5e 55%, #1d5b8f 130%);
  color: #fff; padding: 72px 22px 84px;
}
.hero-inner {
  max-width: 1100px; margin: 0 auto; display: grid;
  grid-template-columns: 1.25fr .75fr; gap: 32px; align-items: center;
}
.eyebrow {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--primary); font-weight: 700; margin: 0 0 10px;
}
.hero .eyebrow { color: #9cc3ea; }
.hero-title { font-size: clamp(1.9rem, 4.5vw, 3.1rem); line-height: 1.12;
  margin: 0 0 18px; color: #fff; letter-spacing: -0.02em; }
.hero-title span { display: block; }
.accent-line { color: #8ec1f5; }
.hero-sub { font-size: 1.02rem; line-height: 1.65; color: rgba(255,255,255,.82);
  max-width: 520px; margin: 0 0 26px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.btn.cta-main { padding: 12px 26px; font-size: .95rem; background: #fff; color: var(--navy); }
.btn.cta-main:hover { background: #e8f0fa; }
.hero .btn.secondary { background: transparent; color: #fff;
  border-color: rgba(255,255,255,.35); }
.hero .btn.secondary:hover { background: rgba(255,255,255,.10); }
.hero-pin .pin-stage { transform: scale(1.5); transform-origin: center; }
.hero-visual { display: flex; justify-content: center; padding: 30px 0; }

.land-section { max-width: 1100px; margin: 0 auto; padding: 58px 22px 10px; }
.land-h { font-size: clamp(1.35rem, 2.6vw, 1.8rem); margin: 0 0 22px;
  letter-spacing: -0.015em; }
.land-stats { margin-bottom: 20px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  transition: transform .22s var(--ease-civic), box-shadow .22s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.fc-icon {
  width: 40px; height: 40px; margin-bottom: 12px; border-radius: 10px;
  background: var(--primary-050); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.fc-icon svg { width: 21px; height: 21px; }
.feature-card h4 { margin: 0 0 8px; font-size: 1rem; }
.feature-card p { margin: 0; font-size: .86rem; color: var(--text-2); line-height: 1.6; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px; margin-bottom: 8px; }
.portal-card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; color: inherit;
  transition: transform .22s var(--ease-civic), box-shadow .22s, border-color .22s;
}
a.portal-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md);
  border-color: var(--primary); text-decoration: none; }
.portal-card h4 { margin: 0 0 8px; font-size: 1.05rem;
  display: flex; align-items: center; gap: 9px; }
.portal-card h4 svg { width: 20px; height: 20px; color: var(--primary); flex: none; }
.portal-card p { margin: 0; font-size: .87rem; color: var(--text-2); line-height: 1.6; }
.land-footer { text-align: center; padding: 54px 22px 34px; color: var(--muted);
  font-size: .84rem; }
@media (max-width: 780px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; padding: 0 0 8px; }
}

/* Scroll-triggered reveals */
.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(22px);
    transition: opacity .6s var(--ease-civic), transform .6s var(--ease-civic); }
  .reveal.d1 { transition-delay: .1s; } .reveal.d2 { transition-delay: .2s; }
  .reveal.d3 { transition-delay: .3s; }
  .reveal.shown { opacity: 1; transform: none; }
}

/* Theme toggle button */
.theme-toggle { cursor: pointer; font-size: 1rem; background: none; }

/* ==========================================================================
   Dark theme
   ========================================================================== */
:root[data-theme="dark"] {
  --bg: #0e1621;
  --surface: #172230;
  --surface-2: #1d2a3b;
  --border: #263548;
  --border-strong: #33455c;
  --text: #e7edf5;
  --text-2: #b9c5d4;
  --muted: #8294a8;
  --primary: #4f94d6;
  --primary-600: #3f80bd;
  --primary-050: #1a2c40;
  --accent-050: #2c2413;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 22px rgba(0, 0, 0, .45);
  --ring: 0 0 0 3px rgba(79, 148, 214, .28);
}
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background: var(--surface-2); color: var(--text); border-color: var(--border-strong);
}
:root[data-theme="dark"] .modal { background: var(--surface); }
:root[data-theme="dark"] .btn.secondary { background: var(--surface-2);
  color: var(--text-2); border-color: var(--border-strong); }
:root[data-theme="dark"] .btn.secondary:hover { background: var(--surface); }
:root[data-theme="dark"] .hero { background:
  linear-gradient(165deg, #0a1420 0%, #10263c 55%, #17456e 130%); }
:root[data-theme="dark"] .btn.cta-main { background: var(--primary); color: #fff; }
:root[data-theme="dark"] .card:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
:root[data-theme="dark"] .seg-btn { background: var(--surface-2); color: var(--text-2); }
:root[data-theme="dark"] .segmented.compact { background: var(--surface); border-color: var(--border-strong); }
:root[data-theme="dark"] .segmented.compact .seg-btn { background: transparent; }
:root[data-theme="dark"] .segmented.compact .seg-btn:hover { background: rgba(255, 255, 255, .06); }
:root[data-theme="dark"] .combobox-list { background: var(--surface-2); }
:root[data-theme="dark"] .photo-remove { background: var(--surface-2); }
:root[data-theme="dark"] .location-box,
:root[data-theme="dark"] .photo-upload-box { background: var(--surface-2); }
:root[data-theme="dark"] .btn.accent { background: var(--surface-2); border-color: var(--border-strong); }
:root[data-theme="dark"] .btn.accent:hover { background: var(--surface); }

/* "Internal" marker on admin-only sections */
.field-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px;
  font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  vertical-align: 1px; }
.field-tag.int { color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }

/* Photo grid (admin status evidence) */
.attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; margin-top: 12px; }
.attach-item { margin: 0; min-width: 0; padding: 8px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); }
.attach-item img { display: block; width: 100%; height: 120px; object-fit: cover;
  border-radius: 6px; background: var(--surface-2); }
.attach-item figcaption { font-size: .76rem; color: var(--text-2); margin: 6px 0 0;
  overflow-wrap: anywhere; }
:root[data-theme="dark"] .attach-item { background: var(--surface-2); }

/* Assigned Teams: MEO team roster */
.team-roster { padding: 10px 0; border-bottom: 1px solid var(--border); }
.team-roster:last-child { border-bottom: 0; }
.team-roster .meta { margin-top: 4px; }

/* Required admin photo evidence for Verified / Ongoing / Resolved status changes */
.evidence-box { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--c-amber);
  border-radius: var(--radius-sm); background: color-mix(in srgb, var(--c-amber) 7%, transparent); }
.evidence-box label { margin-top: 0; }
.evidence-error { margin: 6px 0 0; color: var(--c-red); font-size: .8rem; font-weight: 600; }

/* Report indicators: labelled Status / Urgency badges and a plain Impact Score metric */
.badge.ind { text-transform: none; }
.metric { font-size: .76rem; font-weight: 600; color: var(--text-2); }
.badge.demo-tag { --bc: var(--c-orange); text-transform: none; }

/* LGU-MEO initiative projects (admin) and the public Accomplished Projects page */
.badge.pstatus-planning          { --bc: var(--c-slate); }
.badge.pstatus-awaiting_approval { --bc: var(--c-amber); }
.badge.pstatus-approved          { --bc: var(--c-blue); }
.badge.pstatus-ongoing           { --bc: var(--c-violet); }
.badge.pstatus-on_hold           { --bc: var(--c-orange); }
.badge.pstatus-completed         { --bc: var(--c-green); }
.badge.pstatus-cancelled         { --bc: #94a3b8; }
.badge.origin-gov { --bc: var(--accent); text-transform: none; }
.project-item, .acc-item { cursor: pointer; }
.progress-track { height: 8px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--border); overflow: hidden; margin: 10px 0 2px; }
.progress-fill { height: 100%; background: var(--c-green); border-radius: inherit; }
.field-tag.pub { color: var(--c-green); background: color-mix(in srgb, var(--c-green) 12%, transparent); }
.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.member-list { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 9px 11px; min-height: 40px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 12px 0 0; color: var(--text-2); }
.check-row input { width: auto; margin: 0; flex: none; }
.check-row.member { margin: 0; }
.form-actions, .btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-row { margin-top: 8px; }
hr.soft { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.status-subform { margin-top: 12px; padding: 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.status-subform p { margin: 0 0 4px; }
@media (max-width: 520px) { .field-row.stack-sm { flex-direction: column; gap: 0; } }
:root[data-theme="dark"] .member-list { background: var(--surface-2); }
.acc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.acc-stat { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.acc-stat .value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.acc-stat .label { font-size: .8rem; color: var(--text-2); }
.acc-flow { margin-top: 6px; }
.badge.acc-tag-done { --bc: var(--c-green); }
.badge.acc-tag-res { --bc: var(--c-blue); }
.badge.acc-tag-init { --bc: var(--accent); }
.badge.acc-tag-status { --bc: var(--c-violet); }
:root[data-theme="dark"] .acc-stat { background: var(--surface-2); }
/* Exact-duplicate report warning */
.dup-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.dup-actions .btn { flex: 1 1 160px; }

/* ---- Photo viewer (lightbox) ---- */
img.zoomable { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 10000; display: none; flex-direction: column;
  background: rgba(10, 18, 30, .92); }
.lightbox.open { display: flex; }
body.lightbox-lock { overflow: hidden; }
.lightbox-bar { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px;
  flex-wrap: wrap; }
.lightbox-btn { min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.2rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.lightbox-btn:hover, .lightbox-btn:focus-visible { background: rgba(255, 255, 255, .25); outline: 2px solid #fff; outline-offset: 1px; }
.lightbox-close { margin-left: 12px; }
.lightbox-zoom { color: #fff; min-width: 52px; text-align: center; font-size: .9rem; }
.lightbox-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 8px 12px 16px; touch-action: none; }
.lightbox-img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center;
  transition: transform .12s ease-out; user-select: none; -webkit-user-drag: none; }
.lightbox-stage.zoomed .lightbox-img { cursor: grab; }
.lightbox-stage.zoomed .lightbox-img:active { cursor: grabbing; }

/* ---- "Other" category / facility: specify field ---- */
.other-specify { margin-top: 8px; }
.other-specify[hidden] { display: none; }

/* ---- Report photos: choose a file or take a photo ---- */
.photo-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.photo-error { color: var(--c-red, #b42318); font-size: .82rem; margin: 6px 0 0; }
.photo-error[hidden] { display: none; }

/* ---- Status-change photos shown to the reporter ---- */
.history-photo-label { font-size: .78rem; color: var(--muted); margin: 6px 0 2px; }
.photo-missing.small { min-width: 120px; min-height: 60px; }

/* ---- "Continue with Google" ---- */
.auth-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: var(--muted); font-size: .85rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--border, #d0d7de); }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.google-note { background: var(--surface-2, #f1f5f9); border-radius: 8px; padding: 8px 10px; }
.google-note[hidden], #google-wrap[hidden] { display: none; }
