:root {
  --ink: #24140f;
  --muted: #755f53;
  --line: #ead7b1;
  --surface: #ffffff;
  --soft: #f2e4bb;
  --sidebar: #a62454;
  --sidebar-strong: #a62103;
  --accent: #a64f03;
  --accent-strong: #8c3f00;
  --warm: #d99b66;
  --cream: #f2e4bb;
  --danger: #b42318;
  --success: #087443;
  --focus: #a62454;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--soft);
  color: var(--ink);
}

.hidden {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.lucide {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 2.4;
}

.icon-lead {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #fff7e3;
  color: var(--sidebar);
}

.inline-icon {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.auth-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(166, 36, 84, 0.16), transparent 46%),
    linear-gradient(315deg, rgba(217, 155, 102, 0.36), transparent 42%),
    var(--soft);
}

.auth-card {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(36, 20, 15, 0.14);
}

.auth-brand {
  padding: 0 0 24px;
  color: var(--ink);
}

.auth-brand .brand-mark {
  border-color: var(--sidebar);
  color: var(--sidebar);
}

.auth-card h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 0;
}

.helper-text,
.sample-note,
.form-message {
  color: var(--muted);
  line-height: 1.55;
}

.sample-note {
  margin: 16px 0 0;
  font-size: 14px;
}

.form-message {
  min-height: 22px;
  margin: 0;
  font-weight: 800;
}

.form-message.error {
  color: var(--danger);
}

.stacked-form {
  display: grid;
  gap: 14px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 32px 22px;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-strong));
  color: #fff;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 8px 6px 34px;
}

.mobile-app-title {
  display: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  font-weight: 800;
}

.brand h1,
.topbar h2,
.section-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 25px;
}

.eyebrow {
  margin: 0 0 5px;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}

.nav-list {
  display: grid;
  gap: 10px;
}

.nav-button {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  text-align: left;
  transition: background 140ms ease, transform 140ms ease;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(242, 228, 187, 0.18);
}

.nav-button .nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 800;
}

.nav-icon .lucide {
  width: 16px;
  height: 16px;
}

.mobile-bottom-nav {
  display: none;
}

.main-content {
  min-width: 0;
  padding: 28px;
}

.topbar,
.section-heading,
.card,
.booking-panel,
.appointment-table,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
  padding: 18px 20px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.topbar .eyebrow,
.section-heading .eyebrow {
  color: var(--muted);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 20px;
}

.section-heading.compact {
  margin: 0;
  padding: 0 0 18px;
  border: 0;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(166, 79, 3, 0.18);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-button:hover {
  border-color: var(--sidebar);
  color: var(--sidebar);
}

.notification-button {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--danger);
}

.danger-button {
  background: var(--danger);
  color: #fff;
}

