/* Donor-Hospital Rapid Contact — clinician pilot (standalone, no styles.css).
   Mobile-first: Dr. Botha answers a DonorNet page from his phone. */

:root {
  --pt-navy: #16324f;
  --pt-teal: #0e7c66;
  --pt-bg: #f4f7f9;
  --pt-line: #d9e2ea;
  --pt-danger: #b3261e;
  --pt-amber-bg: #fff7e0;
  --pt-amber-line: #e6c34a;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--pt-bg);
  color: #1c2733;
}

/* ------------------------------ login ------------------------------ */
.pt-login {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.pt-login-card {
  background: #fff;
  border: 1px solid var(--pt-line);
  border-radius: 14px;
  padding: 28px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 28px rgba(22, 50, 79, .08);
}
.pt-brand {
  margin: 0 0 4px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--pt-teal);
}
.pt-login-card h1 { margin: 0 0 4px; font-size: 22px; color: var(--pt-navy); }
.pt-sub { margin: 0 0 20px; color: #5a6b7b; font-size: 14px; }
.pt-login-card label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
.pt-login-card input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--pt-line);
  border-radius: 8px;
  font-size: 16px;
}
#login-pin { letter-spacing: .5em; }

.pt-btn {
  display: inline-block;
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.pt-btn-primary { background: var(--pt-navy); color: #fff; }
.pt-btn-primary:active { background: #0f2438; }
.pt-btn-ghost { background: #fff; color: var(--pt-navy); border-color: var(--pt-line); }
.pt-btn-sm { width: auto; padding: 7px 12px; font-size: 13px; margin-top: 0; }
.pt-btn[disabled] { opacity: .45; cursor: not-allowed; }
.pt-error { color: var(--pt-danger); font-size: 14px; margin: 10px 0 0; }
.pt-footnote { font-size: 12px; color: #7b8a98; margin-top: 16px; }

/* ------------------------------- app ------------------------------- */
#app-view { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
/* The display rules above beat the UA's [hidden]{display:none} — restore it,
   or both views render stacked and the login screen never goes away. */
#app-view[hidden], #login-view[hidden] { display: none !important; }

.pt-map-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
  text-align: center;
  color: var(--pt-danger);
  font-size: 14px;
  background: #fbf3f2;
}
.pt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--pt-navy);
  color: #fff;
}
.pt-header .pt-btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.pt-who { font-size: 13px; opacity: .85; margin-left: 8px; }

.pt-enroll {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #e8f4f0;
  border-bottom: 1px solid var(--pt-line);
  font-size: 14px;
}

.pt-search-wrap { position: relative; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--pt-line); }
#search {
  width: 100%;
  padding: 11px 13px;
  font-size: 16px;
  border: 1px solid var(--pt-line);
  border-radius: 9px;
}
.pt-coverage { margin: 7px 2px 0; font-size: 12.5px; color: #4c5d6d; }
.pt-coverage:empty { display: none; }
#search-results {
  position: absolute;
  left: 14px; right: 14px; top: 100%;
  margin: 0; padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--pt-line);
  border-radius: 9px;
  box-shadow: 0 10px 24px rgba(22,50,79,.14);
  z-index: 30;
  max-height: 300px;
  overflow-y: auto;
}
#search-results li {
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
#search-results li:hover, #search-results li.active { background: var(--pt-bg); }
#search-results .pt-hit-meta { color: #6b7b8a; font-size: 12px; }
#search-results .pt-badge {
  float: right;
  font-size: 11px;
  color: var(--pt-teal);
  border: 1px solid currentColor;
  border-radius: 10px;
  padding: 1px 7px;
}

#map { flex: 1; min-height: 240px; }

/* ------------------------------- card ------------------------------ */
.pt-card {
  background: #fff;
  border-top: 2px solid var(--pt-navy);
  box-shadow: 0 -8px 24px rgba(22,50,79,.15);
  padding: 14px 16px 18px;
  max-height: 62vh;
  overflow-y: auto;
}
.pt-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pt-card h2 { margin: 0; font-size: 18px; color: var(--pt-navy); }
.pt-card-meta { margin: 2px 0 0; color: #5a6b7b; font-size: 13px; }
.pt-x {
  border: 0; background: none; font-size: 26px; line-height: 1;
  color: #7b8a98; cursor: pointer; padding: 0 2px;
}
.pt-synth {
  background: var(--pt-amber-bg);
  border: 1px solid var(--pt-amber-line);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  margin: 10px 0 2px;
  color: #7a5d00;
}

.pt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--pt-line);
}
.pt-row:last-child { border-bottom: 0; }
.pt-row-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #6b7b8a; }
.pt-row-main { font-size: 15px; font-weight: 600; }
.pt-row-sub { font-size: 13px; color: #5a6b7b; }
.pt-onduty {
  display: inline-block;
  background: var(--pt-teal); color: #fff;
  font-size: 11px; font-weight: 700;
  border-radius: 10px; padding: 1px 8px;
  margin-left: 6px;
  vertical-align: 1px;
}
.pt-offduty { opacity: .55; }
.pt-call {
  flex: 0 0 auto;
  background: var(--pt-teal);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  border-radius: 22px;
  padding: 10px 18px;
  white-space: nowrap;
}
.pt-call:active { background: #0a5f4e; }
.pt-missing { color: #98a5b1; font-style: italic; font-size: 14px; }

.pt-card-img { width: 100%; border-radius: 10px; margin-top: 10px; border: 1px solid var(--pt-line); }
.pt-kind {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: 1px;
}
.pt-kind-center { background: var(--pt-navy); color: #fff; }
.pt-kind-donor  { background: #dde7ee; color: #3d4f5f; }

.pt-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pt-actions .pt-btn { width: auto; flex: 1 1 30%; margin-top: 0; font-size: 13px; padding: 10px 8px; }

/* Desktop: card docks right instead of bottom-sheet */
@media (min-width: 900px) {
  #app-view { display: grid; grid-template-rows: auto auto auto 1fr; grid-template-columns: 1fr 400px; }
  .pt-header, .pt-enroll, .pt-search-wrap { grid-column: 1 / -1; }
  #map { grid-row: 4; grid-column: 1; }
  .pt-card {
    grid-row: 4; grid-column: 2;
    border-top: 0; border-left: 2px solid var(--pt-navy);
    max-height: none;
  }
}
