:root {
  --brand-900: #0a3128;
  --brand-800: #0d4335;
  --brand-700: #146b52;
  --brand-600: #1c7d61;
  --brand-500: #229372;
  --brand-300: #7fc9ab;
  --brand-150: #cfe9dd;
  --brand-100: #e6f4ee;
  --brand-50:  #f2f9f5;

  --ink-900: #12211d;
  --ink-700: #2c3b36;
  --ink-600: #56655f;
  --ink-500: #6b7d75;
  --ink-400: #869790;
  --ink-300: #aebab4;
  --border:  #e0e8e3;
  --border-strong: #c7d4cd;
  --surface: #ffffff;
  --surface-alt: #f6f9f7;
  --surface-sunken: #eef4f0;

  --healthy:  #1c7d61;
  --moderate: #c98a2c;
  --degraded: #c1473a;
  --pending:  #93a29b;

  --accent-sand: #d9a15a;
  --accent-sky:  #2f6f8f;

  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(10, 49, 40, 0.06), 0 1px 1px rgba(10, 49, 40, 0.04);
  --shadow-md: 0 6px 20px rgba(10, 49, 40, 0.09);
  --shadow-lg: 0 20px 60px rgba(10, 49, 40, 0.28);
  --shadow-popover: 0 10px 30px rgba(10, 49, 40, 0.18);
}


.data-warning-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink-900);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.data-warning-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.data-warning-toast.success {
  background: var(--healthy);
}

/* Shared confirm/sign-out style modal, used by both the Menro and Ranger dashboards. */

.confirm-modal {
  position: relative;
  width: min(360px, 92vw);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.confirm-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--ink-400);
  font-size: 1.3rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, color 0.16s ease;
}

.confirm-modal-close:hover {
  background: var(--surface-sunken);
  color: var(--ink-700);
}

.confirm-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fbeae7;
  color: var(--degraded);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.confirm-modal-icon svg {
  width: 22px;
  height: 22px;
}

.confirm-modal-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 8px;
}

.confirm-modal-text {
  font-size: 0.83rem;
  color: var(--ink-500);
  line-height: 1.55;
  margin-bottom: 24px;
}

.confirm-modal-actions {
  display: flex;
  width: 100%;
  gap: 10px;
}

.btn-confirm-cancel,
.btn-confirm-danger {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.btn-confirm-cancel {
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-700);
}

.btn-confirm-cancel:hover {
  background: var(--surface-sunken);
}

.btn-confirm-danger {
  border: 1.5px solid var(--degraded);
  background: var(--degraded);
  color: #fff;
}

.btn-confirm-danger:hover {
  background: #a83a2f;
  border-color: #a83a2f;
}

/* ── Event View Modal (shared: MENRO dashboard + ranger) ── */
.ev-modal {
  position: relative;
  background: var(--surface);
  width: min(480px, 92vw);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(10, 49, 40, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: auto;
}

.ev-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  background: linear-gradient(135deg, var(--brand-800, #0d5540), var(--brand-900, #083d2e));
  color: #fff;
}

.ev-modal-header-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.ev-modal-header-text { flex: 1; min-width: 0; }

.ev-modal-eyebrow {
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}

.ev-modal-close {
  background: rgba(255,255,255,0.12);
  border: none; color: #fff;
  width: 30px; height: 30px;
  border-radius: 50%; font-size: 1.3rem; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.16s;
}
.ev-modal-close:hover { background: rgba(255,255,255,0.26); }

.ev-modal-body {
  padding: 6px 22px 24px;
  display: flex; flex-direction: column;
}

.ev-field {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light, #e3eae7);
}
.ev-field:last-child { border-bottom: none; }

.ev-field-label {
  display: block;
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-400, #8fa89e);
  margin-bottom: 7px;
}

.ev-field-title {
  font-size: 1rem; font-weight: 600;
  color: var(--ink-900, #0a1f1a);
  line-height: 1.4;
}

.ev-type-badge {
  display: inline-block;
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--brand-dark, #1c6b4a);
  background: var(--brand-tint, #e8f4ef);
  border: 1px solid var(--brand-mid, #b2d8c6);
  padding: 4px 12px;
  border-radius: 20px;
}

.ev-field-value {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.93rem; font-weight: 500;
  color: var(--ink-800, #1a2f28);
}

.ev-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #e6f4ee;
  color: var(--brand-700, #165f4a);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ev-icon svg { width: 16px; height: 16px; }

.ev-ranger-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 2px;
}
.ev-ranger-chip {
  display: inline-flex; align-items: center;
  background: var(--brand-tint, #e8f4ef);
  color: var(--brand-dark, #1c6b4a);
  font-size: 0.8rem; font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.ev-notes-text {
  font-size: 0.88rem; color: var(--ink-700, #2a4038);
  line-height: 1.65;
  background: var(--surface-alt, #f4f8f6);
  border-left: 3px solid var(--brand-400, #5aaa88);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin-top: 2px;
}

.ev-modal-footer {
  padding: 8px 22px 22px;
}

.ev-close-btn {
  width: 100%;
  padding: 11px;
  background: var(--brand-700, #165f4a);
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: background 0.16s;
}
.ev-close-btn:hover { background: var(--brand-800, #0d5540); }

/* Shared across every page (Login, Admin, MENRO, Ranger) — shown only when
   the installed app is opened from its home-screen icon, never in a plain
   browser tab. See the small inline script right after <body> on each page
   that uses it. */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.app-splash-hide { opacity: 0; }

.app-splash-logo {
  width: min(260px, 60vw);
  height: auto;
}

/* ── Signal quality badge (topbar connection indicator) ─────────────── */
.signal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  font-family: var(--font-body, inherit);
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  line-height: 1;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.signal-bars-icon { width: 20px; height: 14px; flex-shrink: 0; }
.sig-bar { fill: currentColor; opacity: 0.18; }

.signal-badge[data-signal="4"],
.signal-badge[data-signal="3"] {
  background: #eaf6ef;
  color: #1c7d61;
  border-color: #cdeada;
}
.signal-badge[data-signal="4"] .sig-bar                    { opacity: 1; }
.signal-badge[data-signal="3"] .sig-bar:nth-child(-n+3)    { opacity: 1; }

.signal-badge[data-signal="2"] {
  background: #fef9ec;
  color: #b45309;
  border-color: #f5d179;
}
.signal-badge[data-signal="2"] .sig-bar:nth-child(-n+2)    { opacity: 1; }

.signal-badge[data-signal="1"],
.signal-badge[data-signal="0"] {
  background: #fbeceb;
  color: #c1473a;
  border-color: #f3d3d0;
}
.signal-badge[data-signal="1"] .sig-bar:nth-child(1)       { opacity: 1; }

.signal-badge[data-signal="4"] .signal-bars-icon,
.signal-badge[data-signal="3"] .signal-bars-icon {
  animation: sigPulse 2.5s ease-in-out infinite;
}

@keyframes sigPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

.signal-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface, #fff);
  border: 1px solid var(--border-strong, #c7d4cd);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-700, #2c3b36);
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(10,33,27,0.14);
  z-index: 999;
  pointer-events: none;
}