.icon-button {
  width: 42px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

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

.home-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.home-hero h2,
.home-hero p {
  margin: 0;
}

.home-hero p:not(.eyebrow) {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.announcement-slider {
  position: relative;
  min-height: 360px;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff 0%, #fff7e3 100%);
}

.announcement-slide {
  display: none;
  min-height: 360px;
  padding: 28px;
  align-content: center;
  background:
    linear-gradient(90deg, rgba(255, 250, 240, 0.97) 0%, rgba(255, 250, 240, 0.86) 42%, rgba(255, 250, 240, 0.14) 72%),
    var(--slide-image) center right / cover no-repeat;
}

.announcement-slide.active {
  display: grid;
}

.announcement-copy {
  max-width: 520px;
  border-radius: 8px;
}

.announcement-slide h3 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0;
}

.announcement-slide p:not(.eyebrow) {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.announcement-dots {
  position: absolute;
  right: 22px;
  bottom: 18px;
  display: flex;
  gap: 8px;
}

.announcement-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #d9b8c6;
}

.announcement-dot.active {
  width: 28px;
  background: var(--sidebar);
}

.appointment-action-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.appointment-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.appointment-action-button:hover,
.appointment-action-button.active {
  border-color: var(--sidebar);
  background: #fff4e7;
  color: var(--sidebar);
}

.booking-select-cue {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 800;
}

.booking-select-cue span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.booking-select-cue p {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.qr-page-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
  margin-top: 16px;
}

.qr-appointment-list,
.qr-display-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.qr-appointment-button {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.qr-appointment-button:hover,
.qr-appointment-button.is-selected {
  border-color: var(--sidebar);
  box-shadow: 0 0 0 3px rgba(166, 36, 84, 0.14);
}

.qr-appointment-button span {
  color: var(--muted);
  font-weight: 800;
}

.compact-summary {
  margin-top: 12px;
}

.card {
  padding: 18px;
}

.patient-card {
  display: grid;
  gap: 14px;
  min-height: 220px;
}

.patient-card.selected {
  border-color: var(--sidebar);
  box-shadow: 0 0 0 3px rgba(166, 36, 84, 0.14);
}

.card-title {
  margin: 0;
  font-size: 22px;
}

.meta-list {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--muted);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.meta-row strong {
  color: var(--ink);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f8ead2;
  color: var(--sidebar-strong);
  font-size: 13px;
  font-weight: 800;
}

.status-pill .lucide {
  width: 15px;
  height: 15px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  counter-reset: booking-step;
}

.stepper::before {
  content: "";
  position: absolute;
  top: 24px;
  left: 9%;
  right: 9%;
  height: 3px;
  border-radius: 999px;
  background: var(--line);
}

.step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 92px;
  padding: 0 8px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.step-number {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  box-shadow: 0 8px 18px rgba(36, 20, 15, 0.08);
}

.step-text {
  display: grid;
  gap: 2px;
  font-size: 15px;
  line-height: 1.25;
}

.step-text small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.step.active {
  color: var(--sidebar-strong);
}

.step.active .step-number {
  border-color: var(--sidebar);
  background: var(--sidebar);
  color: #fff;
}

.step.completed {
  color: var(--success);
}

.step.completed .step-number {
  border-color: var(--success);
  background: #ecfdf3;
  color: var(--success);
}

.booking-panel {
  padding: 22px;
}

.guideline-start-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(135deg, #fffaf0, #fff);
}

.guideline-start-card h3 {
  margin: 0 0 12px;
  font-size: 26px;
  letter-spacing: 0;
}

.guideline-start-card .guidelines {
  margin-bottom: 0;
}

.compact-guideline-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.guidelines {
  display: grid;
  gap: 14px;
  margin: 0 0 20px;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.6;
}

.alert-note {
  border-left: 4px solid var(--danger);
  margin: 18px 0;
  padding: 12px 14px;
  background: #fff4e7;
  color: var(--danger);
  font-weight: 800;
}

.success-banner {
  margin-bottom: 16px;
  border: 1px solid rgba(8, 116, 67, 0.2);
  border-radius: 8px;
  padding: 18px;
  background: #ecfdf3;
  color: var(--success);
}

.success-banner h3 {
  margin: 0;
  color: var(--success);
  font-size: 28px;
  letter-spacing: 0;
}

.cancellation-banner {
  border-color: rgba(180, 35, 24, 0.22);
  background: #fff4e7;
  color: var(--danger);
}

.cancellation-banner h3 {
  color: var(--danger);
}

.review-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.review-item {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.review-item.with-icon {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
}

.review-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.review-item strong {
  display: block;
  font-size: 18px;
}

.option-grid,
.slot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.date-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.date-button {
  display: grid;
  gap: 5px;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.date-button:hover,
.date-button.is-selected {
  border-color: var(--sidebar);
  background: #fff7e3;
}

.date-button span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.option-button,
.slot-button {
  display: grid;
  gap: 6px;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.option-button .icon-lead,
.slot-button .icon-lead {
  margin-bottom: 4px;
}

.option-button:hover,
.slot-button:hover {
  border-color: var(--sidebar);
  background: #fffaf0;
}

.option-button strong,
.slot-button strong {
  display: block;
  font-size: 18px;
}

.option-button span,
.slot-button span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.slot-button.is-full {
  cursor: not-allowed;
  background: #f2f4f7;
  color: #98a2b3;
}

.slot-button.is-low {
  border-color: var(--warm);
  background: #fff4e7;
}

.slot-button.is-selected {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(8, 116, 67, 0.12);
}

.time-slot-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.time-slot-panel h3 {
  margin: 0;
}

.time-slot-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.time-slot-button {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: center;
}

.time-slot-button:hover,
.time-slot-button.is-selected {
  border-color: var(--sidebar);
  box-shadow: 0 0 0 3px rgba(166, 36, 84, 0.14);
}

.time-slot-button strong {
  color: var(--danger);
  font-size: 22px;
}

.time-slot-button span {
  color: var(--muted);
  font-weight: 900;
}

.time-slot-button.is-full {
  cursor: not-allowed;
  background: #f2f4f7;
  color: #98a2b3;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.appointment-table {
  overflow: hidden;
}

.appointment-row,
.appointment-header {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px;
}

.appointment-header {
  background: var(--cream);
  font-weight: 800;
}

.appointment-row {
  border-top: 1px solid var(--line);
}

.appointment-qr-row {
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

.appointment-qr-row .qr-checkin-card {
  margin-bottom: 0;
}

.appointment-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.queue-mobile-status {
  display: grid;
  gap: 3px;
}

.patient-queue-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 18px;
}

.patient-queue-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 260px;
  padding: 24px 18px;
  border: 5px solid #e7aa00;
  border-radius: 44px;
  background: linear-gradient(180deg, #fffdf8 0%, #fff3c9 100%);
  text-align: center;
}

.patient-queue-session {
  display: flex;
  gap: 18px;
  color: #6d6a66;
  font-size: 24px;
  font-weight: 800;
}

.patient-queue-number {
  color: #9a3033;
  font-size: 78px;
  font-weight: 500;
  line-height: 0.95;
}

.patient-queue-card h3 {
  margin: 8px 0 0;
  font-size: 28px;
}

.patient-queue-card p {
  margin: 0;
  color: #6d6a66;
  font-size: 22px;
  font-weight: 800;
}

.queue-refresh-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 18px;
  border: 1px solid #c8c0b5;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: #7d7872;
  font-weight: 800;
}

.admin-toolbar {
  margin-bottom: 16px;
}

.admin-toolbar label {
  max-width: 520px;
}

.appointment-time {
  color: var(--danger);
  font-size: 24px;
  font-weight: 900;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
}

.dialog {
  width: min(760px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
}

.guideline-dialog {
  width: min(720px, calc(100vw - 32px));
}

.guideline-dialog[open] {
  animation: dialog-pop-shell 240ms ease-out;
}

.guideline-dialog::backdrop {
  background:
    radial-gradient(circle at 50% 18%, rgba(242, 228, 187, 0.38), transparent 34%),
    rgba(36, 20, 15, 0.58);
  animation: dialog-backdrop-in 240ms ease-out;
}

.guideline-dialog-card {
  position: relative;
  overflow: hidden;
  transform-origin: 50% 24%;
  animation: guideline-card-in 360ms cubic-bezier(0.2, 0.9, 0.2, 1.08);
}

.guideline-dialog-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.8) 42%, transparent 62%);
  transform: translateX(-120%);
  animation: guideline-sheen 780ms ease-out 120ms;
}

.guideline-dialog-card .icon-button {
  animation: guideline-close-pop 520ms ease-out 170ms both;
}

.guideline-modal-list li {
  opacity: 0;
  transform: translateY(8px);
  animation: guideline-item-in 360ms ease-out forwards;
}

.guideline-modal-list li:nth-child(1) {
  animation-delay: 120ms;
}

.guideline-modal-list li:nth-child(2) {
  animation-delay: 180ms;
}

.guideline-modal-list li:nth-child(3) {
  animation-delay: 240ms;
}

.guideline-modal-list li:nth-child(4) {
  animation-delay: 300ms;
}

.guideline-modal-list li:nth-child(5) {
  animation-delay: 360ms;
}

.guideline-dialog-card .alert-note {
  animation: guideline-alert-pulse 900ms ease-out 430ms both;
}

#startBookingFromGuidelinesButton {
  animation: guideline-cta-glow 1200ms ease-out 560ms both;
}

.dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.dialog-card {
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

.field-hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.address-counter {
  text-align: right;
}

.button-link {
  text-decoration: none;
}

.doctor-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
}

.queue-panel,
.clinical-workspace,
.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.queue-panel {
  align-self: start;
  padding: 18px;
}

.queue-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.queue-item {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.queue-item.active {
  border-color: var(--sidebar);
  box-shadow: 0 0 0 3px rgba(166, 36, 84, 0.14);
}

.queue-number {
  color: var(--sidebar);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.clinical-workspace {
  padding: 18px;
}

.patient-summary {
  margin-bottom: 18px;
}

.clinical-form {
  display: grid;
  gap: 16px;
}

.doctor-section-target {
  scroll-margin-top: 22px;
}

.section-anchor {
  display: block;
  height: 0;
  scroll-margin-top: 22px;
}

.section-focus {
  box-shadow: 0 0 0 3px rgba(166, 36, 84, 0.14);
  transition: box-shadow 180ms ease;
}

.form-section {
  padding: 18px;
}

.form-section h3 {
  margin: 0 0 14px;
  font-size: 22px;
  letter-spacing: 0;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  gap: 18px;
}

.admin-view {
  display: none;
}

.admin-view.active {
  display: block;
}

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

.admin-form h3,
.session-card h3 {
  margin: 0 0 14px;
  font-size: 22px;
  letter-spacing: 0;
}

.session-list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
}

.session-overview-panel {
  margin-top: 18px;
}

.schedule-generator-panel {
  margin-bottom: 18px;
}

.generator-controls {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  gap: 12px;
  align-items: end;
}

.default-schedule-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

#sessionList {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.coverage-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.coverage-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.coverage-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.coverage-card p {
  margin: 0;
  color: var(--muted);
}

.warning-pill {
  background: #fff4e7;
  color: var(--danger);
}

.session-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.session-card p {
  margin: 0;
  color: var(--muted);
}

.capacity-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #f8ead2;
}

