:root {
  --ink: #173128;
  --muted: #66736e;
  --paper: #f5f4ee;
  --card: #ffffff;
  --line: #dce3de;
  --green: #1f5a43;
  --green-dark: #153d2f;
  --gold: #c89b3c;
  --blue: #356c8c;
  --danger: #a12a2a;
  --shadow: 0 18px 48px rgba(21, 49, 40, .10);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  background: linear-gradient(180deg, #fbfaf7 0%, var(--paper) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.staff-header {
  padding: 26px clamp(18px, 4vw, 54px);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  background: var(--green-dark);
  color: #fff;
}
.staff-header h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.035em; }
.eyebrow { margin: 0 0 5px; color: #e4c77f; text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 800; }
.subhead { margin: 8px 0 0; color: #d5e2dc; max-width: 820px; }
.public-link { color: #fff; font-weight: 750; white-space: nowrap; }

.staff-shell { width: min(1440px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 50px; }
.auth-panel, .map-search, .controls, .map-card, .metrics article {
  background: var(--card);
  border: 1px solid rgba(31,90,67,.12);
  box-shadow: var(--shadow);
}
.auth-panel { padding: 20px; border-radius: 18px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 520px); gap: 24px; align-items: center; }
.auth-panel h2 { margin: 0 0 4px; }
.auth-panel p { margin: 0; color: var(--muted); }
.auth-controls label, .controls label, .map-search label { font-weight: 750; font-size: .85rem; }
.auth-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; margin-top: 6px; }
input, select {
  width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #ccd6d0; border-radius: 10px; color: var(--ink); background: #fff;
}
button {
  min-height: 44px; padding: 10px 15px; border: 0; border-radius: 10px; background: var(--green); color: #fff; font-weight: 800;
}
button:hover { background: var(--green-dark); }
button:disabled { opacity: .55; cursor: wait; }
button.quiet { background: #e8eeea; color: var(--ink); }
.status { color: var(--muted); font-size: .86rem; margin-top: 7px; }
.status.error { color: var(--danger); }
.status.ok { color: var(--green); }

.map-search {
  margin-top: 18px;
  padding: 16px;
  border-radius: 16px;
  display: grid;
  grid-template-columns: minmax(280px, 1.5fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.map-search label { display: grid; gap: 6px; }

.controls {
  margin-top: 12px;
  padding: 16px;
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(5, minmax(145px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}
.controls label { display: grid; gap: 6px; }
.controls label span { color: var(--muted); font-weight: 500; }

.metrics { margin: 18px 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.metrics article { padding: 16px; border-radius: 14px; display: grid; gap: 3px; }
.metrics span { font-size: clamp(1.45rem, 3vw, 2.2rem); font-weight: 850; line-height: 1; }
.metrics small { color: var(--muted); }

.map-card { border-radius: 20px; overflow: hidden; }
.map-heading { padding: 18px 20px; display: flex; justify-content: space-between; gap: 20px; align-items: center; border-bottom: 1px solid var(--line); }
.map-heading h2 { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: .82rem; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.cluster-dot { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--green); color: #fff; font-size: .72rem; }
.point-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; background: var(--gold); border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(200,155,60,.35); }
.provider-dot { width: 24px; height: 24px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--blue); color: #fff; font-weight: 900; }
.needs-map { height: min(68vh, 760px); min-height: 480px; background: #e9eeea; }
.map-note { margin: 0; padding: 12px 18px 16px; color: var(--muted); font-size: .82rem; }

.need-cluster-icon, .provider-marker-icon { background: transparent; border: 0; }
.need-cluster {
  min-width: 46px; height: 46px; padding: 0 9px; border-radius: 999px; display: grid; place-items: center;
  background: var(--green); color: #fff; border: 3px solid rgba(255,255,255,.92); box-shadow: 0 5px 16px rgba(0,0,0,.22); font-weight: 850;
}
.need-cluster.urgent { background: #8b2f2f; }
.provider-marker {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: var(--blue); color: #fff; border: 3px solid rgba(255,255,255,.95); box-shadow: 0 5px 15px rgba(0,0,0,.22); font-weight: 950; font-size: 1.08rem;
}
.provider-marker.verified { box-shadow: 0 0 0 3px rgba(200,155,60,.65), 0 5px 15px rgba(0,0,0,.22); }
.popup-title { font-weight: 850; margin-bottom: 5px; }
.popup-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.popup-muted { color: #64716b; font-size: .82rem; margin-top: 6px; }
.popup-link { display: inline-block; margin-top: 8px; color: var(--green); font-weight: 800; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #d6aa4e;
  outline-offset: 3px;
}

@media (max-width: 1180px) {
  .controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .auth-panel { grid-template-columns: 1fr; }
  .map-search { grid-template-columns: 1fr 1fr; }
  .map-search button { width: 100%; }
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls button { width: 100%; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
  .staff-header { flex-direction: column; }
  .staff-shell { width: min(100% - 18px, 1440px); padding-top: 16px; }
  .auth-row { grid-template-columns: 1fr; }
  .map-search, .controls { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .needs-map { min-height: 430px; height: 64vh; }
}
