/* Reception dashboard. Sized for a Windows desktop monitor. */
body.dash {
  font-size: 15px;
  background: var(--sand-100);
  min-height: 100vh;
}

/* ------------------------------------------------------------- boot */
.boot {
  min-height: 86vh;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
body.is-booting .boot { display: flex; }
.boot-mark { width: 96px; animation: breathe 2.2s ease-in-out infinite; }
.boot-mark img { width: 100%; height: auto; display: block; }
@keyframes breathe { 50% { transform: scale(1.07); } }

.shimmer-bar {
  width: 180px;
  height: 5px;
  border-radius: 999px;
  background: var(--sage-200);
  overflow: hidden;
  position: relative;
}
.shimmer-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: inherit;
  background: var(--green-600);
  animation: slide 1.2s ease-in-out infinite;
}
@keyframes slide { from { transform: translateX(-110%); } to { transform: translateX(270%); } }

/* ---------------------------------------------------------- sign-in */
.signin {
  min-height: 92vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.signin::before {
  content: "";
  position: absolute;
  right: -10vmin;
  bottom: -16vmin;
  width: 70vmin;
  height: 70vmin;
  background: url("/static/brand/logo-mark.png") center / contain no-repeat;
  opacity: 0.06;
  transform: rotate(-14deg);
  pointer-events: none;
}
.signin-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 440px;
  display: grid;
  gap: 14px;
  text-align: center;
  animation: rise 0.55s var(--ease-out) both;
}
.signin-logo { width: min(290px, 85%); height: auto; margin: 0 auto 10px; }
.signin-card h1 { font-size: 1.5rem; color: var(--green-900); }
.signin-card p { color: var(--ink-soft); line-height: 1.45; }
#google-button { display: flex; justify-content: center; }
.demo-signin { display: grid; gap: 10px; margin-top: 6px; }
.demo-signin .btn { padding: 13px 18px; }
.signin-error { color: var(--alert) !important; font-weight: 600; min-height: 1.3em; }

/* ---------------------------------------------------------- top bar */
/* The header and the alert banners stay visible while the list scrolls. */
.sticky-top { position: sticky; top: 0; z-index: 5; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 44px; height: auto; display: block; }
.brand-text { display: grid; gap: 1px; }
.topbar h1 { font-size: 1.15rem; font-weight: 700; color: var(--green-900); letter-spacing: -0.01em; }
.summary { color: var(--ink-soft); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn.small { padding: 8px 14px; font-size: 0.85rem; border-width: 1px; }
.btn.small .icon { font-size: 1rem; }
.btn.small[aria-pressed="true"] { background: var(--sage-100); color: var(--green-800); border-color: var(--sage-300); }
#btn-sound[aria-pressed="false"] .sound-waves { opacity: 0.25; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--sand-200);
  color: var(--ink-soft);
  transition: background-color 0.3s ease, color 0.3s ease;
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--sand-400); }
.pill.live { background: var(--sage-100); color: var(--green-800); }
.pill.live i { background: #3fae2a; animation: live-dot 2s ease-out infinite; }
.pill.lost { background: var(--warm-tint); color: var(--warm); }
.pill.lost i { background: var(--warm); animation: blink 1s steps(2) infinite; }
@keyframes live-dot {
  0% { box-shadow: 0 0 0 0 rgba(63, 174, 42, 0.5); }
  100% { box-shadow: 0 0 0 8px rgba(63, 174, 42, 0); }
}
@keyframes blink { 50% { opacity: 0.25; } }

.user { display: inline-flex; align-items: center; gap: 8px; margin-left: 4px; }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(150deg, var(--green-600), var(--green-800));
}
.me { color: var(--ink); font-size: 0.88rem; font-weight: 600; }

/* ---------------------------------------------------------- banners */
.banner { padding: 12px 28px; font-weight: 600; animation: banner-in 0.35s var(--ease-out) both; }
@keyframes banner-in { from { opacity: 0; transform: translateY(-8px); } }
.banner-warn { background: var(--warm-tint); color: #6f4100; border-bottom: 1px solid #f0d7a8; }
.banner-live {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, var(--alert-dark), var(--alert) 45%, var(--alert-dark));
  background-size: 200% 100%;
  color: #fff;
  font-size: 1.05rem;
  animation: banner-in 0.35s var(--ease-out) both, sweep 2.4s linear infinite;
}
.banner-live .icon { font-size: 1.25rem; animation: wiggle 1.2s ease-in-out infinite; }
@keyframes sweep { to { background-position: -200% 0; } }
@keyframes wiggle { 0%, 60%, 100% { transform: none; } 70% { transform: rotate(-10deg); } 85% { transform: rotate(10deg); } }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--green-900);
  color: #fff;
  padding: 13px 20px;
  border-radius: 14px;
  font-weight: 600;
  max-width: min(560px, 92vw);
  z-index: 20;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.35s var(--ease-out) both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px); } }