.capacity-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--sidebar);
}

.capacity-warning {
  margin: 0;
  color: var(--danger);
  font-weight: 900;
}

.display-body {
  background:
    linear-gradient(135deg, rgba(166, 36, 84, 0.1), transparent 42%),
    linear-gradient(315deg, rgba(217, 155, 102, 0.22), transparent 40%),
    var(--soft);
}

.portal-body {
  background:
    linear-gradient(135deg, rgba(166, 36, 84, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(217, 155, 102, 0.28), transparent 42%),
    var(--soft);
}

.portal-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px;
}

.portal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(36, 20, 15, 0.08);
}

.portal-header .brand-mark {
  width: 66px;
  height: 66px;
  border-color: var(--sidebar);
  color: var(--sidebar);
  font-size: 20px;
}

.portal-header h1 {
  margin: 0;
  font-size: 34px;
}

.portal-header .helper-text {
  margin: 8px 0 0;
}

.portal-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.portal-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-height: 220px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.portal-card h2 {
  margin: 0;
  font-size: 25px;
}

.portal-card p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.portal-card .button-link {
  grid-column: 1 / -1;
  align-self: end;
  width: fit-content;
}

.qr-checkin-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7e3;
}

.qr-checkin-card img {
  width: 150px;
  height: 150px;
  border: 8px solid #fff;
  border-radius: 8px;
}

