:root {
  --ink: #17202a;
  --muted: #6a5e52;
  --line: #d8d1c7;
  --paper: #faf7f2;
  --field: #ffffff;
  --teal: #6fc3df;
  --teal-bright: #9bf1ff;
  --teal-dark: #277b8f;
  --navy: #242943;
  --navy-soft: #2a2f4a;
  --lavender: #8d82c4;
  --coral: #ec8d81;
  --gold: #e7b788;
  --blue: #8ea9e8;
  --green: #87c5a4;
  --red: #dc2626;
  --bg: #eef2f6;
  --shadow: 0 14px 36px rgba(36, 41, 67, .14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top left, rgba(155, 241, 255, .22), transparent 30%),
    linear-gradient(135deg, #eef2f6 0%, #f7f7f7 48%, #f4ece7 100%);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

/* No bold anywhere — cap weight at semibold (600) */
strong, b { font-weight: 600; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; }

main {
  flex: 1 0 auto;
  transition: padding-top .35s cubic-bezier(.4, 0, .2, 1);
  padding-top: 0;
}

#pageLoader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    radial-gradient(circle at top left, rgba(155, 241, 255, .22), transparent 30%),
    linear-gradient(135deg, #eef2f6 0%, #f7f7f7 48%, #f4ece7 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding-bottom: 14vh;
  transition: opacity .55s ease;
}

#pageLoader.loader-out {
  opacity: 0;
  pointer-events: none;
}

.pl-lottie {
  line-height: 0;
}

.pl-logo {
  opacity: 0;
  animation: pl-logo-in .55s cubic-bezier(.2, .8, .2, 1) 1s both;
}

.pl-logo img {
  display: block;
  width: min(260px, 72vw);
  height: auto;
}

@keyframes pl-logo-in {
  from { opacity: 0; transform: translateY(14px) scale(.93); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

#submitLoader {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(238, 242, 246, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .42s ease;
}

.submit-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.submit-loader-inner p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--teal-dark);
  letter-spacing: .01em;
}

#submitLoader.submit-loader-out {
  opacity: 0;
  pointer-events: none;
}

body[data-page="home"] main,
body[data-page="checkin"] main,
body[data-page="lookup"] main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
body.nav-open main {
  padding-top: 52px;
}

@keyframes page-enter {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

body[data-page="checkin"] .content-wrap,
body[data-page="lookup"] .content-wrap {
  animation: page-enter .45s cubic-bezier(.2, .8, .2, 1) .12s both;
}

.nav-toggle {
  position: fixed;
  top: 6px;
  left: 6px;
  z-index: 100;
  width: 40px;
  height: 40px;
  background: rgba(31, 111, 134, .9);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.nav-toggle:hover {
  background: rgba(31, 111, 134, 1);
}

.nav-toggle .arrow {
  display: inline-block;
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}

.nav-toggle[aria-expanded="true"] .arrow {
  transform: rotate(180deg);
}

.top-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: linear-gradient(90deg, #1f6f86 0%, #277b8f 42%, #8d82c4 100%);
  box-shadow: 0 2px 14px rgba(31, 111, 134, .26);
  transform: translateY(0);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}

.top-shell.hidden {
  transform: translateY(-100%);
  box-shadow: none;
  pointer-events: none;
}

.brand-row {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 22px 10px 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.main-nav a {
  text-decoration: none;
  color: #cbd5e1;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 7px;
}

.main-nav a:hover,
.main-nav a.active {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.hero-band {
  background: linear-gradient(90deg, rgba(10,10,10,.82), rgba(15,52,96,.66));
  background-size: cover;
  background-position: center;
  color: #fff;
  min-height: 430px;
  display: flex;
  align-items: stretch;
}

.kiosk-screen {
  width: min(900px, calc(100% - 32px));
  margin: 12px auto;
  display: grid;
  grid-template-rows: auto auto auto;
  align-items: start;
  gap: 8px;
}

.kiosk-hero {
  width: 100%;
  justify-self: center;
  background: #fff;
  border-radius: 8px;
  padding: 8px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.kiosk-brand {
  text-align: center;
}

.kiosk-brand img {
  display: block;
  max-width: 620px;
  width: min(100%, 620px);
  height: auto;
}

.kiosk-prompt {
  background: linear-gradient(180deg, rgba(155, 241, 255, .14), var(--paper) 52%);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 22px;
  color: var(--teal-dark);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  cursor: default;
  transition:
    transform .24s cubic-bezier(.2, .8, .2, 1),
    border-color .2s ease,
    background .2s ease,
    box-shadow .24s ease;
}

.kiosk-prompt > * {
  position: relative;
  z-index: 1;
  margin: 0;
}

.kiosk-prompt::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: var(--teal);
  transition: height .24s cubic-bezier(.2, .8, .2, 1);
}

.kiosk-prompt::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, 0) 48%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .24s ease, transform .24s cubic-bezier(.2, .8, .2, 1);
}

.kiosk-prompt:hover {
  transform: translateY(-8px) scale(1.015);
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 22px 44px rgba(36, 41, 67, .18);
}

.kiosk-prompt:hover::before {
  height: 12px;
}

.kiosk-prompt:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.kiosk-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 14px;
  align-items: stretch;
}

.kiosk-tile {
  min-height: 154px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  padding: 20px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  align-content: center;
  justify-items: center;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .24s cubic-bezier(.2, .8, .2, 1), border-color .2s ease, background .2s ease, box-shadow .24s ease;
  overflow: hidden;
  position: relative;
}

.kiosk-tile > * {
  position: relative;
  z-index: 1;
}

.kiosk-tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: var(--tile-color, var(--teal));
  transition: height .24s cubic-bezier(.2, .8, .2, 1);
}

.kiosk-tile::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, 0) 48%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .24s ease, transform .24s cubic-bezier(.2, .8, .2, 1);
}

.kiosk-tile:hover,
.kiosk-tile:focus-visible {
  transform: translateY(-8px) scale(1.015);
  border-color: var(--tile-color, var(--teal));
  background: #fff;
  box-shadow: 0 22px 44px rgba(36, 41, 67, .18);
}

.kiosk-tile:hover::before,
.kiosk-tile:focus-visible::before {
  height: 12px;
}

