/* Broward Health palette, from the BHC PowerPoint template theme. */
:root {
  --navy: #022259;
  --blue: #116dd3;
  --blue-600: #0e5cb3;
  --cyan: #1dafe5;
  --cyan-100: #e3f5fc;
  --blue-50: #eef4fd;
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e2e7ef;
  --line-strong: #cfd7e3;
  --text: #0f1b33;
  --muted: #5d6779;
  --faint: #8a93a3;
  --green: #12805c;
  --green-50: #e7f5ef;
  --amber: #a15c00;
  --amber-50: #fdf3e3;
  --red: #b42318;
  --red-50: #fdecea;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 27, 51, 0.05);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--navy); }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Gate -- */
.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: #fff;
}
.gate-card { width: 100%; max-width: 360px; }
.gate-logo { width: 220px; height: auto; display: block; margin-bottom: 28px; }
.gate-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.gate-sub { margin: 4px 0 24px; color: var(--muted); }
.gate-error { color: var(--red); margin: 8px 0 0; font-size: 14px; }
.field { display: block; margin-bottom: 12px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .search input, select.select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  font-size: 16px;
  color: var(--text);
}
.field input:focus, .search input:focus, select.select:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: transparent; }

/* ------------------------------------------------------------- Buttons -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; background: var(--blue-50); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); }
.btn-block { width: 100%; min-height: 46px; font-size: 15px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* -------------------------------------------------------------- Topbar -- */
.app { min-height: 100vh; padding-bottom: calc(68px + var(--safe-bottom)); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  min-height: 58px;
  padding: 0 16px;
  display: flex;
  /* Everything in the bar shares the text baseline of "Broward Health". */
  align-items: baseline;
  gap: 16px;
}
.brand:hover { text-decoration: none; }
/* "Ophthalmology" is sized and placed from the logo's width so it matches
   "Broward Health" in the logo image and the two sit on one baseline.
   Measured from broward-health-logo.png (900 x 174): lowercase letters are
   51 px tall (0.0567 of the width), capitals 72 px (0.0800), and the baseline
   is 22 px above the image's bottom edge (0.0244). Inter's x-height is
   0.546 em, so matching the lowercase height (what the eye compares in a
   mostly lowercase word) gives 0.0567 / 0.546 = 0.1038 of the logo width. */
.brand {
  --logo-w: 150px;
  --cap: calc(var(--logo-w) * 0.08);
  display: flex;
  align-items: baseline;
  gap: calc(var(--cap) * 0.95);
  min-width: 0;
}
.brand img { width: var(--logo-w); height: auto; display: block; transform: translateY(calc(var(--logo-w) * 0.0244)); }
.brand-divider { width: 1px; height: calc(var(--cap) * 1.5); margin-bottom: calc(var(--cap) * -0.25); background: var(--line-strong); }
.brand-text { font-weight: 600; color: var(--navy); font-size: calc(var(--logo-w) * 0.1038); line-height: 1; letter-spacing: -0.005em; white-space: nowrap; }
.topnav { display: none; margin-left: 8px; gap: 2px; }
.topnav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.topnav a:hover { text-decoration: none; color: var(--navy); background: var(--bg); }
.topnav a[aria-current="page"] { color: var(--navy); background: var(--blue-50); }
.sync {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--faint);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.sync:hover { background: var(--bg); color: var(--muted); }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.sync-icon { display: none; width: 20px; height: 20px; }
.sync.is-loading .sync-icon { animation: spin 0.9s linear infinite; color: var(--cyan); }
.sync.is-error .sync-icon { color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }
.sync.is-loading .sync-dot { background: var(--cyan); animation: pulse 1s ease-in-out infinite; }
.sync.is-error .sync-dot { background: var(--red); }
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---------------------------------------------------------- Bottom nav -- */
.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
}
.bottomnav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 0 8px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
}
.bottomnav a:hover { text-decoration: none; }
.bottomnav svg { width: 22px; height: 22px; }
.bottomnav a[aria-current="page"] { color: var(--blue); }

/* Phones: just the logo and the refresh icon, both centered in the bar. */
@media (max-width: 859px) {
  .topbar-inner { align-items: center; }
  /* The logo image is shifted down to put its lettering on the baseline;
     lift the group back so the logo is centered in the bar. */
  .brand { transform: translateY(calc(var(--logo-w) * -0.0136)); }
}
/* Desktop: the bar's height comes from padding so the shared baseline sits
   in the middle; the nav links and "Updated" line up on it. */
@media (min-width: 860px) {
  .topbar-inner { padding: 10px 16px 4px; }
  .topnav { align-items: baseline; }
  .sync { align-items: baseline; }
  .sync-dot { align-self: center; }
  .topnav { display: flex; }
  .bottomnav { display: none; }
  .app { padding-bottom: 40px; }
  .brand { --logo-w: 168px; }
}
@media (max-width: 600px) {
  #sync-text, .sync-dot { display: none; }
  .sync { padding: 10px; color: var(--muted); }
  .sync-icon { display: block; }
  .brand { --logo-w: 140px; }
}
@media (max-width: 340px) {
  .brand-divider, .brand-text { display: none; }
}