.qr-checkin-card h3 {
  margin: 0;
}

.kiosk-body {
  background:
    linear-gradient(135deg, rgba(166, 36, 84, 0.14), transparent 46%),
    linear-gradient(315deg, rgba(217, 155, 102, 0.28), transparent 42%),
    var(--soft);
}

.kiosk-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.kiosk-panel {
  display: grid;
  gap: 18px;
  width: min(900px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(36, 20, 15, 0.14);
}

.kiosk-panel .brand-mark {
  border-color: var(--sidebar);
  color: var(--sidebar);
}

.kiosk-panel h1 {
  margin: 0;
  font-size: 34px;
}

.kiosk-camera {
  position: relative;
  display: grid;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #24140f;
}

.kiosk-camera video,
.kiosk-camera-placeholder {
  grid-area: 1 / 1;
}

.kiosk-camera video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kiosk-camera-placeholder {
  display: grid;
  place-items: center;
  gap: 12px;
  color: #fff;
  text-align: center;
}

.kiosk-camera-placeholder .lucide {
  width: 54px;
  height: 54px;
}

.kiosk-result {
  display: grid;
  gap: 14px;
}

.queue-display-screen {
  min-height: 100vh;
  padding: 24px;
}

.display-topbar {
  display: flex;
  justify-content: center;
  gap: 18px;
  align-items: center;
  max-width: 1500px;
  margin: 0 auto 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.display-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
}

.display-brand .brand-mark {
  border-color: var(--sidebar);
  color: var(--sidebar);
}

.display-brand h1 {
  margin: 0;
  font-size: 32px;
}

.display-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 1500px;
  margin: 0 auto;
}

