:root {
  /* Exact values from the official MyVisitor Brand Guide PDF + vector logo file */
  --font-brand: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --navy: #495E7D;
  --navy-dark: #3A4C66;
  --gray-text: #9AA7B5;
  --orange: #ED9C2D;
  --green: #9AC07E;
  --teal: #70BFD8;
  --red: #E96B48;
  --plum: #793E5F;
  --bg: #EDF1F7;
  --card: #FFFFFF;
  --ink: #384156;
  --muted: #7C8598;
  --border: #E1E6EE;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Marketing / logo ---------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-brand);
  font-size: 28px;
  letter-spacing: -0.3px;
}
.logo .my { color: var(--gray-text); font-weight: 500; }
.logo .visitor { color: var(--navy); font-weight: 800; font-style: italic; }
.logo svg { display: block; }

.hero {
  text-align: center;
  padding: 64px 20px 40px;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}
.hero p.tagline {
  font-size: 18px;
  color: var(--muted);
  max-width: 520px;
  margin: 18px auto 0;
}
.module-icons {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 28px 0;
}
.icon-circle {
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  flex: none;
  line-height: 1;
}
.module-icons .icon-circle {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 20px;
}
h1, h2, h3 {
  font-family: var(--font-brand);
  font-weight: 700;
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 6px;
  padding: 12px 26px;
  font-family: var(--font-brand);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(0.96); }
