/* RARE Member Map. System A editorial: Georgia headlines, Arial body, teal #4cc3b5 on teal-ink #0f201e. */
:root {
  --teal: #4cc3b5; --teal-light: #79e0d0; --teal-pale: #cdeee8; --teal-deep: #1d8a7c; --ink-teal: #0f201e;
  --ink: #2b3a3a; --body: #3d4545; --muted: #5d6c6a; --meta: #9aa6a4; --pill: #e3f6f3; --soft: #eef3f3; --callout: #fafaf6; --white: #ffffff;
  --grad: linear-gradient(160deg, #18443d 0%, #102d28 55%, #0c2421 100%);
  --rm: #4cc3b5; --rcm: #0f201e; --ra: #1d8a7c; --staff: #ffffff;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: Arial, Helvetica, sans-serif; color: var(--ink); background: var(--soft); font-size: 14px; line-height: 1.45; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: normal; margin: 0; line-height: 1.1; }
a { color: var(--teal-deep); }
.mark { background: linear-gradient(transparent 58%, rgba(76,195,181,.78) 58%, rgba(76,195,181,.78) 94%, transparent 94%); padding: 0 3px; }
.kicker { color: var(--teal-light); font-size: 11px; font-weight: bold; letter-spacing: 3px; text-transform: uppercase; }
.accentbar { width: 46px; height: 4px; background: var(--teal); border-radius: 3px; }
.logo-chip { background: rgba(255,255,255,.94); border-radius: 10px; padding: 8px 14px; display: inline-flex; align-items: center; }
.logo-chip img { height: 38px; width: auto; display: block; }

/* ---------- Login ---------- */
.login-page { min-height: 100%; background: var(--grad); display: grid; place-items: center; padding: 24px; color: var(--white); }
.login-card { width: 100%; max-width: 420px; }
.login-card .logo-chip { margin-bottom: 34px; }
.login-card .kicker { display: block; }
.login-card h1 { font-size: 38px; color: var(--white); margin: 14px 0 10px; }
.login-card p.sub { color: var(--teal-pale); margin: 0 0 28px; font-size: 15px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--teal-light); font-weight: bold; margin-bottom: 6px; }
.field input { width: 100%; padding: 13px 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: var(--white); font-size: 16px; font-family: inherit; }
.field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(76,195,181,.25); }
.btn { display: inline-block; background: var(--teal); color: var(--white); font-weight: bold; border: 0; border-radius: 10px; padding: 13px 22px; font-size: 15px; cursor: pointer; font-family: inherit; letter-spacing: .3px; }
.btn:hover { background: #3fb3a5; }
.btn.block { width: 100%; margin-top: 8px; }
.error { color: #ffd2c8; font-size: 13px; min-height: 18px; margin-top: 10px; }
.login-foot { margin-top: 34px; color: var(--meta); font-size: 12px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 340px 1fr; height: 100vh; }
.side { background: var(--grad); color: var(--white); display: flex; flex-direction: column; overflow: hidden; }
.side-head { padding: 18px 20px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-head .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.side-head h1 { font-size: 26px; color: var(--white); margin-top: 14px; }
.side-head .kicker { margin-top: 12px; display: block; }
.side-head .accentbar { margin: 10px 0 0; }
.signout { color: var(--teal-pale); font-size: 12px; text-decoration: none; }
.signout:hover { color: var(--white); }
.side-body { flex: 1; overflow-y: auto; padding: 14px 20px 20px; }
.side-body::-webkit-scrollbar { width: 8px; } .side-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0 16px; }
.stat { background: rgba(255,255,255,.06); border-radius: 10px; padding: 10px 12px; border-left: 3px solid var(--teal); }
.stat b { display: block; font-family: Georgia, serif; font-size: 24px; font-weight: normal; color: var(--white); }
.stat span { font-size: 11px; color: var(--teal-pale); letter-spacing: 1px; text-transform: uppercase; }
.section { margin-top: 18px; }
.section h2 { font-size: 15px; color: var(--white); margin-bottom: 8px; }
.filters label { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; font-size: 14px; }
.filters input { accent-color: var(--teal); width: 16px; height: 16px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 2px solid rgba(255,255,255,.85); flex: none; }
.dot.rm { background: var(--rm); } .dot.rcm { background: var(--rcm); border-color: var(--teal-light); } .dot.ra { background: var(--ra); } .dot.staff { background: var(--staff); border-color: var(--ink-teal); }
.filters .n { margin-left: auto; color: var(--teal-pale); font-size: 12px; }
.search { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: var(--white); font-size: 14px; font-family: inherit; }
.search:focus { outline: none; border-color: var(--teal); }
.results { margin-top: 8px; max-height: 220px; overflow-y: auto; }
.result { padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.result:hover { background: rgba(255,255,255,.08); }
.result small { color: var(--teal-pale); margin-left: auto; white-space: nowrap; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 13px; cursor: pointer; }
.list li:hover { color: var(--teal-light); }
.list li b { font-family: Georgia, serif; font-weight: normal; color: var(--teal-light); }
.mini { font-size: 12px; color: var(--teal-pale); line-height: 1.5; }
.mini a { color: var(--teal-light); }
.toggle { background: transparent; border: 1px solid rgba(255,255,255,.25); color: var(--white); border-radius: 20px; padding: 5px 12px; font-size: 12px; cursor: pointer; font-family: inherit; }
.toggle:hover { border-color: var(--teal); }
.unmapped { display: none; }
.unmapped.open { display: block; }

/* ---------- Map ---------- */
.mapwrap { position: relative; }
#map { position: absolute; inset: 0; background: #e8eeee; }
.leaflet-container { font-family: Arial, Helvetica, sans-serif; }
.leaflet-tooltip.member-tip { background: var(--white); border: 0; border-left: 4px solid var(--teal); border-radius: 8px; box-shadow: 0 6px 24px rgba(15,32,30,.18); padding: 10px 12px; color: var(--ink); font-size: 13px; line-height: 1.4; width: max-content; max-width: 280px; white-space: normal; }
.leaflet-tooltip.member-tip::before { display: none; }
.member-tip .name { font-family: Georgia, serif; font-size: 16px; margin-bottom: 2px; }
.member-tip .pill { display: inline-block; background: var(--pill); color: var(--teal-deep); font-size: 10px; font-weight: bold; letter-spacing: 1.5px; padding: 2px 8px; border-radius: 20px; margin: 2px 4px 4px 0; text-transform: uppercase; }
.member-tip .pill.dark { background: var(--ink-teal); color: var(--teal-light); }
.member-tip .meta { color: var(--muted); font-size: 12px; }
.member-tip .warn { color: #b3582a; font-size: 11px; margin-top: 4px; }
.member-tip .go { color: var(--teal-deep); font-size: 11px; margin-top: 6px; font-weight: bold; }
.leaflet-tooltip.area-tip { background: var(--ink-teal); color: var(--white); border: 0; border-radius: 8px; padding: 10px 12px; box-shadow: 0 6px 24px rgba(15,32,30,.3); font-size: 13px; }
.leaflet-tooltip.area-tip::before { display: none; }
.area-tip .title { font-family: Georgia, serif; font-size: 17px; color: var(--white); }
.area-tip .big { font-family: Georgia, serif; font-size: 30px; color: var(--teal-light); line-height: 1.1; margin: 2px 0 4px; }
.area-tip .bd { color: var(--teal-pale); font-size: 12px; }
.city-label { background: transparent; border: 0; box-shadow: none; }
.city-label span { display: inline-block; background: rgba(15,32,30,.86); color: var(--white); border: 1px solid var(--teal); border-radius: 20px; padding: 3px 9px; font-size: 11px; font-weight: bold; letter-spacing: .5px; white-space: nowrap; transform: translate(-50%, -50%); }
.city-label span b { color: var(--teal-light); font-family: Georgia, serif; font-weight: normal; font-size: 13px; margin-left: 4px; }
.legend { position: absolute; right: 14px; bottom: 26px; z-index: 500; background: rgba(255,255,255,.95); border-radius: 10px; padding: 10px 12px; box-shadow: 0 4px 18px rgba(15,32,30,.12); font-size: 12px; }
.legend div { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.legend .dot.staff { border-color: var(--ink-teal); }
.mapmode { position: absolute; left: 14px; top: 14px; z-index: 500; display: flex; gap: 6px; }
.mapmode button { background: rgba(255,255,255,.95); border: 1px solid #d7e2e0; color: var(--ink); border-radius: 20px; padding: 6px 12px; font-size: 12px; cursor: pointer; font-family: inherit; box-shadow: 0 2px 10px rgba(15,32,30,.08); }
.mapmode button.on { background: var(--teal); color: var(--white); border-color: var(--teal); }
.leaflet-control-zoom { border: 0 !important; box-shadow: 0 2px 10px rgba(15,32,30,.12) !important; }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.7) !important; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { max-height: 46vh; }
}