.display-board,
.display-control-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.display-board {
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(36, 20, 15, 0.12);
}

.display-clinic-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 140px;
  gap: 18px;
  align-items: center;
  padding: 24px;
  background: linear-gradient(90deg, var(--sidebar), var(--sidebar-strong));
  color: #fff;
}

.display-label {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.78;
}

.display-clinic-row h2,
.display-clinic-row p {
  margin: 0;
}

.display-clinic-row h2 {
  font-size: 34px;
}

.display-clinic-row strong {
  font-size: 42px;
  line-height: 1;
}

.display-clinic-number {
  display: block;
  font-size: 72px !important;
}

.display-number-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
  background: #fff7e3;
}

.display-number-card {
  min-height: 230px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.display-number-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 26px;
  font-weight: 900;
}

.display-number-card p span,
.display-list-section h3 span,
.display-announcement h3 span,
.display-footer span {
  color: inherit;
  font-weight: 900;
}

.display-number-card strong {
  display: block;
  color: var(--sidebar);
  font-size: clamp(86px, 12vw, 160px);
  line-height: 0.95;
}

.display-list-section,
.display-announcement {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
}

.display-list-section h3,
.display-announcement h3,
.display-control-panel h3 {
  margin: 0 0 12px;
  font-size: 24px;
}

.display-number-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(74px, 1fr));
  gap: 10px;
  min-height: 72px;
}

.display-number-chip {
  display: grid;
  place-items: center;
  min-height: 58px;
  border-radius: 8px;
  background: #f7ead0;
  color: var(--sidebar);
  font-size: 32px;
  font-weight: 900;
}

.pass-list-section .display-number-chip {
  background: #f9e7e2;
  color: var(--danger);
}

.display-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.display-announcement {
  background: #0f5c55;
  color: #fff;
}

.display-announcement p {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.display-footer {
  padding: 16px 24px;
  background: var(--accent);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  text-align: center;
}

.display-control-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px;
}

.display-control-panel label {
  display: grid;
  gap: 8px;
  font-weight: 900;
}

.queue-action-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.arrival-action-list {
  display: grid;
  gap: 10px;
}

.arrival-action-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.arrival-action-card div {
  display: grid;
  gap: 4px;
}

.arrival-action-card span {
  color: var(--muted);
  font-weight: 800;
}

.counter-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 18px;
}

.counter-station-overview {
  grid-column: 1 / -1;
}

.counter-station-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 320px);
  gap: 12px;
  margin: 14px 0;
}

.counter-station-toolbar label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

.counter-station-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.station-empty {
  grid-column: 1 / -1;
}

.counter-station-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 160px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.counter-station-card:hover,
.counter-station-card.is-selected {
  border-color: var(--sidebar);
  box-shadow: 0 0 0 3px rgba(166, 36, 84, 0.14);
}

.counter-station-card strong {
  font-size: 18px;
}

.counter-station-card small {
  color: var(--muted);
  font-weight: 800;
}

.counter-control-card {
  align-content: start;
}

.counter-control-card,
.counter-control-card label {
  display: grid;
  gap: 14px;
}