.btn-orange { background: var(--orange); color: #fff; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-outline { background: #fff; color: var(--navy); border: 1px solid var(--border); }
.btn-green { background: var(--green); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 5px; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 20px;
  padding: 40px 0 64px;
}
.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 18px;
  text-align: center;
}
.feature .icon-circle { margin: 0 auto 12px; }
.feature h3 { margin: 0 0 6px; font-size: 16px; color: var(--navy); }
.feature p { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- App shell ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.topbar .wrap {
  max-width: 1180px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.topbar .logo { font-size: 25px; margin-right: 8px; }
.topbar-spacer { flex: 1; }
.topbar .who { font-size: 13px; color: var(--muted); text-align: right; }
.topbar .who strong { color: var(--ink); display: block; font-size: 14px; }

.tabbar {
  display: flex;
  background: var(--navy);
  border-radius: 8px;
  overflow: hidden;
  flex-wrap: wrap;
}
.tabbar a {
  color: #fff;
  padding: 14px 24px;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 16px;
  text-transform: lowercase;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0.92;
  flex: 1 1 auto;
  min-width: 90px;
}
.tabbar a:hover { text-decoration: none; opacity: 1; }
.tabbar a.active { opacity: 1; }
.tab-home { background: var(--navy); }
.tab-visit { background: var(--orange); }
.tab-needs { background: var(--green); }
.tab-meals { background: var(--teal); }
.tab-message { background: var(--red); }
.tab-give { background: var(--plum); }

.appmain { max-width: 1180px; margin: 24px auto; padding: 0 20px; }
.grid3 {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 20px;
}
@media (max-width: 860px) {
  .grid3 { grid-template-columns: 1fr; }
}

.grid-team {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}
@media (max-width: 860px) {
  .grid-team { grid-template-columns: 1fr; }
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.field-row > .form-field {
  flex: 1 1 140px;
  min-width: 140px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
/* A <form> wrapping a single button (e.g. a "Remove"/"Delete" action) picks
   up a browser-default bottom margin that a sibling <a class="btn"> doesn't
   have - with align-items: center that asymmetric margin box shifts the
   form visibly out of line with the rest of the row. */
.btn-row form { margin: 0; }

.page-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}
.page-header h1 { flex: 1 1 auto; margin: 0; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -1px;
}
.table-scroll table.simple { min-width: 540px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}
.card + .card { margin-top: 16px; }
.card h2, .card h3 { margin-top: 0; color: var(--navy); }

.patient-card img.avatar {
  width: 100%;
  max-width: 160px;
  border-radius: 8px;
  object-fit: cover;
  aspect-ratio: 1;
}
.patient-card h3 { margin: 12px 0 2px; }
.patient-card .meta { font-size: 13px; color: var(--muted); line-height: 1.6; }

.hospital-photo {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
}
.hospital-photo-empty {
  background: var(--bg);
  border: 1px dashed var(--border);
}

.photo-frame {
  position: relative;
  display: block;
}
.photo-edit-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.photo-frame-wide .photo-edit-btn { bottom: 16px; }
.photo-edit-btn:hover { filter: brightness(1.1); }
.photo-edit-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.sidebar-stats .stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.sidebar-stats .stat-row:last-of-type { border-bottom: none; }
.stat-row .num { font-weight: 700; color: var(--navy); }
.stat-row .label { color: var(--muted); font-size: 13px; }

table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  color: var(--muted); border-bottom: 2px solid var(--border); padding: 8px 6px;
}
table.simple td { padding: 10px 6px; border-bottom: 1px solid var(--border); }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 700; color: #fff;
}
.badge-open { background: var(--green); }
.badge-booked { background: var(--navy); }
.badge-blocked { background: var(--red); }
.badge-done { background: var(--muted); }
.badge-claimed { background: var(--orange); }

.msg { border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.msg .msg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar-circle {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--orange); color: #fff; display: flex;
  align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}
.msg .who strong { display: block; font-size: 14px; color: var(--navy); }
.msg .who span { font-size: 12px; color: var(--muted); }
.msg .body { font-size: 14px; line-height: 1.5; }
.msg .actions { margin-top: 8px; display: flex; gap: 8px; }

.form-field { margin-bottom: 14px; }
.form-field > label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 5px; }
.form-field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), .form-field textarea, .form-field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; font-family: inherit;
}
.form-field input[type="checkbox"], .form-field input[type="radio"] {
  width: auto; flex: none;
}
.form-field input[type="color"] {
  width: 64px; height: 40px; padding: 2px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--card); cursor: pointer;
}
.form-field textarea { resize: vertical; }
#hospital-search-container, #location-search-container { width: 100%; }
/* Without an explicit height, this custom element's shadow DOM stretches to fill the viewport — applies everywhere it's used. */
gmp-place-autocomplete { width: 100%; height: 44px; display: block; }
.auth-card { max-width: 380px; margin: 60px auto; }
.auth-card h1 { text-align: center; font-size: 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.flash-error {
  background: #FDEAEA; color: #B4231C; border: 1px solid #F3C2C0;
  padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px;
}
.flash-ok {
  background: #EEF9E9; color: #3F7D20; border: 1px solid #CBEAB8;
  padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px;
}
.progress-outer {
  background: var(--border); border-radius: 20px; height: 14px; overflow: hidden;
}
.progress-inner { background: var(--plum); height: 100%; }
.checklist label {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.footer-note {
  text-align: center; font-size: 12px; color: var(--muted); margin: 40px 0 20px;
}
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1px solid var(--border); border-radius: 20px; padding: 6px 12px; font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.hours-pill { position: relative; display: inline-flex; }
.hours-pill summary { list-style: none; cursor: pointer; }
.hours-pill summary::-webkit-details-marker { display: none; }
.hours-pill summary::marker { content: ''; }
.hours-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 10;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  font-size: 13px; line-height: 1.7; white-space: nowrap;
}
.demo-banner {
  background: #FFF7E6; border: 1px solid #F3DDA4; color: #8A6116;
  font-size: 12.5px; padding: 8px 14px; border-radius: 6px; margin-bottom: 16px;
}

/* ROI sheet (admin > hospital > ROI) */
input[type="range"] { width: 100%; accent-color: var(--navy); }
.roi-valshow { font-weight: 700; color: var(--navy); white-space: nowrap; }
.roi-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 18px; }
.roi-hero .cell { background: var(--card); padding: 14px 16px; }
.roi-hero .cell.hi { background: var(--navy); }
.roi-hero .cell.hi .label, .roi-hero .cell.hi .val, .roi-hero .cell.hi .sub { color: #fff !important; }
.roi-hero .label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.roi-hero .val { font-size: 21px; font-weight: 800; color: var(--navy); margin-top: 5px; }
.roi-hero .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.roi-bucket { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: var(--bg); }
.roi-bucket-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.roi-bucket-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.roi-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.roi-bucket-val { font-weight: 700; font-size: 18px; color: var(--navy); white-space: nowrap; }
.roi-share-label { font-size: 11px; margin-top: 14px; }
.roi-bar-track { height: 6px; border-radius: 4px; background: var(--border); margin-top: 4px; overflow: hidden; }
.roi-bar-fill { height: 100%; border-radius: 5px; transition: width .2s ease; }
.roi-formula { font-size: 11px; color: var(--muted); margin-top: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.roi-seeded { font-size: 11.5px; color: var(--green); margin-top: 4px; font-weight: 600; }
.roi-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 14px; }
.roi-totals .t { border-top: 3px solid var(--border); padding-top: 8px; }
.roi-totals .t.core { border-top-color: var(--teal); }
.roi-totals .t.upside { border-top-color: var(--orange); }
.roi-totals .t.grand { border-top-color: var(--navy); }
.roi-totals .lab { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.roi-totals .amt { font-weight: 800; font-size: 19px; margin-top: 4px; color: var(--navy); }
.roi-toggle-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.roi-toggle-row input { accent-color: var(--orange); width: 15px; height: 15px; }

.roi-info { position: relative; display: inline-flex; margin-left: 6px; cursor: help; vertical-align: middle; }
.roi-info-icon {
  width: 15px; height: 15px; border-radius: 50%; background: var(--border); color: var(--muted);
  font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  font-family: Georgia, 'Times New Roman', serif; font-style: italic;
}
.roi-info-pop {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 0; transform: none;
  width: 280px; max-width: 80vw; background: var(--navy); color: #fff; font-size: 12px; font-weight: 400; line-height: 1.55;
  padding: 10px 12px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); z-index: 30; text-align: left;
}
.roi-info-pop::after {
  content: ''; position: absolute; top: 100%; left: 10px;
  border: 6px solid transparent; border-top-color: var(--navy);
}
.roi-info:hover .roi-info-pop, .roi-info:focus .roi-info-pop, .roi-info.open .roi-info-pop { display: block; }
@media (max-width: 480px) {
  .roi-info-pop { width: 220px; }
}