.kiosk-tile:hover::after,
.kiosk-tile:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.kiosk-tile:focus-visible {
  outline: 3px solid rgba(39, 123, 143, .24);
  outline-offset: 3px;
}

.kiosk-tile:active,
.kiosk-tile.tile-pressed {
  transform: translateY(3px) scale(.964) !important;
  box-shadow: 0 4px 14px rgba(36, 41, 67, .10) !important;
  transition: transform .08s ease, box-shadow .08s ease !important;
}

.tile-ripple {
  position: absolute;
  border-radius: 50%;
  opacity: .22;
  transform: scale(0);
  animation: tile-ripple-anim .52s cubic-bezier(.2, .8, .2, 1) forwards;
  pointer-events: none;
  z-index: 0;
}

@keyframes tile-ripple-anim {
  to {
    transform: scale(1);
    opacity: 0;
  }
}

.kiosk-tile.primary {
  --tile-color: var(--teal);
  background: linear-gradient(180deg, rgba(155, 241, 255, .18), var(--paper) 42%);
}

.kiosk-tile.checkin {
  --tile-color: var(--green);
  background: linear-gradient(180deg, rgba(135, 197, 164, .20), var(--paper) 42%);
}

.kiosk-tile.abtc {
  --tile-color: #d97706;
  background: linear-gradient(180deg, rgba(217, 119, 6, .18), var(--paper) 42%);
}

.kiosk-tile.abtc .tile-symbol {
  background: var(--tile-color);
}

.kiosk-tile.lookup {
  --tile-color: var(--coral);
  background: linear-gradient(180deg, rgba(236, 141, 129, .18), var(--paper) 42%);
}

.tile-symbol {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 600;
  background: var(--tile-color, var(--teal));
  box-shadow: 0 12px 28px rgba(36, 41, 67, .18);
  transition: transform .24s cubic-bezier(.2, .8, .2, 1), box-shadow .24s ease;
}

.kiosk-tile:hover .tile-symbol,
.kiosk-tile:focus-visible .tile-symbol {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 16px 32px rgba(36, 41, 67, .22);
}

.kiosk-tile.checkin .tile-symbol {
  background: var(--tile-color);
}

.kiosk-tile.lookup .tile-symbol {
  background: var(--tile-color);
}

.kiosk-tile strong {
  color: var(--navy);
  font-size: 18px;
  line-height: 1.12;
  transition: transform .24s cubic-bezier(.2, .8, .2, 1), color .2s ease;
}

.kiosk-tile small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  transition: color .2s ease;
}

.kiosk-tile:hover strong,
.kiosk-tile:focus-visible strong {
  color: var(--tile-color, var(--teal));
  transform: translateY(-2px);
}

.kiosk-tile:hover small,
.kiosk-tile:focus-visible small {
  color: var(--ink);
}

.kiosk-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.kiosk-note {
  flex: 1;
  min-height: 72px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  padding: 14px 18px;
  display: grid;
  gap: 3px;
}

.kiosk-note strong {
  color: var(--teal-dark);
  font-size: 14px;
}

.kiosk-note span {
  color: var(--muted);
  font-size: 13px;
}

.admin-entry {
  min-width: 96px;
  min-height: 52px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.hero-content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 60px 22px 36px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 28px;
  align-items: center;
}

.hero-copy h1,
.page-title h1,
.empty-state h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1.08;
  font-weight: 600;
}