/* ---------------------------------------------------------- columns */
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 0.95fr);
  gap: 24px;
  padding: 24px 28px 60px;
  align-items: start;
  max-width: 1500px;
  margin: 0 auto;
}
@media (max-width: 1100px) { .columns { grid-template-columns: 1fr; } }

.column h2 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sand-700);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.count {
  background: var(--sand-300);
  color: var(--ink);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.78rem;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.count.hot { background: var(--alert); color: #fff; }
.list { display: grid; gap: 14px; }
.list:empty { display: none; }

.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--ink-soft);
  padding: 26px 18px;
  border: 1.5px dashed var(--sand-300);
  border-radius: var(--radius);
  text-align: center;
  animation: fade 0.4s ease both;
}
@keyframes fade { from { opacity: 0; } }
.empty img { width: 54px; height: auto; opacity: 0.3; }
.empty strong { display: block; color: var(--green-800); font-size: 1rem; margin-bottom: 2px; }
.fine { color: var(--ink-soft); font-size: 0.8rem; margin-top: 12px; line-height: 1.4; }

/* First load: grey placeholder cards instead of an empty page. */
.skeletons { display: none; gap: 14px; }
body.is-loading .skeletons { display: grid; }
body.is-loading .empty, body.is-loading .list { display: none; }
.skeleton {
  height: 168px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, #ece6d8 30%, #f7f3ea 50%, #ece6d8 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton.short { height: 110px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ------------------------------------------------------------ cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px 18px;
  display: grid;
  gap: 12px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card.new { animation: card-in 0.5s var(--ease-out) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(-10px) scale(0.98); } }

.card.live {
  border-color: var(--alert);
  animation: card-pulse 1.5s ease-in-out infinite;
}
.card.live.new { animation: card-in 0.5s var(--ease-out) both, card-pulse 1.5s ease-in-out 0.5s infinite; }
@keyframes card-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--alert-tint), var(--shadow-sm); }
  50% { box-shadow: 0 0 0 8px var(--alert-tint), var(--shadow-sm); }
}
.card.closed { background: transparent; box-shadow: none; border-style: dashed; }
.card.closed:hover { box-shadow: none; }

.card-head { display: flex; align-items: flex-start; gap: 12px; }
.kind-chip {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  flex: none;
  background: var(--sage-100);
  color: var(--green-700);
}
.card.assist .kind-chip,
.card.help .kind-chip { background: var(--warm-tint); color: var(--warm); }
.card.live .kind-chip { background: var(--alert); color: #fff; animation: wiggle 1.2s ease-in-out infinite; }
.card.closed .kind-chip { background: var(--sand-200); color: var(--sand-700); }

.card-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.patient { font-size: 1.15rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; color: var(--ink); }
.patient.unknown { color: var(--ink-soft); font-weight: 600; font-style: italic; }
.kind-line { font-size: 0.8rem; font-weight: 600; color: var(--sand-700); text-transform: uppercase; letter-spacing: 0.06em; }

.when { text-align: right; font-size: 0.8rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; display: grid; gap: 1px; white-space: nowrap; }
.when b { color: var(--ink); font-weight: 600; font-size: 0.88rem; }

.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.88rem; color: var(--ink-soft); }
.facts span { display: inline-flex; align-items: center; gap: 6px; }
.facts .icon { color: var(--sage-500); font-size: 0.95rem; }
.facts b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.state {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  padding: 9px 12px;
  border-radius: 11px;
  background: var(--sand-100);
  color: var(--ink);
}
.state::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 0.42em;
  border-radius: 50%;
  background: var(--sand-400);
  flex: none;
}
.state.urgent { background: var(--alert-tint); color: var(--alert-dark); }
.state.urgent::before { background: var(--alert); }
.state.warn { background: var(--warm-tint); color: #6f4100; }
.state.warn::before { background: var(--warm); }
.state.good { background: var(--sage-100); color: var(--green-800); }
.state.good::before { background: var(--green-600); }
.state.sim { background: #2a2a2a; color: #ffd98a; }
.state.sim::before { background: #ffd98a; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn { padding: 11px 18px; font-size: 0.92rem; }
.note { font-size: 0.8rem; color: var(--ink-soft); line-height: 1.4; }

/* Cards glide between columns where the browser supports view transitions. */
::view-transition-group(*) { animation-duration: 0.38s; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.2s; }