.counter-number-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.counter-number-card {
  display: grid;
  gap: 6px;
  min-height: 120px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7e3;
}

.counter-number-card span {
  color: var(--muted);
  font-weight: 900;
}

.counter-number-card strong {
  color: var(--sidebar);
  font-size: 46px;
  line-height: 1;
}

.selected-station-summary {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7e3;
}

.selected-station-summary h3,
.selected-station-summary p {
  margin: 0;
}

.staff-control-tray {
  max-width: 1500px;
  margin: 18px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.staff-control-tray summary {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px 16px;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.staff-control-tray .display-control-panel {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(260px, 1.2fr);
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  background: #fff;
}

@media (max-width: 1100px) {
  .doctor-layout {
    grid-template-columns: 1fr;
  }

  .display-layout {
    grid-template-columns: 1fr;
  }

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

  .portal-header {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-actions {
    justify-items: start;
  }

  .display-control-panel {
    order: -1;
  }

  .staff-control-tray .display-control-panel {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .counter-layout {
    grid-template-columns: 1fr;
  }

  .counter-station-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .default-schedule-list {
    grid-template-columns: 1fr;
  }
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.full-width,
.check-row {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  color: var(--muted);
  font-weight: 700;
}

.check-row.standalone {
  grid-column: auto;
}

.check-row input {
  width: 20px;
  margin-top: 2px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 240px 1fr;
  }

  .patient-grid,
  .patient-queue-grid,
  .option-grid,
  .slot-grid,
  .time-slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .date-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .appointment-row,
  .appointment-header {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
    min-height: 100dvh;
    background: #fffaf0;
  }

  .sidebar {
    display: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -8px 30px rgba(36, 20, 15, 0.14);
    backdrop-filter: blur(14px);
  }

  .mobile-tab {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 58px;
    padding: 7px 2px;
    border: 0;
    border-radius: 8px;
    justify-items: center;
    align-content: center;
    gap: 5px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
  }

  .mobile-tab.active {
    background: #fff4e7;
    color: var(--sidebar);
  }

  .mobile-tab .lucide {
    width: 26px;
    height: 26px;
  }

  .mobile-tab span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .main-content {
    min-height: 100dvh;
    padding: 74px 12px calc(92px + env(safe-area-inset-bottom));
    background: #fffaf0;
  }

  .topbar {
    position: fixed;
    z-index: 10;
    top: 0;
    right: 0;
    left: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    margin: 0;
    padding: 8px 12px;
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(36, 20, 15, 0.08);
  }

  .mobile-app-title {
    display: flex;
    gap: 9px;
    align-items: center;
    min-width: 0;
  }

  .mobile-app-title .brand-mark {
    width: 42px;
    height: 42px;
    border-color: var(--sidebar);
    color: var(--sidebar);
    font-size: 18px;
  }

  .mobile-app-title .eyebrow {
    color: var(--muted);
    font-size: 9px;
  }

  .mobile-app-title h2 {
    font-size: 18px;
  }

  .active-patient-block {
    display: none;
  }

  .topbar h2 {
    font-size: 18px;
  }

  .topbar-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0;
  }

  .topbar-actions .secondary-button {
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    font-size: 0;
  }

  .notification-dot {
    top: 9px;
    right: 9px;
  }

  #switchPatientButton,
  #logoutButton {
    display: none;
  }

  .section-actions {
    justify-content: stretch;
  }

  .section-actions .primary-button,
  .section-actions .secondary-button {
    flex: 1 1 100%;
  }

  .appointment-action-strip {
    grid-template-columns: 1fr;
  }

  .booking-select-cue {
    justify-content: center;
    margin: 2px 0 8px;
  }

  .booking-select-cue p {
    display: none;
  }

  .qr-page-layout {
    grid-template-columns: 1fr;
  }

  .display-topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .queue-display-screen {
    padding: 16px;
  }

  .portal-shell {
    padding: 16px;
  }

  .portal-card {
    grid-template-columns: 1fr;
  }

  .card,
  .booking-panel,
  .section-heading {
    border-radius: 8px;
  }

  .home-hero {
    display: grid;
    gap: 14px;
    padding: 18px;
  }

  .home-hero .primary-button {
    width: 100%;
  }

  .announcement-slider {
    min-height: 360px;
  }

  .announcement-slide {
    min-height: 360px;
    padding: 20px;
    align-content: end;
    background:
      linear-gradient(180deg, rgba(255, 250, 240, 0.12) 0%, rgba(255, 250, 240, 0.72) 48%, rgba(255, 250, 240, 0.97) 100%),
      var(--slide-image) center top / cover no-repeat;
  }

  .announcement-copy {
    max-width: none;
  }

  .announcement-slide h3 {
    font-size: 24px;
  }

  .announcement-slide p:not(.eyebrow) {
    font-size: 15px;
  }

  .auth-screen {
    align-items: stretch;
    padding: 12px;
  }

  .auth-card {
    align-self: center;
    padding: 20px;
  }

  .dialog {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }

  .dialog-card {
    min-height: 100dvh;
    padding: 16px;
  }

  .counter-station-grid {
    grid-template-columns: 1fr;
  }

  .counter-station-toolbar {
    grid-template-columns: 1fr;
  }

  .qr-checkin-card {
    grid-template-columns: 1fr;
  }

  .kiosk-camera {
    min-height: 260px;
  }

  .display-clinic-row,
  .display-number-grid,
  .display-number-list {
    grid-template-columns: 1fr;
  }

  .display-clinic-number {
    font-size: 56px !important;
  }

  .patient-grid,
  .patient-queue-grid,
  .option-grid,
  .slot-grid,
  .time-slot-grid,
  .date-strip,
  .form-grid,
  .generator-controls {
    grid-template-columns: 1fr;
  }

  .stepper {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 14px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
  }

  .stepper::before {
    top: 27px;
    left: 12%;
    right: 12%;
    width: auto;
    height: 3px;
  }

  .step {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 6px;
    min-height: 74px;
    padding: 0 2px;
    text-align: center;
  }

  .step-number {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .step-text {
    max-width: 68px;
    font-size: 12px;
  }

  .step-text small {
    display: none;
  }

  .guideline-start-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .guideline-start-card .icon-lead {
    display: none;
  }

  .guideline-start-card h3 {
    font-size: 22px;
  }

  .guidelines {
    gap: 10px;
    padding-left: 18px;
    font-size: 14px;
    line-height: 1.45;
  }

  .appointment-row,
  .appointment-header,
  .review-summary {
    grid-template-columns: 1fr;
  }

  .appointment-header {
    display: none;
  }
}

@keyframes dialog-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes dialog-pop-shell {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes guideline-card-in {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  70% {
    opacity: 1;
    transform: translateY(-2px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes guideline-sheen {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(120%);
  }
}

@keyframes guideline-close-pop {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }
  65% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes guideline-item-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes guideline-alert-pulse {
  0% {
    opacity: 0;
    transform: translateY(8px);
    box-shadow: 0 0 0 0 rgba(180, 35, 24, 0);
  }
  45% {
    opacity: 1;
    transform: translateY(0);
    box-shadow: 0 0 0 8px rgba(180, 35, 24, 0.08);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    box-shadow: 0 0 0 0 rgba(180, 35, 24, 0);
  }
}

@keyframes guideline-cta-glow {
  0% {
    box-shadow: 0 0 0 rgba(166, 79, 3, 0);
    transform: translateY(0);
  }
  45% {
    box-shadow: 0 14px 28px rgba(166, 79, 3, 0.24);
    transform: translateY(-1px);
  }
  100% {
    box-shadow: 0 0 0 rgba(166, 79, 3, 0);
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .guideline-dialog[open],
  .guideline-dialog::backdrop,
  .guideline-dialog-card,
  .guideline-dialog-card::before,
  .guideline-dialog-card .icon-button,
  .guideline-modal-list li,
  .guideline-dialog-card .alert-note,
  #startBookingFromGuidelinesButton {
    animation: none;
  }

  .guideline-modal-list li {
    opacity: 1;
    transform: none;
  }
}