.lead {
  max-width: 620px;
  margin: 14px 0 0;
  font-size: 17px;
  line-height: 1.65;
  color: #ecfdf5;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.hero-actions,
.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.btn {
  border: 0;
  border-radius: 7px;
  padding: 10px 18px;
  min-height: 41px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.btn.primary {
  background: linear-gradient(135deg, #277b8f 0%, #0d9488 100%);
  color: #fff;
  border: 1.5px solid #0d9488;
  box-shadow: 0 2px 10px rgba(39, 123, 143, .18);
  transition:
    transform .18s cubic-bezier(.2, .8, .2, 1),
    box-shadow .18s ease,
    filter .18s ease;
}

.btn.primary:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(39, 123, 143, .28);
}

.btn.primary:active {
  transform: translateY(1px) scale(.98);
  box-shadow: 0 2px 8px rgba(39, 123, 143, .16);
}

/* Orange gradient variant (keeps .btn.primary shape + hover lift) — used for "Check HIS" */
.btn.btn-his {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #d97706;
  box-shadow: 0 2px 10px rgba(217, 119, 6, .20);
}

.btn.btn-his:hover {
  box-shadow: 0 8px 20px rgba(217, 119, 6, .30);
}

.btn.btn-his:active {
  box-shadow: 0 2px 8px rgba(217, 119, 6, .18);
}

.btn.secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}

.btn.fill {
  width: 100%;
}

.btn-home {
  background: linear-gradient(135deg, rgba(111, 195, 223, .16) 0%, rgba(13, 148, 136, .11) 100%);
  color: var(--teal-dark);
  border: 1.5px solid rgba(39, 123, 143, .32);
  border-radius: 50px;
  padding: 9px 22px;
  letter-spacing: .02em;
  box-shadow: 0 2px 10px rgba(39, 123, 143, .08);
  transition:
    transform .22s cubic-bezier(.2, .8, .2, 1),
    box-shadow .22s ease,
    background .22s ease,
    color .18s ease,
    border-color .18s ease;
}

.btn-home .btn-icon {
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}

.btn-home:hover {
  background: linear-gradient(135deg, #277b8f 0%, #0d9488 100%);
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 26px rgba(39, 123, 143, .30);
}

.btn-home:hover .btn-icon {
  transform: translateY(-2px) scale(1.18);
}

.btn-home:active {
  transform: translateY(1px) scale(.97) !important;
  box-shadow: 0 2px 8px rgba(39, 123, 143, .14) !important;
}

.btn-back {
  background: linear-gradient(135deg, rgba(36, 41, 67, .07) 0%, rgba(42, 47, 74, .04) 100%);
  color: var(--navy);
  border: 1.5px solid rgba(36, 41, 67, .22);
  border-radius: 50px;
  padding: 9px 22px;
  letter-spacing: .02em;
  box-shadow: 0 2px 8px rgba(36, 41, 67, .06);
  transition:
    transform .22s cubic-bezier(.2, .8, .2, 1),
    box-shadow .22s ease,
    background .22s ease,
    color .18s ease,
    border-color .18s ease;
}

.btn-back .btn-icon {
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}

.btn-back:hover {
  background: linear-gradient(135deg, #242943 0%, #2a2f4a 100%);
  color: #fff;
  border-color: transparent;
  transform: translateX(-3px) scale(1.03);
  box-shadow: 0 10px 24px rgba(36, 41, 67, .22);
}

.btn-back:hover .btn-icon {
  transform: translateX(-3px) scale(1.1);
}

.btn-back:active {
  transform: translateX(1px) scale(.97) !important;
  box-shadow: 0 2px 8px rgba(36, 41, 67, .10) !important;
}

.btn-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.status-panel,
.login-card,
.result-card,
.lookup-panel,
.workspace-form,
.table-card,
.action-card,
.empty-state {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.status-panel {
  color: var(--ink);
  padding: 22px;
}

.status-heading {
  color: var(--teal-dark);
  font-weight: 600;
  margin-bottom: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric-grid div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 14px;
}

.metric-grid strong {
  display: block;
  color: var(--teal-dark);
  font-size: 25px;
}

.metric-grid span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.queue-strip {
  margin-top: 14px;
  padding: 14px;
  border-radius: 7px;
  background: #e6f5f2;
  border: 1px solid var(--teal);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.queue-strip span {
  color: var(--teal-dark);
  font-size: 13px;
}

.queue-strip strong {
  font-family: Consolas, monospace;
  color: var(--navy);
}

.content-wrap {
  width: min(900px, calc(100% - 32px));
  margin: 12px auto;
}

.appointment-logs-wrap {
  width: min(1600px, calc(100% - 48px));
}

.content-wrap.narrow {
  width: min(620px, calc(100% - 32px));
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.action-card {
  min-height: 154px;
  padding: 22px;
  text-decoration: none;
  display: grid;
  gap: 8px;
}

.action-card:hover {
  border-color: var(--teal);
  background: #ffffff;
}

.card-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.action-card strong {
  color: var(--teal-dark);
  font-size: 16px;
}

.action-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.page-title {
  margin-bottom: 18px;
}

.page-title.compact {
  margin-bottom: 14px;
}

.page-title h1 {
  font-size: 28px;
  color: var(--teal-dark);
}

.workspace-form,
.lookup-panel,
.result-card,
.table-card {
  padding: 22px;
  margin-bottom: 16px;
}

.lookup-panel .btn {
  margin-top: 16px;
}

/* ── CHECK-IN choices + scanner ────────────────────────────── */
.checkin-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .checkin-choices { grid-template-columns: 1fr; }
}

.qr-reader {
  width: 100%;
  max-width: 360px;
  margin: 0 auto 14px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.qr-reader:empty {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1ece4;
}
.qr-status {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.qr-actions {
  display: flex;
  justify-content: center;
}

.lookup-action-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.lookup-action-row .btn {
  margin-top: 0;
}

.lookup-result-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.lookup-qr-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf8;
}

.lookup-result-qr {
  width: 160px;
  height: 160px;
}

.lookup-detail {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.lookup-detail span {
  color: var(--muted);
}

.lookup-detail strong {
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 700px) {
  .lookup-result-grid {
    grid-template-columns: 1fr;
  }
}

.workspace-form.compact {
  box-shadow: none;
  border: 0;
  padding: 0;
  margin: 0;
}

.form-section {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.form-section h2,
.table-card h2 {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--teal-dark);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #bbb5aa;
  border-radius: 7px;
  padding: 10px 12px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42, 157, 143, .15);
}

.field-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.field-grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.field-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.field-grid.four {
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
}

.appointment-filter-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr .9fr 1.15fr auto auto;
  gap: 10px;
  align-items: end;
}

.appointment-filter-grid label {
  font-weight: 400;
  gap: 4px;
}

.appointment-filter-grid input,
.appointment-filter-grid select {
  padding: 6px 10px;
}

.appointment-filter-btn {
  min-width: 92px;
  margin-bottom: 0;
  padding: 8px 14px;
  min-height: 34px;
}

.library-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.library-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  min-height: 30px;
}

.library-tab.active,
.library-tab:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.library-filters {
  margin-top: 8px;
  display: flex;
  align-items: end;
  gap: 6px;
  flex-wrap: wrap;
}

.library-filters label {
  min-width: 140px;
  gap: 3px;
  font-size: 12px;
}

.library-filters label:first-child {
  min-width: 200px;
}

.library-filters #referralSearchInput {
  min-width: 200px;
}

.library-filters .btn {
  min-height: 30px;
  padding: 5px 14px;
  font-size: 12px;
  align-self: flex-end;
}

body[data-page="admin-libraries"] .workspace-form,
body[data-page="admin-libraries"] .table-card {
  padding: 12px;
  margin-bottom: 10px;
}

body[data-page="admin-libraries"] input,
body[data-page="admin-libraries"] select,
body[data-page="admin-libraries"] textarea {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

body[data-page="admin-libraries"] .table-card .btn,
body[data-page="admin-libraries"] .workspace-form .btn {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}


.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--muted);
}

body[data-page="admin-abtc-libraries"] .workspace-form,
body[data-page="admin-abtc-libraries"] .table-card {
  padding: 12px;
  margin-bottom: 10px;
}

body[data-page="admin-abtc-libraries"] input,
body[data-page="admin-abtc-libraries"] select,
body[data-page="admin-abtc-libraries"] textarea {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

body[data-page="admin-abtc-libraries"] .btn {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}


.icon-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--teal-dark);
  cursor: pointer;
}

.icon-action:hover {
  border-color: var(--teal);
  background: #e6f5f2;
}

.icon-action svg {
  width: 15px;
  height: 15px;
}

.icon-action[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  width: max-content;
  max-width: 180px;
  padding: 5px 7px;
  border-radius: 5px;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
  box-shadow: 0 6px 14px rgba(0,0,0,.16);
}

.icon-action.danger { color: #dc2626; }
.icon-action.danger:hover { border-color: #dc2626; background: #fff5f5; }

.hidden {
  display: none;
}

.result-card h2 {
  margin: 0 0 8px;
  color: var(--teal-dark);
}

.reference {
  display: inline-block;
  margin: 8px 0;
  padding: 8px 12px;
  border-radius: 7px;
  background: #e6f5f2;
  border: 1px solid var(--teal);
  color: var(--navy);
  font-family: Consolas, monospace;
  font-weight: 600;
}

.admin-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 26px auto;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-nav {
  position: sticky;
  top: 96px;
  background: var(--navy);
  color: #fff;
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 6px;
}

.admin-nav strong {
  color: #fff;
  margin-bottom: 10px;
}

.admin-nav a {
  color: #dbeafe;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 13px;
}

.admin-nav a:hover,
.admin-nav a.active {
  background: var(--teal);
  color: #fff;
}

.admin-main {
  min-width: 0;
}

.admin-metrics {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  color: #64748b;
  background: #fff;
  border-bottom: 2px solid var(--line);
  padding: 7px 10px;
  font-weight: 600;
  line-height: 1.3;
  vertical-align: middle;
  white-space: nowrap;
}

td {
  border-bottom: 1px solid #ebe5dc;
  padding: 6px 10px;
  line-height: 1.3;
  vertical-align: middle;
}

.appointment-logs-wrap th {
  padding: 7px 10px;
  background: rgba(51,65,85,.7);
  color: #fff;
  border-bottom: none;
}

.appointment-logs-wrap th[title="Called"] svg,
.appointment-logs-wrap th[title="Verified"] svg,
.appointment-logs-wrap th[title="Confirmed"] svg {
  stroke-width: 2.7;
}

body[data-page^="admin"] .table-card {
  overflow-x: auto;
}

body[data-page^="admin"] td {
  padding: 6px 10px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
  line-height: 1.3;
}

body[data-page^="admin"] th {
  padding: 7px 10px;
  white-space: nowrap;
}

body[data-page^="admin"] td label.switch,
body[data-page^="admin"] td .icon-action {
  vertical-align: middle;
}

body[data-page^="admin"] .switch {
  width: 38px;
  height: 20px;
}

body[data-page^="admin"] .slider:before {
  width: 14px;
  height: 14px;
}

body[data-page^="admin"] input:checked + .slider:before {
  transform: translateX(18px);
}

.appointment-logs-wrap td {
  padding: 5px 10px;
  line-height: 1.25;
}

.appointment-logs-wrap td.appt-col-text {
  font-size: 13px;
}

.appointment-logs-wrap th:first-child,
.appointment-logs-wrap td:first-child {
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}

.appointment-logs-wrap .appt-flag-cell {
  text-align: center;
  padding-left: 2px;
  padding-right: 2px;
  width: 30px;
}

.appt-flag-on {
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 1px currentColor;
}

.appt-flag-off {
  font-size: 18px;
  font-weight: 700;
  color: #cbd5e1;
  line-height: 1;
}

.appointment-logs-wrap input[type="checkbox"] {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

.appt-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  min-height: 22px;
  border-radius: 999px;
  white-space: nowrap;
}

.appt-pill-priority {
  min-width: 88px;
  background: #fef3c7;
  color: #92400e;
}

.appt-pill-status {
  min-width: 82px;
}

.appointment-logs-wrap th:last-child,
.appointment-logs-wrap td:last-child {
  text-align: right;
  padding-right: 14px;
}

.appt-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
}
.appt-list-header h2 {
  margin: 0;
  font-size: 15px;
}
body[data-page="appointment-logs"] .appt-list-header h2 {
  font-size: 17px;
}

.appt-batch-bar {
  display: none;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.appt-batch-count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-right: 4px;
}

.appt-batch-btn svg { flex-shrink: 0; }
.appt-batch-called   { background: #ea580c; }
.appt-batch-verified  { background: #2563eb; }
.appt-batch-confirmed { background: #16a34a; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.open {
  background: #dcfce7;
  color: var(--green);
}

.badge.closed {
  background: #fee2e2;
  color: var(--red);
}

.login-card {
  padding: 28px;
}

.login-logo {
  text-align: center;
  margin-bottom: 22px;
}

.login-logo img {
  width: 240px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  margin-bottom: 10px;
}

.login-logo h1 {
  margin: 0;
  color: var(--teal-dark);
}

.login-logo p {
  margin: 4px 0 0;
  color: var(--muted);
}

.site-footer {
  flex-shrink: 0;
  padding: 12px 16px 14px;
  color: #7c7065;
  text-align: center;
  font-size: 12px;
}

.empty-state {
  padding: 36px;
  text-align: center;
}

@media (max-width: 860px) {
  .brand-row,
  .hero-content,
  .kiosk-hero {
    grid-template-columns: 1fr;
  }

  .brand-row {
    align-items: flex-start;
  }

  .hero-content {
    padding-top: 38px;
  }

  .hero-copy h1 {
    font-size: 36px;
  }

  .action-grid,
  .kiosk-actions,
  .field-grid.two,
  .field-grid.three,
  .field-grid.four,
  .admin-layout,
  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    position: static;
  }

  .kiosk-screen {
    min-height: auto;
    grid-template-rows: auto auto auto;
  }

  .kiosk-tile {
    height: auto;
    min-height: 148px;
  }
}

@media (max-width: 560px) {
  .brand-row {
    padding: 10px 14px;
  }

  .brand-seal {
    width: 38px;
    height: 38px;
  }

  .brand-logo {
    height: 42px;
  }

  .main-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .main-nav a {
    padding: 8px 10px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .kiosk-screen {
    width: min(100% - 20px, 900px);
    margin-top: 12px;
    gap: 8px;
  }

  .kiosk-actions {
    margin-top: 10px;
  }

  .kiosk-hero {
    padding: 8px 12px;
    min-height: 0;
  }

  .kiosk-prompt {
    min-height: 0;
    padding: 8px 12px;
    font-size: 13px;
  }

  .kiosk-tile {
    min-height: 112px;
    padding: 16px;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 16px;
  }

  .kiosk-tile strong,
  .kiosk-tile small {
    grid-column: 2;
  }

  .tile-symbol {
    grid-row: 1 / span 2;
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .kiosk-tile strong {
    font-size: 17px;
  }

  .kiosk-tile small {
    font-size: 13px;
  }

  .kiosk-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-form,
  .lookup-panel,
  .result-card,
  .table-card {
    padding: 16px;
  }
}

/* ── BOOKING WIZARD ────────────────────────────────────────── */

.booking-shell { padding: 0; }

.bk-body { max-width: 900px; margin: 0 auto; padding: 12px 16px; }

.bk-card {
  background: var(--surface);
  border: 1px solid #d4cdc3;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

.bk-title { font-size: 22px; font-weight: 600; color: var(--teal-dark); }
.bk-sub { font-size: 16px; color: var(--muted); margin-bottom: 4px; }

.bk-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--teal-dark);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #d4cdc3;
}

.bk-alert {
  background: #fefce8;
  border: 1px solid #ca8a04;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  color: #713f12;
  margin-bottom: 16px;
  line-height: 1.6;
}
.bk-alert-error { background: #fee2e2; border-color: #ef4444; color: #991b1b; }

.bk-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  max-width: 600px;
  width: 90%;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.bk-toast-error { background: #fee2e2; border: 1px solid #ef4444; color: #991b1b; }
.bk-toast-success { background: #dcfce7; border: 1px solid #16a34a; color: #166534; }

/* Step indicator */
.bk-steps { display: flex; align-items: center; margin-bottom: 20px; gap: 0; }
.bk-step { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #94a3b8; }
.bk-step.active { color: var(--teal-dark); font-weight: 600; }
.bk-step.done { color: #15803d; }
.bk-step-dot {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid #bbb5aa; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; background: #fff; flex-shrink: 0;
}
.bk-step.active .bk-step-dot { border-color: var(--teal-dark); color: var(--teal-dark); }
.bk-step.done .bk-step-dot { border-color: #15803d; background: #15803d; color: #fff; }
.bk-step-line { flex: 1; height: 1px; background: #d4cdc3; min-width: 12px; }

/* Choices (home) */
.bk-choices { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 16px; margin-top: 20px; }
.bk-choice {
  background: linear-gradient(180deg, rgba(155, 241, 255, .18), var(--paper) 42%);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 28px 20px; text-align: center; cursor: pointer;
  transition: transform .24s cubic-bezier(.2,.8,.2,1), border-color .2s ease, background .2s ease, box-shadow .24s ease;
  position: relative; overflow: hidden;
}
.bk-choice::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 6px;
  background: var(--teal); transition: height .24s cubic-bezier(.2,.8,.2,1);
}
.bk-choice:hover {
  border-color: var(--teal-dark); background: #fff;
  transform: translateY(-6px) scale(1.01); box-shadow: 0 16px 36px rgba(36,41,67,.15);
}
.bk-choice:hover::before { height: 10px; }
.bk-choice.bk-choice-lookup {
  background: linear-gradient(180deg, rgba(99,102,241,.14), var(--paper) 42%);
}
.bk-choice.bk-choice-lookup::before { background: #6366f1; }
.bk-choice.bk-choice-lookup:hover { border-color: #6366f1; background: #fff; }
.bk-choice-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 600; margin: 0 auto 12px;
  box-shadow: 0 10px 24px rgba(36,41,67,.16);
  transition: transform .24s cubic-bezier(.2,.8,.2,1), box-shadow .24s ease;
}
.bk-choice:hover .bk-choice-icon { transform: translateY(-3px) scale(1.08); box-shadow: 0 14px 28px rgba(36,41,67,.20); }
.bk-choice.bk-choice-lookup .bk-choice-icon { background: #6366f1; }
.bk-choice.bk-choice-returning {
  background: linear-gradient(180deg, rgba(217,119,6,.16), var(--paper) 42%);
}
.bk-choice.bk-choice-returning::before { background: #d97706; }
.bk-choice.bk-choice-returning:hover { border-color: #d97706; background: #fff; }
.bk-choice.bk-choice-returning .bk-choice-icon { background: #d97706; }
.bk-choice-title { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.bk-choice-sub { font-size: 13px; color: var(--muted); }

/* Notice items */
.bk-notice-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #e8e2d8; font-size: 14px; color: var(--ink); line-height: 1.6; }
.bk-notice-item:last-child { border-bottom: none; }
.bk-bullet {
  min-width: 24px; height: 24px; border-radius: 50%;
  background: var(--teal-dark); color: #fff;
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}

/* Form fields */
.bk-field { margin-bottom: 9px; }
.bk-card > .bk-field:last-child,
.bk-card > .field-grid:last-child,
.bk-card > .bk-chips:last-child,
.bk-card > div:last-child > .bk-field:last-child { margin-bottom: 0; }
.bk-field label { display: block; font-size: 13px; font-weight: 500; color: #6a5e52; margin-bottom: 4px; }
.bk-field input, .bk-field select, .bk-field textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid #bbb5aa; border-radius: 8px;
  font-size: 14px; background: #fff; color: var(--ink);
  min-height: 39px; box-sizing: border-box;
}
.bk-field-upper input, .bk-field-upper select {
  text-transform: uppercase;
  font-family: inherit; transition: border-color .15s;
}
.bk-field input:focus, .bk-field select:focus, .bk-field textarea:focus {
  outline: none; border-color: #e67e22; box-shadow: 0 0 0 3px rgba(230,126,34,.22);
}
.bk-field label .req { color: var(--red); }
.bk-field textarea { resize: vertical; min-height: 70px; }

/* Priority chips */
.bk-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.bk-chip {
  padding: 6px 14px; border: 1px solid #bbb5aa; border-radius: 20px;
  font-size: 13px; cursor: pointer; background: #fff; color: var(--ink);
  transition: all .15s; user-select: none;
  min-width: 140px; text-align: center;
}
.bk-chip:hover { border-color: var(--teal-dark); color: var(--teal-dark); }
.bk-chip.active { background: #e6f5f2; border-color: var(--teal-dark); color: var(--teal-dark); font-weight: 500; }

/* Slot badge */
.bk-slot { border-radius: 8px; padding: 10px 14px; font-size: 13px; line-height: 1.6; margin-top: 6px; }
.bk-slot-open { background: #e6f5f2; border: 1px solid var(--teal-dark); color: var(--teal-dark); }
.bk-slot-warn { background: #fefce8; border: 1px solid #ca8a04; color: #713f12; }
.bk-slot-full { background: #fee2e2; border: 1px solid #ef4444; color: #991b1b; }
.bk-slot-bar { margin-top: 6px; background: #d4cdc3; border-radius: 4px; height: 6px; overflow: hidden; }
.bk-slot-bar div { height: 100%; border-radius: 4px; transition: width .4s ease; }

/* Tri-state toggle (Health Triaging) */
.tri-grid { display: grid; gap: 8px; }
.tri-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid #ebe5dc;
}
.tri-row:last-child { border-bottom: none; }
.tri-label { flex: 1; font-size: 13px; color: var(--ink); line-height: 1.4; }
.tri-toggle {
  display: flex; flex-shrink: 0; border: 1px solid #bbb5aa; border-radius: 20px; overflow: hidden;
}
.tri-btn {
  border: none; background: #fff; cursor: pointer; font-size: 12px; font-family: inherit;
  padding: 5px 14px; color: var(--muted); transition: all .15s; font-weight: 500;
}
.tri-btn:not(:last-child) { border-right: 1px solid #bbb5aa; }
.tri-no.active { background: #dc2626; color: #fff; }
.tri-null.active { background: #9ca3af; color: #fff; }
.tri-yes.active { background: #059669; color: #fff; }

/* Button row */
.bk-btn-row { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.bk-btn-row .btn { min-width: 130px; justify-content: center; display: inline-flex; align-items: center; gap: 6px; }

/* Confirmation */
/* Confirmation two-column layout */
.bk-confirm-grid { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.bk-confirm-details { min-width: 0; }
.bk-confirm-qr { width: 260px; }
.bk-confirm-actions { display: flex; gap: 8px; width: 100%; }
.bk-confirm-actions .btn { flex: 1; justify-content: center; }
@media (max-width: 700px) {
  .bk-confirm-grid { grid-template-columns: 1fr; }
  .bk-confirm-qr { width: 100%; }
}

.bk-qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0 0; }
.bk-check {
  width: 40px; height: 40px; border-radius: 50%;
  background: #dcfce7; border: 2px solid #16a34a;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #16a34a;
}
.bk-ref {
  font-family: monospace; font-size: 12px; font-weight: 600; letter-spacing: 1px;
  background: #f0ebe4; padding: 5px 14px; border-radius: 6px;
  color: var(--teal-dark); border: 1px solid #d4cdc3;
}
.bk-detail { display: flex; justify-content: space-between; align-items: flex-start; padding: 4px 0; border-bottom: 1px solid #e8e2d8; font-size: 11px; }
.bk-detail:last-child { border-bottom: none; }
.bk-detail-lbl { color: #6a5e52; flex-shrink: 0; margin-right: 8px; min-width: 70px; font-weight: 600; }
.bk-detail-val { font-weight: 500; color: var(--ink); text-align: right; word-break: break-word; }
.bk-detail-ref { font-family: monospace; font-weight: 600; color: var(--teal-dark); letter-spacing: 0.5px; }

/* Loading */
.bk-loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: #6a5e52; }
.bk-spinner {
  width: 24px; height: 24px;
  border: 3px solid #d4cdc3; border-top-color: var(--teal-dark);
  border-radius: 50%; animation: bk-spin .8s linear infinite;
  margin-right: 10px; flex-shrink: 0;
}
@keyframes bk-spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 600px) {
  .bk-choices { grid-template-columns: 1fr; }
  .bk-steps { gap: 0; }
  .bk-step span { display: none; }
  .bk-step-dot { width: 30px; height: 30px; font-size: 12px; }
  .bk-detail { flex-direction: column; gap: 2px; }
  .bk-detail-val { text-align: left; }
}

/* ── DATE PICKER ───────────────────────────────────────────── */

.cdp-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23277b8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px !important;
}

.cdp-popup {
  position: absolute;
  z-index: 1100;
  width: 360px;
  background: #fff;
  border: none;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(36, 41, 67, .20), 0 0 0 1px rgba(36,41,67,.06);
  padding: 20px;
  user-select: none;
  animation: cdp-in .18s ease;
}
@keyframes cdp-in { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.cdp-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #eee;
}
.cdp-my { font-size: 15px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.cdp-month-select {
  appearance: none; -webkit-appearance: none;
  border: none; background: none; font-size: 15px; font-weight: 600;
  color: var(--teal-dark); cursor: pointer; padding: 2px 16px 2px 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23277b8f' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right center;
}
.cdp-month-select:focus { outline: none; }
.cdp-year { color: var(--muted); font-size: 15px; }
.cdp-nav {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid #e8e2d8; background: #fff;
  color: var(--teal-dark); font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.cdp-nav:hover { background: var(--teal-dark); color: #fff; border-color: var(--teal-dark); }

.cdp-dow {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 0;
  margin-bottom: 6px; padding: 0 2px;
}
.cdp-dow span {
  text-align: center; font-size: 12px; font-weight: 700;
  color: #8a8279; padding: 6px 0; text-transform: capitalize;
}
.cdp-dow span:nth-child(6) { color: var(--teal-dark); }
.cdp-dow span:nth-child(7) { color: #dc2626; }

.cdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 0 2px; }
.cdp-cell {
  position: relative;
  width: 42px; height: 42px;
  border: none; background: none; cursor: pointer;
  border-radius: 50%; font-size: 14px; font-weight: 500; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 1px auto;
  transition: background .12s, color .12s, transform .12s;
}
.cdp-empty { cursor: default; }
.cdp-cell:not(.cdp-disabled):not(.cdp-empty):hover {
  background: #e6f5f2; transform: scale(1.1);
}
.cdp-sat { color: var(--teal-dark); font-weight: 600; }
.cdp-sun { color: #dc2626; font-weight: 600; }
.cdp-today {
  background: var(--teal-dark) !important; color: #fff !important; font-weight: 700;
  box-shadow: 0 4px 12px rgba(39,123,143,.35);
}
.cdp-selected {
  background: var(--teal-dark) !important; color: #fff !important; font-weight: 700;
  box-shadow: 0 4px 12px rgba(39,123,143,.35);
  transform: scale(1.08);
}
.cdp-today:not(.cdp-selected) {
  background: transparent !important; color: var(--teal-dark) !important;
  box-shadow: inset 0 0 0 2px var(--teal-dark);
}
.cdp-disabled { color: #d4cdc3; cursor: not-allowed; }
.cdp-disabled:hover { background: none !important; transform: none !important; }
.cdp-full { color: #bbb; background: #f9f7f4; cursor: not-allowed; }
.cdp-full .cdp-booked { color: #bbb; }
.cdp-holiday { background: #fff0f0 !important; color: #dc2626 !important; cursor: not-allowed; }
.cdp-hol-note { color: #dc2626 !important; font-size: 7px; letter-spacing: -0.2px; max-width: 38px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.cdp-note { font-size: 8px; line-height: 1; margin-top: 1px; color: inherit; opacity: .85; font-weight: 600; }
.cdp-booked { color: #2563eb; }
.cdp-total { color: #dc2626; }
.cdp-selected .cdp-booked, .cdp-selected .cdp-total { color: #fff; }

@media (max-width: 600px) {
  .cdp-popup { width: calc(100vw - 24px); max-width: 380px; }
  .cdp-cell { width: 38px; height: 38px; font-size: 14px; }
}

/* ── WHEEL DATE PICKER (iPhone style) ──────────────────────── */

.wd-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(20, 26, 30, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: wd-fade .18s ease;
}
@keyframes wd-fade { from { opacity: 0; } to { opacity: 1; } }

.wd-modal {
  background: #fff;
  width: 100%; max-width: 460px;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.25);
  animation: wd-up .22s cubic-bezier(.4,0,.2,1);
}
@keyframes wd-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

@media (min-width: 600px) {
  .wd-overlay { align-items: center; }
  .wd-modal { border-radius: 16px; }
}

.wd-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.wd-title {
  flex: 1; min-width: 0; text-align: center;
  font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.25;
}
.wd-title .wd-sub { display: block; }
.wd-cancel, .wd-done {
  cursor: pointer;
  font-size: 14px; font-family: inherit; font-weight: 600;
  padding: 8px 18px; border-radius: 8px;
  width: 90px; text-align: center; flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s;
}
.wd-title .wd-sub { font-weight: 400; font-style: italic; }
.wd-cancel {
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
}
.wd-cancel:hover { border-color: var(--teal-dark); color: var(--teal-dark); }
.wd-done {
  color: #fff;
  background: var(--teal-dark);
  border: 1px solid var(--teal-dark);
}
.wd-done:hover { background: #1f6577; }

.wd-wheels {
  position: relative;
  display: grid; grid-template-columns: 1fr 1.6fr 1.2fr;
  gap: 0; padding: 8px 12px 18px;
  height: 228px;
}
.wd-col {
  height: 190px; overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  text-align: center;
  scrollbar-width: none;
}
.wd-col::-webkit-scrollbar { display: none; }
.wd-pad { height: 76px; }
.wd-item {
  height: 38px; line-height: 38px;
  scroll-snap-align: center;
  font-size: 18px; color: #b8b0a4;
  transition: color .12s, transform .12s;
}
.wd-col:nth-child(2) .wd-item { font-size: 17px; }
.wd-item.wd-on { color: var(--teal-dark); font-weight: 600; transform: scale(1.06); }
.wd-band {
  position: absolute; left: 12px; right: 12px;
  top: calc(8px + 76px); height: 38px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: rgba(39,123,143,.06);
  pointer-events: none; border-radius: 6px;
}

@media (max-width: 600px) {
  .wd-head { padding: 10px 12px; gap: 6px; }
  .wd-title { font-size: 13px; }
  .wd-cancel, .wd-done { min-width: 0; padding: 8px 14px; font-size: 13px; }
  .wd-wheels { grid-template-columns: 1fr 1.5fr 1.1fr; padding-left: 6px; padding-right: 6px; }
  .wd-item { font-size: 17px; }
}

/* ── ADMIN OVERRIDES ───────────────────────────────────────── */

/* Login page width and typography */
.content-wrap.narrow.login-wrap {
  /* Card content = 280px (the ClinikaHub logo width) so logo, inputs, and the
     Sign in button all share the same width. 280 + 2x28px card padding = 336. */
  width: min(336px, calc(100% - 32px)) !important;
}

/* Vertically (and horizontally) center the login card on both login pages. */
body[data-page="admin-login"] main,
body[data-page="abtc-login"] main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-title {
  font-size: 30px !important; /* Reduce font size by 2px (from default ~32px) */
}

.login-label {
  margin-bottom: 16px;
  display: grid;
  gap: 6px;
}

.login-label.password-label {
  margin-bottom: 26px; /* Spacing between Password field and Sign In button */
}

/* Keep login input text one consistent size across empty / typed / focused /
   browser-autofilled states — stops the size "jump" when the field is focused. */
.login-wrap .login-label input,
.login-wrap .login-label input:focus {
  font-size: 16px;
  line-height: 1.4;
}
.login-wrap .login-label input::placeholder {
  font-size: 16px;
}
.login-wrap .login-label input:-webkit-autofill,
.login-wrap .login-label input:-webkit-autofill:hover,
.login-wrap .login-label input:-webkit-autofill:focus {
  font-size: 16px;
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--field) inset;
  caret-color: var(--ink);
}

.login-submit-btn {
  margin-top: 10px;
}

.login-error-msg {
  color: var(--red);
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 7px;
  padding: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}

/* Fixed Admin Nav Location */
.admin-nav {
  position: sticky !important;
  top: 26px !important; /* Keep it aligned to the top of layout margin */
  height: fit-content;
}

/* Toggle Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--teal-dark);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Modal Dialog Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #fff;
  border-radius: 8px;
  width: min(500px, calc(100% - 32px));
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  transform: translateY(-20px);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.modal-overlay.show .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 16px 20px;
  background: var(--navy);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.appt-metrics {
  grid-template-columns: repeat(8, 1fr);
  margin-bottom: 16px;
}

.appt-metrics.metric-grid div {
  border: none;
}

.appt-metrics.metric-grid strong {
  color: #fff;
}

.appt-metrics.metric-grid span {
  color: rgba(255,255,255,.85);
}

.appt-metrics .appt-card-total { background: rgba(51,65,85,.7); }
.appt-metrics .appt-card-pending { background: rgba(234,179,8,.7); }
.appt-metrics .appt-card-pending strong { color: #422006; }
.appt-metrics .appt-card-pending span { color: rgba(66,32,6,.7); }
.appt-metrics .appt-card-called { background: rgba(220,38,38,.7); }
.appt-metrics .appt-card-verified { background: rgba(234,88,12,.7); }
.appt-metrics .appt-card-confirmed { background: rgba(124,58,237,.7); }
.appt-metrics .appt-card-checkedin { background: rgba(37,99,235,.7); }
.appt-metrics .appt-card-done { background: rgba(22,163,74,.7); }
.appt-metrics .appt-card-noshow { background: rgba(153,27,27,.7); }

/* ── ABTC Module ──────────────────────────────────────── */
.abtc-logs-wrap { max-width: 1600px; }

.rhu-patient-name {
  display: inline-block;
  font-weight: 600;
}

.patient-inline-meta {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.abtc-filter-grid {
  grid-template-columns: 1.2fr 1fr 1.2fr auto auto;
}

.abtc-wound-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.abtc-wound-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}
.abtc-wound-row input[type="checkbox"] { flex-shrink: 0; width: 16px; height: 16px; }
.abtc-wound-desc { flex: 1; }

.abtc-patient-banner {
  background: #f0f4f8;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  color: var(--ink);
}

.icon-action.abtc-chart-exists { color: #16a34a; }
.icon-action.abtc-chart-empty  { color: #cbd5e1; }
.icon-action.abtc-chart-exists:hover { color: #15803d; }
.icon-action.abtc-chart-empty:hover  { color: #d97706; }

@media (max-width: 860px) {
  .appointment-filter-grid,
  .abtc-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .appointment-filter-btn {
    width: 100%;
  }

  .appt-metrics {
    grid-template-columns: repeat(4, 1fr);
  }

  .abtc-wound-grid {
    grid-template-columns: 1fr;
  }
}

/* Placeholder Styling for Dummy Entries */
::placeholder {
  font-weight: 400 !important;
  font-style: italic !important;
  color: #888888 !important;
  opacity: 1 !important;
}
::-webkit-input-placeholder {
  font-weight: 400 !important;
  font-style: italic !important;
  color: #888888 !important;
  opacity: 1 !important;
}
:-ms-input-placeholder {
  font-weight: 400 !important;
  font-style: italic !important;
  color: #888888 !important;
  opacity: 1 !important;
}

/* ── Client Satisfaction Feedback Modal ────────────────────── */
.csf-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.csf-overlay.show { opacity: 1; pointer-events: auto; }
.csf-card {
  background: #fff; border-radius: 14px;
  width: min(440px, calc(100% - 32px));
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  transform: translateY(-16px) scale(.96);
  transition: transform .25s ease;
  overflow: hidden;
}
.csf-overlay.show .csf-card { transform: translateY(0) scale(1); }
.csf-header {
  background: linear-gradient(135deg, #277b8f, #0d9488);
  padding: 18px 22px; color: #fff;
  display: flex; align-items: center; gap: 10px;
}
.csf-header.abtc { background: linear-gradient(135deg, #b45309, #d97706); }
.csf-header svg { width: 22px; height: 22px; flex-shrink: 0; }
.csf-header h3 { margin: 0; font-size: 15px; font-weight: 600; }
.csf-body { padding: 20px 22px; }
.csf-notice {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px;
  padding: 12px 14px; margin-bottom: 16px;
  font-size: 12.5px; color: #15803d; line-height: 1.6;
}
.csf-notice.abtc { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.csf-notice svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.csf-label {
  font-size: 13px; font-weight: 500; color: #334155;
  margin-bottom: 8px; display: block;
}
.csf-emoji-row {
  display: flex; gap: 8px; margin-bottom: 18px; justify-content: center;
}
.csf-emoji-btn {
  flex: 1; max-width: 68px; padding: 10px 4px;
  border: 2px solid #e2e8f0; border-radius: 10px;
  background: #f8fafc; cursor: pointer;
  text-align: center; font-size: 26px;
  transition: all .15s; line-height: 1;
}
.csf-emoji-btn:hover { border-color: #94a3b8; transform: translateY(-2px); }
.csf-emoji-btn.sel { border-color: #0d9488; background: #f0fdfa; transform: scale(1.08); }
.csf-emoji-btn.abtc.sel { border-color: #d97706; background: #fffbeb; }
.csf-emoji-label {
  font-size: 9px; color: #94a3b8; margin-top: 4px;
  display: block; line-height: 1.2;
}
.csf-emoji-btn.sel .csf-emoji-label { color: #0d9488; font-weight: 600; }
.csf-emoji-btn.abtc.sel .csf-emoji-label { color: #b45309; }
.csf-textarea {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid #e2e8f0; border-radius: 8px;
  font-size: 13px; font-family: inherit;
  resize: vertical; min-height: 60px;
  outline: none; transition: border-color .15s;
  margin-bottom: 6px;
}
.csf-textarea:focus { border-color: #0d9488; }
.csf-textarea.abtc:focus { border-color: #d97706; }
.csf-footer {
  padding: 14px 22px; background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.csf-skip {
  background: none; border: none;
  color: #94a3b8; font-size: 13px; cursor: pointer;
  padding: 8px 4px; transition: color .15s;
}
.csf-skip:hover { color: #64748b; }
.csf-submit-btn {
  padding: 10px 24px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, #277b8f, #0d9488);
  color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity .15s;
}
.csf-submit-btn:hover { opacity: .9; }
.csf-submit-btn.abtc {
  background: linear-gradient(135deg, #b45309, #d97706);
}
.csf-submit-btn:disabled { opacity: .5; cursor: not-allowed; }
.csf-thankyou {
  text-align: center; padding: 28px 16px;
  color: #15803d; font-size: 14px; line-height: 1.7;
}
@media (max-width: 480px) {
  .csf-card { border-radius: 14px 14px 0 0; align-self: flex-end; }
  .csf-emoji-btn { font-size: 22px; padding: 8px 2px; }
}