/* ---------------------------------------------------------------- View -- */
.view { max-width: 1080px; margin: 0 auto; padding: 20px 16px 24px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.015em; }
.page-sub { color: var(--muted); margin-top: 2px; }
.section { margin-top: 28px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.section-link { font-size: 14px; font-weight: 600; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; align-items: start; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 16px; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }
.empty { padding: 24px 16px; color: var(--muted); text-align: center; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; background: #e9edf4; border-radius: 10px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button, .seg a {
  border: 0;
  background: transparent;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.seg a:hover { text-decoration: none; }
.seg [aria-pressed="true"], .seg [aria-current="page"] { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(15, 27, 51, 0.12); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; user-select: none; }
.toggle input { width: 16px; height: 16px; accent-color: var(--blue); }
select.select { height: 38px; width: auto; font-size: 14px; padding: 0 32px 0 12px; }

/* Pills / badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg);
  color: var(--muted);
  white-space: nowrap;
}
.pill-blue { background: var(--blue-50); color: var(--blue-600); }
.pill-navy { background: #e6eaf2; color: var(--navy); }
.pill-cyan { background: var(--cyan-100); color: #0a6f95; }
.pill-green { background: var(--green-50); color: var(--green); }
.pill-amber { background: var(--amber-50); color: var(--amber); }
.pill-red { background: var(--red-50); color: var(--red); }

/* Person links inside schedules */
.who {
  border: 0;
  padding: 0;
  background: none;
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.who:hover { color: var(--blue); text-decoration-color: currentColor; }
.who.is-me { background: var(--cyan-100); border-radius: 4px; padding: 0 3px; text-decoration: none; }

/* ------------------------------------------------------------- On call -- */
.oc { overflow: hidden; }
.oncall { padding: 18px 18px 16px; }
.oncall-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.oncall-name { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--navy); margin: 2px 0 2px; line-height: 1.15; }
.oncall-name .who { text-decoration: none; }
.oncall-meta { color: var(--muted); font-size: 14px; }
.oncall-actions { margin-top: 14px; }
.oncall-actions .btn { min-height: 44px; padding: 0 18px; font-size: 15px; }
.oc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); }
.oc-day { border-top: 0; border-bottom: 1px solid var(--line); background: #fafbfd; }
.oc-main { min-width: 0; }
.oc .k { font-size: 12px; font-weight: 600; color: var(--muted); }
.oc .v { font-weight: 600; font-size: 16px; color: var(--navy); margin-top: 1px; }
.oc .s { font-size: 12.5px; color: var(--faint); margin-top: 1px; }
.oc-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.oc-grid > div { padding: 12px 18px; }
.oc-grid > div + div { border-left: 1px solid var(--line); }
.oc-grid > .full { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
.oc-mine { padding: 10px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); background: var(--cyan-100); }
.note { margin-top: 10px; font-size: 13.5px; color: var(--muted); background: var(--bg); padding: 8px 12px; border-radius: var(--radius-sm); }
.note-warn { color: var(--amber); background: var(--amber-50); }

/* ---------------------------------------------------------- Call weeks -- */
.legend { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12.5px; color: var(--muted); margin: -8px 0 14px; }
.legend b { color: var(--navy); font-weight: 600; margin-right: 3px; }
.week { padding: 12px 16px 13px; }
.week.is-current { background: var(--blue-50); box-shadow: inset 3px 0 0 var(--blue); }
.week.is-past { opacity: 0.55; }
.week.is-dim { opacity: 0.35; }
.week-head { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--navy); font-size: 14px; margin-bottom: 8px; }
.week-main { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; font-size: 15px; }
.week-main .k, .week-foot .k { display: block; color: var(--faint); font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; }
.week-foot { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13.5px; }
.week-foot > span { display: inline-flex; align-items: baseline; gap: 6px; }
.week-foot .k { display: inline; }
.week-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
@media (max-width: 520px) {
  .page-head .seg, .toolbar .seg { display: flex; width: 100%; }
  .page-head .seg > *, .toolbar .seg > * { flex: 1; text-align: center; padding: 7px 2px; font-size: 12.5px; }
}
.month-label { padding: 10px 16px 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; background: #fafbfd; }

/* ----------------------------------------------------------- Agenda -- */
.day-head { padding: 9px 16px; background: #fafbfd; font-size: 13px; font-weight: 700; color: var(--navy); display: flex; gap: 8px; align-items: center; }
.day-head .faint { font-weight: 500; }
.day-head.is-today { color: var(--blue); }
.item { padding: 13px 16px 14px; }
.item-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; margin-bottom: 3px; }
.item-top .when { font-weight: 600; color: var(--text); }
.item-top .type { font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.item-top .type::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.item-top .pill { font-size: 11.5px; padding: 1px 7px; }
.tone-blue { color: var(--blue-600); }
.tone-navy { color: var(--navy); }
.tone-amber { color: var(--amber); }
.tone-green { color: var(--green); }
.tone-cyan { color: #0a6f95; }
.tone-red { color: var(--red); }
.tone-gray { color: var(--muted); }
.item-title { font-weight: 600; color: var(--navy); font-size: 15.5px; line-height: 1.3; }
.item-sub { color: var(--muted); font-size: 14px; margin-top: 3px; }
.facts { display: grid; gap: 4px; margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.facts > div { display: flex; align-items: flex-start; gap: 7px; }
.facts svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--faint); }
.item .btn-row { margin-top: 10px; }
.item.is-cancelled .item-title { text-decoration: line-through; color: var(--faint); }
.item.is-routine .item-title { font-weight: 500; color: var(--text); }

/* Conference */
.conf-when { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; color: var(--navy); }
.conf-title { margin-top: 6px; font-weight: 600; font-size: 17px; color: var(--navy); line-height: 1.3; }
.conf-card .facts { margin-top: 6px; }
.conf-card .item-sub { margin-top: 6px; }
.conf-slots { margin-top: 8px; display: grid; gap: 10px; }
.conf-slot { display: grid; grid-template-columns: 54px 1fr; gap: 10px; font-size: 14.5px; }
.conf-slot .t { color: var(--muted); font-weight: 600; font-size: 13px; padding-top: 2px; }
.conf-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.conf-who .who, .conf-who span { font-weight: 600; }
.conf-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; }
.conf-foot .btn-row { margin-top: 0; }
.loc { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.loc svg { width: 15px; height: 15px; flex: none; }
.push-right { margin-left: auto; }
.narrow { max-width: 780px; }

/* ------------------------------------------------------------ People -- */
.search { position: relative; flex: 1 1 260px; }
.search input { padding-left: 38px; height: 42px; font-size: 15px; }
.search svg { position: absolute; left: 12px; top: 12px; width: 18px; height: 18px; color: var(--faint); }
.person { display: flex; gap: 12px; padding: 12px 16px; align-items: center; }
.avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
  background: #e6eaf2;
}
.avatar.pgy1 { background: #e3f5fc; color: #0a6f95; }
.avatar.pgy2 { background: #e6f0fc; color: var(--blue-600); }
.avatar.pgy3 { background: #e7f5ef; color: var(--green); }
.avatar.pgy4 { background: #fdf3e3; color: var(--amber); }
.person-main { min-width: 0; flex: 1; }
.person-main .who { text-align: left; }
.person-name { font-weight: 600; color: var(--navy); }
.person-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.person-actions { display: flex; gap: 6px; flex: none; }
.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
}
.icon-btn:hover { background: var(--blue-50); text-decoration: none; }
.icon-btn svg { width: 18px; height: 18px; }
@media (max-width: 420px) { .person-actions .hide-xs { display: none; } }

.site { padding: 14px 16px; }
.site-name { font-weight: 600; color: var(--navy); }
.site-addr { font-size: 14px; color: var(--muted); margin-top: 2px; }
.site .btn-row { margin-top: 10px; }

/* Key dates */
.kd { display: grid; grid-template-columns: 56px 1fr; gap: 14px; padding: 12px 16px; align-items: start; }
.kd-date { text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 4px 0 6px; background: #fff; }
.kd-date .m { font-size: 11px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: 0.05em; }
.kd-date .d { font-size: 20px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.kd-title { font-weight: 600; color: var(--navy); }
.kd-sub { font-size: 13px; color: var(--faint); margin-top: 4px; }
.kd .item-meta { margin-top: 4px; }
.kd-when { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.kd.is-past { opacity: 0.5; }

/* Links */
.link-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.link-row:hover { background: #fafbfd; text-decoration: none; }
.link-row .t { font-weight: 600; color: var(--navy); }
.link-row .s { font-size: 13px; color: var(--muted); }
.link-row svg { width: 16px; height: 16px; color: var(--faint); flex: none; }

/* Raw table fallback */
.raw-wrap { overflow-x: auto; }
.raw { border-collapse: collapse; font-size: 13px; width: 100%; }
.raw td { border-bottom: 1px solid var(--line); padding: 6px 10px; white-space: nowrap; }

/* ------------------------------------------------------- Contact sheet -- */
.sheet { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; justify-items: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(2, 34, 89, 0.28); }
.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(12px + var(--safe-bottom));
  box-shadow: 0 -8px 30px rgba(2, 34, 89, 0.15);
  animation: up 0.18s ease-out;
}
@media (min-width: 600px) {
  .sheet { align-items: center; }
  .sheet-panel { border-radius: 16px; padding-bottom: 12px; }
}
@keyframes up { from { transform: translateY(16px); opacity: 0; } }
.sheet-name { font-size: 20px; font-weight: 700; color: var(--navy); }
.sheet-role { color: var(--muted); margin-top: 2px; }
.sheet-rows { margin: 16px 0 12px; }
.sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.sheet-row .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.sheet-row .v { font-weight: 500; word-break: break-word; }

.footer { max-width: 1080px; margin: 0 auto; padding: 8px 16px 24px; color: var(--faint); font-size: 12px; display: flex; gap: 16px; flex-wrap: wrap; }
.footer button { border: 0; background: none; color: var(--faint); padding: 0; cursor: pointer; text-decoration: underline; font-size: 12px; }

.error-banner { background: var(--red-50); color: var(--red); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
