﻿:root {
  --bg-0: #0f1419;
  --bg-1: #1a202c;
  --bg-2: #2d3748;
  --panel: rgba(26, 32, 44, 0.85);
  --panel-strong: rgba(32, 40, 56, 0.95);
  --border: rgba(99, 115, 129, 0.2);
  --border-strong: rgba(66, 153, 225, 0.4);
  --text: #ffffff;
  --muted: #a0aec0;
  --faint: #718096;
  --primary: #2563eb;
  --primary-2: #3b82f6;
  --warning: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  --display-font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--body-font);
  background: linear-gradient(135deg, #0f1419 0%, #1a202c 50%, #2d3748 100%);
  overflow-x: hidden;
}

body.login-page {
  display: block;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.88), transparent 85%);
  pointer-events: none;
}

.auth-backdrop {
  position: fixed;
  inset: auto;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  filter: blur(26px);
  opacity: 0.28;
  pointer-events: none;
  animation: floatBlob 20s ease-in-out infinite;
}

.auth-backdrop-a {
  top: -5rem;
  left: -6rem;
  background: radial-gradient(circle, rgba(122, 215, 255, 0.75), transparent 68%);
}

.auth-backdrop-b {
  bottom: 2rem;
  right: -8rem;
  background: radial-gradient(circle, rgba(81, 214, 195, 0.7), transparent 68%);
  animation-delay: -7s;
}

.auth-backdrop-c {
  top: 30%;
  left: 50%;
  width: 14rem;
  height: 14rem;
  background: radial-gradient(circle, rgba(247, 178, 103, 0.42), transparent 68%);
  animation-delay: -12s;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1360px, calc(100vw - 2rem));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(420px, 0.82fr);
  gap: 1.2rem;
  align-items: center;
  padding: 1.25rem 0;
}

.auth-shell > * {
  min-width: 0;
}

.auth-hero,
.auth-card {
  padding: 1.45rem;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.auth-logo {
  flex: 0 0 auto;
  width: 4rem;
  height: 4rem;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.26);
}

.auth-brand-copy {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.auth-brand-copy strong {
  color: #ffffff;
  font-family: var(--display-font);
  font-size: 1.08rem;
  letter-spacing: 0;
}

.auth-hero h1 {
  margin: 0.8rem 0 0.85rem;
  font-family: var(--display-font);
  font-size: 4.05rem;
  line-height: 0.95;
  letter-spacing: 0;
}

.auth-copy {
  margin: 0;
  max-width: 39rem;
  color: var(--muted);
  line-height: 1.55;
  font-size: 1rem;
}

.auth-workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 1rem;
}

.auth-workflow span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(81, 214, 195, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(81, 214, 195, 0.07);
  color: #dffdf4;
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

.auth-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.auth-feature {
  display: grid;
  gap: 0.5rem;
  min-height: 10.4rem;
  padding: 0.9rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.auth-feature h2 {
  margin: 0;
  font-family: var(--display-font);
  font-size: 1rem;
}

.auth-feature p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.9rem;
}

.auth-feature-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(122, 215, 255, 0.2);
  background: rgba(122, 215, 255, 0.08);
  color: var(--primary-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

.auth-card {
  justify-self: end;
  width: 100%;
  max-width: none;
}

.auth-form {
  display: grid;
  gap: 0.9rem;
}

.auth-role-picker {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.auth-role-picker legend {
  margin: 0 0 0.4rem;
  padding: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.auth-role-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.auth-role-input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.auth-role-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(66, 153, 225, 0.38);
  border-radius: 10px;
  background: rgba(26, 32, 44, 0.5);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.auth-role-option:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.7);
  color: var(--text);
  background: rgba(37, 99, 235, 0.1);
}

.auth-role-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary-2);
}

.auth-role-icon svg {
  width: 0.78rem;
  height: 0.78rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-role-input:checked + .auth-role-option {
  border-color: rgba(59, 130, 246, 0.9);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.18), rgba(81, 214, 195, 0.08)),
    rgba(255, 255, 255, 0.04);
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.auth-role-input:checked + .auth-role-option .auth-role-icon {
  background: var(--primary);
  color: #ffffff;
}

.auth-role-input:focus-visible + .auth-role-option {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.auth-submit {
  width: 100%;
  margin-top: 0.1rem;
}

.auth-alert {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 123, 139, 0.25);
  background: rgba(255, 123, 139, 0.08);
  color: #ffd8df;
}

.auth-alert-success {
  border-color: rgba(92, 224, 162, 0.26);
  background: rgba(92, 224, 162, 0.08);
  color: #c7ffe3;
}

.auth-switch {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

.auth-switch a {
  color: var(--primary-2);
  font-weight: 800;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-switch.is-hidden {
  display: none;
}

.auth-note {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(81, 214, 195, 0.18);
  background: rgba(81, 214, 195, 0.06);
  color: var(--muted);
  line-height: 1.55;
}

.auth-mode-login .auth-card .section-header.compact {
  margin-bottom: 0.85rem;
}

.auth-mode-login .auth-card .section-header h2 {
  font-size: 1.55rem;
  letter-spacing: 0;
}

.auth-mode-login .auth-card .section-kicker {
  font-size: 0.78rem;
}

.auth-mode-login .auth-form {
  gap: 0.85rem;
}

.auth-mode-login .auth-card .field {
  gap: 0.45rem;
}

.auth-mode-login .auth-card .field > span {
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-mode-login .auth-card input:not([type="radio"]),
.auth-mode-login .auth-card select {
  min-height: 3.25rem;
  padding: 0.85rem 1rem;
  font-size: 0.98rem;
}

.auth-mode-login .auth-submit {
  min-height: 3.1rem;
  font-size: 1rem;
}

.auth-mode-login .auth-note {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  font-size: 0.98rem;
}

.auth-banner {
  position: sticky;
  top: 0.75rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1440px, calc(100vw - 2rem));
  margin: 0 auto 1rem;
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(8, 16, 26, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-banner-copy {
  display: grid;
  gap: 0.18rem;
}

.auth-banner-kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: var(--primary-2);
}

.auth-banner-copy strong {
  font-family: var(--display-font);
  font-size: 1rem;
}

.auth-banner-copy span {
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-banner-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.auth-banner-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  font-weight: 700;
}

.auth-role-badge.role-admin {
  color: #bff7df;
  background: rgba(81, 214, 195, 0.1);
  border-color: rgba(81, 214, 195, 0.22);
}

.auth-role-badge.role-client {
  color: #d7f0ff;
  background: rgba(122, 215, 255, 0.1);
  border-color: rgba(122, 215, 255, 0.22);
}

.auth-role-badge.role-doctor {
  color: #ffe8bd;
  background: rgba(245, 158, 11, 0.11);
  border-color: rgba(245, 158, 11, 0.25);
}

.auth-logout {
  padding: 0.8rem 1rem;
}

.backdrop {
  position: fixed;
  inset: auto;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0.22;
  pointer-events: none;
  animation: floatBlob 20s ease-in-out infinite;
}

.backdrop-a {
  top: -4rem;
  right: -6rem;
  background: radial-gradient(circle, rgba(122, 215, 255, 0.9), transparent 70%);
}

.backdrop-b {
  bottom: 4rem;
  left: -8rem;
  background: radial-gradient(circle, rgba(81, 214, 195, 0.85), transparent 70%);
  animation-delay: -6s;
}

.backdrop-c {
  top: 42%;
  right: 10%;
  width: 16rem;
  height: 16rem;
  background: radial-gradient(circle, rgba(247, 178, 103, 0.5), transparent 70%);
  animation-delay: -12s;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
}

.card {
  background: linear-gradient(180deg, rgba(19, 33, 50, 0.94), rgba(8, 17, 27, 0.88));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 1.25rem;
  padding: 1.5rem;
  margin-bottom: 1.2rem;
  overflow: hidden;
}

.hero-copy {
  padding: 0.4rem 0.25rem 0.3rem;
}

.eyebrow,
.section-kicker,
.mini-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 700;
}

.hero h1 {
  margin: 0.8rem 0 1.2rem;
  font-family: var(--display-font);
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: #ffffff;
}

.hero-text {
  margin: 0 0 1.5rem 0;
  max-width: 65ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 0.85rem 1.4rem;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 200ms ease;
  font-size: 0.95rem;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.button-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  font-weight: 600;
}

.button-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.button-ghost {
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.button-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-shadow: none;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-strong);
}

.logo-icon {
  font-size: 2rem;
}

.brand-name {
  font-family: var(--display-font);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.hero-status {
  display: grid;
  gap: 0.95rem;
}

.hero-status-card {
  display: grid;
  gap: 0.45rem;
  padding: 1.2rem;
  min-height: 10.5rem;
  background:
    linear-gradient(180deg, rgba(9, 21, 34, 0.82), rgba(13, 32, 49, 0.92)),
    radial-gradient(circle at top right, rgba(81, 214, 195, 0.18), transparent 30%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.hero-status-card strong {
  font-family: var(--display-font);
  font-size: 1.3rem;
}

.hero-status-card span {
  color: var(--muted);
  line-height: 1.5;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.mini-metric {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.mini-metric strong {
  display: block;
  font-family: var(--display-font);
  font-size: 1.45rem;
}

.mini-metric span {
  color: var(--muted);
  font-size: 0.9rem;
}

.flow-strip {
  padding: 1.25rem 1.25rem 1rem;
  margin-bottom: 1.2rem;
}

.client-page-nav {
  display: none;
  gap: 0.65rem;
  margin: 0 0 1.2rem;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(8, 16, 26, 0.58);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.admin-page-nav {
  display: none;
  gap: 0.65rem;
  margin: 0 0 1.2rem;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(8, 16, 26, 0.58);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

body.role-client .client-page-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body.role-admin .admin-page-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.35rem;
  scrollbar-width: thin;
}

body.role-admin .admin-page-link {
  flex: 0 0 auto;
  min-height: 2.65rem;
  padding: 0.65rem 0.9rem;
  white-space: nowrap;
  font-size: 0.88rem;
}

.account-verification-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.2rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(250, 176, 5, 0.42);
  border-radius: var(--radius-md);
  background: rgba(250, 176, 5, 0.1);
  box-shadow: var(--shadow);
}

.account-verification-banner[hidden] {
  display: none;
}

.account-verification-banner div {
  display: grid;
  gap: 0.25rem;
}

.account-verification-banner strong {
  color: var(--text);
  font-size: 1rem;
}

.account-verification-banner span {
  color: var(--muted);
  line-height: 1.45;
}

.client-page-link,
.admin-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.client-page-link:hover,
.admin-page-link:hover {
  transform: translateY(-1px);
  border-color: rgba(122, 215, 255, 0.22);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.client-page-link.active,
.admin-page-link.active {
  border-color: rgba(81, 214, 195, 0.34);
  color: #e9fff7;
  background:
    linear-gradient(180deg, rgba(81, 214, 195, 0.12), rgba(37, 99, 235, 0.08)),
    rgba(255, 255, 255, 0.04);
}

[data-client-page][hidden] {
  display: none !important;
}

body.role-client .flow-strip {
  display: none;
}

body.role-client .workspace {
  grid-template-columns: 1fr;
}

body.role-client .work-panel,
body.role-client .intake-panel,
body.role-client .summary-panel,
body.role-client .bottom-panel {
  width: 100%;
}

body.role-client .page-actions {
  justify-content: flex-end;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.section-header.compact {
  margin-bottom: 0.85rem;
}

.section-header h2,
.slot-head h3 {
  margin: 0.3rem 0 0;
  font-family: var(--display-font);
  letter-spacing: -0.03em;
}

.section-header h2 {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
}

.section-support {
  max-width: 42rem;
  margin: 0.45rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.smart-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(122, 215, 255, 0.22);
  background: rgba(122, 215, 255, 0.08);
  color: var(--muted);
  font-size: 0.9rem;
}

.smart-badge button {
  border: 0;
  background: transparent;
  color: var(--primary-2);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.smart-badge.warning {
  border-color: rgba(255, 123, 139, 0.32);
  background: rgba(255, 123, 139, 0.1);
  color: #ffd7dd;
}

.ai-match-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(130px, 0.45fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ai-match-card {
  display: grid;
  gap: 0.35rem;
  min-height: 100%;
  padding: 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(122, 215, 255, 0.18);
  background: rgba(255, 255, 255, 0.045);
}

.ai-match-card.primary {
  border-color: rgba(81, 214, 195, 0.25);
  background: linear-gradient(135deg, rgba(81, 214, 195, 0.1), rgba(122, 215, 255, 0.06));
}

.ai-match-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-match-card strong {
  color: var(--text);
  font-size: 1rem;
}

.ai-match-card small {
  color: var(--muted);
  line-height: 1.45;
}

.ai-match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.step {
  display: grid;
  gap: 0.7rem;
  min-height: 100%;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-weight: 800;
  color: #061420;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
}

.step-copy h3 {
  margin: 0;
  font-family: var(--display-font);
  font-size: 1rem;
}

.step-copy p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.step-status {
  display: inline-flex;
  width: fit-content;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.step.done {
  border-color: rgba(81, 214, 195, 0.3);
  background: linear-gradient(180deg, rgba(81, 214, 195, 0.08), rgba(255, 255, 255, 0.03));
}

.step.done .step-status,
.step.active .step-status {
  color: var(--success);
  border-color: rgba(81, 214, 195, 0.22);
  background: rgba(81, 214, 195, 0.08);
}

.step.active {
  border-color: rgba(122, 215, 255, 0.32);
}

.step.warn {
  border-color: rgba(255, 123, 139, 0.3);
  background: rgba(255, 123, 139, 0.06);
}

.step.warn .step-status {
  color: var(--danger);
  border-color: rgba(255, 123, 139, 0.24);
  background: rgba(255, 123, 139, 0.08);
}

.step.pending {
  opacity: 0.8;
}

.badge {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.badge.good {
  color: var(--success);
  background: rgba(92, 224, 162, 0.1);
  border-color: rgba(92, 224, 162, 0.22);
}

.badge.pending {
  color: var(--warning);
  background: rgba(247, 178, 103, 0.1);
  border-color: rgba(247, 178, 103, 0.24);
}

.badge.warn {
  color: var(--danger);
  background: rgba(255, 123, 139, 0.1);
  border-color: rgba(255, 123, 139, 0.24);
}

.status-chip.active {
  color: var(--success);
  background: rgba(92, 224, 162, 0.08);
  border-color: rgba(92, 224, 162, 0.18);
}

.status-chip.pending {
  color: var(--warning);
  background: rgba(247, 178, 103, 0.1);
  border-color: rgba(247, 178, 103, 0.24);
}

.status-chip.cancelled {
  color: var(--warning);
  background: rgba(247, 178, 103, 0.1);
  border-color: rgba(247, 178, 103, 0.24);
}

.status-chip.completed {
  color: #bff7df;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(81, 214, 195, 0.24);
}

.status-chip.no-show {
  color: #fbcf89;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.34);
}

.status-chip.account-active {
  color: #bff7df;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(81, 214, 195, 0.24);
}

.status-chip.account-inactive {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.28);
}

.status-chip.verification-verified {
  color: #bff7df;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(81, 214, 195, 0.24);
}

.status-chip.verification-unverified {
  color: #fbcf89;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.34);
}

.status-chip.verification-not-required {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.24);
}

.danger-text {
  color: var(--danger);
}

.warning-text {
  color: var(--warning);
}

.muted-text {
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.92fr) minmax(320px, 0.85fr);
  gap: 1.15rem;
  align-items: start;
  margin-bottom: 1.2rem;
}

.work-panel,
.intake-panel,
.summary-panel,
.bottom-panel {
  min-width: 0;
  padding: 1.25rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 0.9rem;
  margin-bottom: 0.95rem;
}

.search-builder {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(160px, 0.65fr);
  gap: 0.9rem;
  margin-bottom: 0.95rem;
  align-items: stretch;
}

.search-choice {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: 1.8rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(59, 130, 246, 0.05) 100%);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.search-choice:hover {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
}

.search-choice-head {
  display: grid;
  gap: 0.3rem;
}

.search-choice-head strong {
  font-family: var(--display-font);
  font-size: 1.05rem;
  color: #ffffff;
  font-weight: 600;
}

.field-stack {
  display: grid;
  gap: 0.85rem;
}

.intake-section-list {
  display: grid;
  gap: 0.9rem;
}

.intake-section {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
}

.intake-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1.6rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.intake-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.field {
  display: grid;
  gap: 0.5rem;
}

.field > span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: rgba(26, 32, 44, 0.6);
  color: var(--text);
  font: inherit;
  padding: 0.95rem 1.1rem;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  background: rgba(26, 32, 44, 0.9);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

select {
  appearance: none;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 0.75rem 0.98rem;
  font: inherit;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.chip:hover {
  transform: translateY(-1px);
}

.chip.active {
  color: #061420;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
}

.doctor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.doctor-card {
  display: grid;
  gap: 0.85rem;
  min-height: 100%;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.doctor-card:hover {
  transform: translateY(-2px);
  border-color: rgba(122, 215, 255, 0.24);
  background: rgba(255, 255, 255, 0.05);
}

.doctor-card.selected {
  border-color: rgba(81, 214, 195, 0.55);
  background:
    linear-gradient(180deg, rgba(81, 214, 195, 0.08), rgba(255, 255, 255, 0.03));
  box-shadow: 0 0 0 1px rgba(81, 214, 195, 0.16) inset;
}

.doctor-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.doctor-card h3 {
  margin: 0.2rem 0 0.35rem;
  font-family: var(--display-font);
  font-size: 1.02rem;
}

.doctor-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.doctor-specialty,
.doctor-badge,
.status-chip,
.appointment-id,
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.doctor-specialty {
  color: var(--primary-2);
  background: rgba(122, 215, 255, 0.08);
}

.appointment-reference {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.payment-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.32rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.payment-status-pill.paid {
  color: #bff7df;
  border-color: rgba(81, 214, 195, 0.35);
  background: rgba(16, 185, 129, 0.13);
}

.payment-status-pill.unpaid {
  color: #ffe0ad;
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.13);
}

.payment-status-pill.pending {
  color: #d7f2ff;
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(37, 99, 235, 0.16);
}

.doctor-badge {
  color: var(--primary);
  background: rgba(81, 214, 195, 0.08);
}

.doctor-meta {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.doctor-meta span {
  line-height: 1.45;
}

.doctor-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.slot-panel {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.slot-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.slot-head > div {
  min-width: 0;
}

.slot-head p {
  flex: 1 1 16rem;
  max-width: 32ch;
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.5;
  text-align: right;
  overflow-wrap: anywhere;
}

.slot-grid {
  display: grid;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

.slot-days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
  min-width: 0;
}

.slot-day-card {
  display: grid;
  align-content: start;
  gap: 0.85rem;
  min-width: 0;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(9, 21, 34, 0.82), rgba(13, 28, 44, 0.88)),
    rgba(255, 255, 255, 0.03);
}

.slot-day-card.selected {
  border-color: rgba(81, 214, 195, 0.46);
  box-shadow: 0 0 0 1px rgba(81, 214, 195, 0.14) inset;
}

.slot-day-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.slot-day-card-head > div {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.slot-day-card-head strong {
  color: var(--text);
  font-family: var(--display-font);
  font-size: 1rem;
}

.slot-day-card-head span {
  color: var(--muted);
  font-size: 0.78rem;
}

.slot-day-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 4.2rem;
  min-height: 1.65rem;
  padding: 0.28rem 0.52rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.slot-day-count.open {
  color: #bff7df;
  border-color: rgba(81, 214, 195, 0.3);
  background: rgba(16, 185, 129, 0.12);
}

.slot-day-count.full {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.slot-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.slot-chip {
  appearance: none;
  display: grid;
  justify-items: center;
  gap: 0.22rem;
  min-width: 0;
  min-height: 4rem;
  padding: 0.7rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.slot-chip strong {
  font-size: 0.96rem;
  line-height: 1.1;
}

.slot-chip span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.slot-chip.available {
  border-color: rgba(81, 214, 195, 0.22);
  background: rgba(81, 214, 195, 0.08);
}

.slot-chip.available:hover {
  transform: translateY(-1px);
  border-color: rgba(122, 215, 255, 0.42);
  background: rgba(122, 215, 255, 0.11);
}

.slot-chip.selected {
  border-color: rgba(81, 214, 195, 0.72);
  background:
    linear-gradient(180deg, rgba(81, 214, 195, 0.18), rgba(37, 99, 235, 0.12)),
    rgba(81, 214, 195, 0.08);
  box-shadow: 0 0 0 1px rgba(81, 214, 195, 0.18) inset;
}

.slot-chip.booked,
.slot-chip:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.slot-chip.booked {
  border-color: rgba(255, 123, 139, 0.2);
  background: rgba(255, 123, 139, 0.07);
}

.slot-day-empty {
  display: grid;
  place-items: center;
  min-height: 4rem;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
}

.slot {
  min-width: 120px;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(7, 18, 29, 0.85);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.slot:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(122, 215, 255, 0.35);
}

.slot strong {
  display: block;
  font-size: 0.94rem;
}

.slot span {
  display: block;
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.slot.available.selected {
  border-color: rgba(81, 214, 195, 0.62);
  background: linear-gradient(135deg, rgba(81, 214, 195, 0.18), rgba(122, 215, 255, 0.12));
}

.slot.booked,
.slot:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.slot.booked {
  background: rgba(255, 123, 139, 0.08);
  border-color: rgba(255, 123, 139, 0.25);
}

.time-slot-grid {
  width: max-content;
  min-width: 100%;
  display: grid;
  grid-template-columns: minmax(86px, 0.65fr) repeat(var(--slot-day-count), minmax(112px, 1fr));
  gap: 0.5rem;
}

.time-slot-corner,
.time-slot-day,
.time-slot-time,
.time-slot-cell {
  min-height: 4.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.time-slot-corner,
.time-slot-time {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-weight: 700;
}

.time-slot-day {
  display: grid;
  align-content: center;
  gap: 0.2rem;
  padding: 0.75rem;
  background: rgba(37, 99, 235, 0.08);
}

.time-slot-day.selected {
  border-color: rgba(81, 214, 195, 0.45);
  background: rgba(81, 214, 195, 0.1);
}

.time-slot-day strong,
.time-slot-cell strong {
  color: var(--text);
  font-size: 0.9rem;
}

.time-slot-day span,
.time-slot-cell span {
  color: var(--muted);
  font-size: 0.78rem;
}

.time-slot-cell {
  display: grid;
  align-content: center;
  gap: 0.25rem;
  width: 100%;
  padding: 0.75rem;
  color: var(--text);
  font: inherit;
  text-align: left;
}

button.time-slot-cell {
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

button.time-slot-cell.available {
  background: rgba(7, 18, 29, 0.85);
}

button.time-slot-cell.available:hover {
  transform: translateY(-1px);
  border-color: rgba(122, 215, 255, 0.35);
}

.time-slot-cell.selected {
  border-color: rgba(81, 214, 195, 0.62);
  background: linear-gradient(135deg, rgba(81, 214, 195, 0.18), rgba(122, 215, 255, 0.12));
}

.time-slot-cell.booked,
.time-slot-cell.closed {
  opacity: 0.62;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.time-slot-cell.booked {
  border-color: rgba(255, 123, 139, 0.25);
  background: rgba(255, 123, 139, 0.08);
}

.triage-card {
  margin-top: 0;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.triage-head h3 {
  margin: 0.2rem 0 0;
  font-family: var(--display-font);
}

.radio-row {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.radio-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.radio-pill input {
  width: auto;
  margin: 0;
  accent-color: var(--primary);
}

.radio-pill span {
  color: var(--text);
}

.triage-card p {
  margin: 0.8rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.validation-message {
  min-height: 1.5rem;
  margin-top: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
}

.validation-message.error {
  color: #ffc0ca;
}

.validation-message.success {
  color: #bff7df;
}

.validation-message.info {
  color: #d7f2ff;
}

.info-card {
  display: grid;
  gap: 0.85rem;
  min-height: 12rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.info-card .empty-state {
  display: grid;
  gap: 0.45rem;
  align-content: start;
  color: var(--muted);
}

.review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.review-score strong,
.confirmation-card strong {
  display: block;
  font-family: var(--display-font);
  font-size: 1.05rem;
}

.review-score span,
.confirmation-card span {
  color: var(--muted);
}

.summary-grid {
  display: grid;
  gap: 0.7rem;
}

.summary-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.summary-row span {
  color: var(--muted);
}

.summary-row strong {
  text-align: right;
  font-weight: 700;
  color: var(--text);
}

.summary-row.warn strong {
  color: var(--warning);
}

.summary-row.good strong {
  color: var(--success);
}

.status-board {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(0, 0, 0, 0.08);
}

.status-row span {
  color: var(--muted);
}

.status-row strong {
  color: var(--success);
}

.status-row strong.pending {
  color: var(--warning);
}

.status-row strong.danger {
  color: var(--danger);
}

.bottom-panel {
  margin-bottom: 0.3rem;
}

.board-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
}

.board-stats span {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

body.role-admin .board-stats > span {
  display: contents;
}

.admin-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 2rem;
  padding: 0.38rem 0.64rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.admin-stat-chip:hover,
.admin-stat-chip.active {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.58);
  color: #ffffff;
  background: rgba(37, 99, 235, 0.16);
}

.admin-stat-chip strong {
  color: #ffffff;
}

.board-stats .admin-stat-chip span {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
}

.appointments-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}

body.role-admin .appointments-board {
  grid-template-columns: 1fr;
  gap: 1rem;
}

.admin-booking-toolbar {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid rgba(99, 115, 129, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(8, 16, 26, 0.62);
}

.admin-booking-toolbar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.admin-booking-toolbar-head > div {
  display: grid;
  gap: 0.25rem;
}

.admin-booking-toolbar-head strong {
  color: #ffffff;
  font-size: 1rem;
}

.admin-filter-reset {
  min-height: 2.25rem;
  padding: 0.52rem 0.75rem;
}

.admin-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 0.34fr) minmax(170px, 0.34fr);
  gap: 0.75rem;
  align-items: end;
}

.admin-search-field {
  min-width: 0;
}

.admin-booking-grid-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 760px) {
  .admin-booking-grid-wrap {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1320px) {
  .admin-booking-grid-wrap {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .admin-booking-toolbar-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-filter-grid,
  .admin-booking-actions {
    grid-template-columns: 1fr;
  }
}

.appointment-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.appointment-card.active {
  border-color: rgba(81, 214, 195, 0.28);
}

.appointment-card.pending {
  border-color: rgba(247, 178, 103, 0.34);
  background:
    linear-gradient(180deg, rgba(247, 178, 103, 0.08), rgba(255, 255, 255, 0.03));
}

.appointment-card.cancelled {
  opacity: 0.72;
}

.appointment-card.completed {
  border-color: rgba(81, 214, 195, 0.28);
  background:
    linear-gradient(180deg, rgba(16, 185, 129, 0.07), rgba(255, 255, 255, 0.03));
}

.admin-booking-card {
  align-content: start;
  gap: 0.78rem;
  padding: 0.95rem;
  border-color: rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(12, 18, 30, 0.92)),
    rgba(255, 255, 255, 0.03);
}

.admin-booking-card.pending {
  border-color: rgba(245, 158, 11, 0.48);
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.12), rgba(12, 18, 30, 0.92)),
    rgba(255, 255, 255, 0.03);
}

.admin-booking-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.admin-booking-card-head > div {
  min-width: 0;
}

.admin-booking-card-head h3 {
  margin: 0.45rem 0 0;
  color: #ffffff;
  font-family: var(--display-font);
  font-size: 1.08rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.admin-booking-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  max-width: 11.5rem;
  padding: 0.42rem 0.62rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
}

.admin-booking-badge.warning,
.admin-booking-badge.pending {
  border: 1px solid rgba(251, 191, 36, 0.72);
  color: #fffbeb;
  background: rgba(180, 83, 9, 0.48);
}

.admin-booking-badge.success {
  border: 1px solid rgba(16, 185, 129, 0.58);
  color: #ecfdf5;
  background: rgba(4, 120, 87, 0.4);
}

.admin-booking-badge.danger {
  border: 1px solid rgba(248, 113, 113, 0.62);
  color: #fff1f2;
  background: rgba(153, 27, 27, 0.42);
}

.admin-booking-badge.muted {
  border: 1px solid rgba(148, 163, 184, 0.34);
  color: #e5e7eb;
  background: rgba(71, 85, 105, 0.35);
}

.admin-booking-section {
  display: grid;
  gap: 0.55rem;
  padding: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.1);
}

.admin-booking-section-title {
  color: var(--primary-2);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-booking-grid {
  display: grid;
  gap: 0.5rem;
}

.admin-booking-field {
  display: grid;
  gap: 0.18rem;
}

.admin-booking-field span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.admin-booking-field strong {
  color: #f8fafc;
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.admin-review-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  padding: 0.68rem 0.72rem;
  border: 1px solid rgba(245, 158, 11, 0.62);
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.12);
  color: #fffbeb;
}

.admin-review-alert > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  color: #111827;
  background: #fbbf24;
  font-size: 0.82rem;
  font-weight: 900;
}

.admin-review-alert strong {
  color: #fffbeb;
  font-size: 0.88rem;
  line-height: 1.4;
}

.admin-review-alert.danger {
  border-color: rgba(248, 113, 113, 0.62);
  background: rgba(127, 29, 29, 0.26);
}

.admin-review-alert.danger > span {
  color: #ffffff;
  background: #dc2626;
}

.admin-review-alert.info {
  border-color: rgba(59, 130, 246, 0.48);
  background: rgba(37, 99, 235, 0.12);
}

.admin-review-alert.info > span {
  color: #eff6ff;
  background: #2563eb;
}

.admin-booking-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.admin-booking-actions .button,
.admin-booking-actions .badge {
  min-height: 2.45rem;
  padding: 0.58rem 0.68rem;
  font-size: 0.82rem;
}

.appointment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.appointment-head h3 {
  margin: 0.4rem 0 0;
  font-family: var(--display-font);
  font-size: 1.02rem;
}

.appointment-meta {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  line-height: 1.5;
}

.appointment-meta span,
.reminder-line {
  overflow-wrap: anywhere;
}

.appointment-reminders {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.08);
  color: var(--muted);
}

.appointment-reminders span {
  line-height: 1.45;
}

.email-notification-panel {
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.1);
}

.email-notification-preview {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.email-notification-preview.empty {
  color: var(--faint);
  font-style: italic;
}

.email-notification-history {
  display: grid;
  gap: 0.45rem;
}

.email-notification-history summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.1rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--primary-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.email-notification-history summary::-webkit-details-marker {
  display: none;
}

.email-history-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.email-notification-history[open] .email-history-chevron {
  transform: rotate(180deg);
}

.email-history-list {
  display: grid;
  gap: 0.3rem;
  padding-top: 0.2rem;
}

.email-history-list .reminder-line {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.appointment-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.appointment-actions .button {
  padding: 0.75rem 0.95rem;
}

.appointment-actions.admin-booking-actions .button,
.appointment-actions.admin-booking-actions .badge {
  min-height: 2.45rem;
  padding: 0.58rem 0.68rem;
  font-size: 0.82rem;
}

.client-cleanup-actions,
.admin-cleanup-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.client-cleanup-actions[hidden],
.admin-cleanup-actions[hidden] {
  display: none;
}

.client-cleanup-actions .button,
.admin-cleanup-actions .button {
  min-height: 2.35rem;
  padding: 0.55rem 0.75rem;
}

.button.danger-action {
  border-color: rgba(239, 68, 68, 0.34);
  color: #fecaca;
  background: rgba(239, 68, 68, 0.08);
}

.button.danger-action:hover {
  border-color: rgba(239, 68, 68, 0.58);
  background: rgba(239, 68, 68, 0.14);
}

body.role-client .appointments-board {
  grid-template-columns: 1fr;
}

.client-status-overview {
  display: grid;
  grid-column: 1 / -1;
  gap: 0.85rem;
}

.client-latest-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
}

.client-latest-panel.good {
  border-color: rgba(81, 214, 195, 0.28);
  background: rgba(16, 185, 129, 0.08);
}

.client-latest-panel.pending {
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.09);
}

.client-latest-panel.warn {
  border-color: rgba(255, 123, 139, 0.24);
  background: rgba(255, 123, 139, 0.08);
}

.client-latest-copy {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.client-latest-copy h3 {
  margin: 0;
  font-family: var(--display-font);
  font-size: 1.2rem;
}

.client-latest-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.client-latest-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

.client-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.client-status-summary {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.08);
}

.client-status-summary span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.client-status-summary strong {
  color: var(--text);
  font-family: var(--display-font);
  font-size: 1.45rem;
  line-height: 1;
}

.client-status-summary.good {
  border-color: rgba(81, 214, 195, 0.22);
  background: rgba(16, 185, 129, 0.08);
}

.client-status-summary.pending {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.08);
}

.client-status-summary.muted {
  background: rgba(255, 255, 255, 0.03);
}

.client-flow-note,
.client-history-note {
  display: grid;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(59, 130, 246, 0.22);
  background: rgba(59, 130, 246, 0.08);
}

.client-flow-note strong,
.client-history-note strong {
  color: var(--text);
}

.client-flow-note span,
.client-history-note span {
  color: var(--muted);
  line-height: 1.5;
}

.client-current-records,
.client-closed-history-head {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.client-record-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.client-record-section-head h3,
.client-closed-history-head h3 {
  margin: 0.25rem 0 0;
  font-family: var(--display-font);
  font-size: 1.08rem;
}

.client-current-record-card {
  border-color: rgba(81, 214, 195, 0.2);
  background: rgba(16, 185, 129, 0.06);
}

body.role-doctor .workspace {
  display: none;
}

body.role-doctor .appointments-board {
  grid-template-columns: 1fr;
}

.client-appointment-card {
  gap: 1rem;
  padding: 1.1rem;
}

.client-appointment-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.client-appointment-hero h3 {
  margin: 0.55rem 0 0.25rem;
  font-family: var(--display-font);
  font-size: 1.18rem;
}

.client-appointment-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.client-status-path {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
}

.client-path-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.client-path-step.done {
  color: #bff7df;
  border-color: rgba(81, 214, 195, 0.28);
  background: rgba(16, 185, 129, 0.1);
}

.client-path-step.active {
  color: #ffe0ad;
  border-color: rgba(245, 158, 11, 0.34);
  background: rgba(245, 158, 11, 0.1);
}

.client-path-step.muted {
  opacity: 0.62;
}

.client-guidance {
  display: grid;
  gap: 0.3rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
}

.client-guidance strong {
  color: var(--text);
}

.client-guidance span {
  color: var(--muted);
  line-height: 1.5;
}

.client-guidance.good {
  border-color: rgba(81, 214, 195, 0.28);
  background: rgba(16, 185, 129, 0.08);
}

.client-guidance.pending {
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.09);
}

.client-guidance.warn {
  border-color: rgba(255, 123, 139, 0.24);
  background: rgba(255, 123, 139, 0.08);
}

.client-appointment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.client-appointment-detail {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.08);
}

.client-appointment-detail span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.client-appointment-detail strong {
  color: var(--text);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.client-empty-board {
  justify-items: start;
}

.doctor-appointment-card {
  gap: 1rem;
  padding: 1.1rem;
}

.doctor-appointment-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.doctor-appointment-hero h3 {
  margin: 0.55rem 0 0.25rem;
  font-family: var(--display-font);
  font-size: 1.18rem;
}

.doctor-appointment-hero p {
  margin: 0;
  color: var(--muted);
}

.doctor-appointment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.doctor-appointment-detail,
.appointment-context-card {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.08);
}

.doctor-appointment-detail span,
.appointment-context-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.doctor-appointment-detail strong,
.appointment-context-card strong {
  color: var(--text);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.appointment-context-card.completed-note {
  border-color: rgba(81, 214, 195, 0.2);
  background: rgba(16, 185, 129, 0.08);
}

.doctor-empty-board {
  justify-items: start;
}

.footer-note {
  margin: 1rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

body.admin-control-center .workspace,
body.role-admin .workspace {
  display: none;
}

body.admin-control-center .bottom-panel,
body.role-admin .bottom-panel {
  margin-top: 1.2rem;
}

body.admin-control-center .appointments-board,
body.role-admin .appointments-board {
  grid-template-columns: 1fr;
}

.admin-management-shell {
  margin-top: 1.2rem;
  padding: 1.25rem;
}

.doctor-dashboard-shell {
  margin-top: 1.2rem;
  padding: 1.25rem;
}

.doctor-dashboard-panel,
.profile-form {
  display: grid;
  gap: 1rem;
}

.account-verification-panel {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
}

.account-verification-panel[hidden] {
  display: none;
}

.verification-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.verification-header h3 {
  margin: 0.2rem 0 0;
  font-family: var(--display-font);
  font-size: 1.3rem;
}

.verification-overall {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.verification-overall.verified {
  border-color: rgba(34, 197, 94, 0.42);
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.verification-overall.needed {
  border-color: rgba(250, 176, 5, 0.42);
  color: var(--warning);
  background: rgba(250, 176, 5, 0.1);
}

.verification-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.verification-status-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(8, 16, 26, 0.42);
}

.verification-status-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.verification-status-card strong {
  font-family: var(--display-font);
  color: var(--text);
  font-size: 1.1rem;
}

.verification-status-card small {
  color: var(--muted);
  line-height: 1.45;
}

.verification-status-card.verified {
  border-color: rgba(34, 197, 94, 0.34);
}

.verification-status-card.needed {
  border-color: rgba(250, 176, 5, 0.34);
}

.verification-workflow,
.face-capture-box {
  display: grid;
  gap: 0.85rem;
  padding: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(8, 16, 26, 0.34);
}

.verification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.verification-otp-field {
  max-width: 18rem;
}

.verification-delivery-message {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(37, 99, 235, 0.1);
  color: #dbeafe;
  font-weight: 800;
  line-height: 1.45;
}

.verification-delivery-message.success {
  border-color: rgba(16, 185, 129, 0.32);
  background: rgba(16, 185, 129, 0.1);
  color: #d1fae5;
}

.verification-delivery-message.error {
  border-color: rgba(239, 68, 68, 0.34);
  background: rgba(239, 68, 68, 0.1);
  color: #fee2e2;
}

.verification-demo-code {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.verification-demo-code strong {
  color: var(--warning);
  letter-spacing: 0.12em;
}

.face-preview-frame {
  position: relative;
  width: min(100%, 28rem);
  aspect-ratio: 4 / 3;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 18, 0.76);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.08);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.face-preview-frame[data-detection-state="checking"] {
  border-color: rgba(59, 130, 246, 0.78);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.face-preview-frame[data-detection-state="detected"] {
  border-color: rgba(34, 197, 94, 0.95);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18), 0 0 22px rgba(34, 197, 94, 0.2);
}

.face-preview-frame[data-detection-state="hard"] {
  border-color: rgba(239, 68, 68, 0.95);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.16), 0 0 22px rgba(239, 68, 68, 0.16);
}

.face-capture-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.face-preview-indicator {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  max-width: calc(100% - 1.5rem);
  padding: 0.38rem 0.62rem;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  background: rgba(3, 7, 18, 0.82);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.face-preview-frame[data-detection-state="checking"] .face-preview-indicator {
  border-color: rgba(59, 130, 246, 0.48);
  color: #bfdbfe;
}

.face-preview-frame[data-detection-state="detected"] .face-preview-indicator {
  border-color: rgba(34, 197, 94, 0.54);
  background: rgba(6, 78, 59, 0.88);
  color: #d1fae5;
}

.face-preview-frame[data-detection-state="hard"] .face-preview-indicator {
  border-color: rgba(239, 68, 68, 0.56);
  background: rgba(127, 29, 29, 0.88);
  color: #fee2e2;
}

.payment-manual-qr {
  display: block;
  width: 100%;
  margin: 0 auto;
  border-radius: 0;
  object-fit: contain;
  background: #fff;
}

body.payment-page.payment-manual-mode .payment-qr-panel {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  row-gap: 1.35rem;
}

body.payment-page.payment-manual-mode .payment-copy {
  max-width: 34rem;
  text-align: center;
}

body.payment-page.payment-manual-mode .payment-copy p {
  margin-bottom: 1rem;
}

body.payment-page.payment-manual-mode .payment-wallet-badge {
  margin: 0 auto;
}

body.payment-page.payment-manual-mode .payment-qr-card {
  width: min(100%, 390px);
  justify-self: center;
}

body.payment-page.payment-manual-mode .payment-help-button {
  grid-column: auto;
  justify-self: center;
}

.face-capture-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.doctor-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.doctor-dashboard-stat {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
}

.doctor-dashboard-stat span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.doctor-dashboard-stat strong {
  font-family: var(--display-font);
  font-size: 1.8rem;
  color: var(--text);
}

.doctor-profile-form {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
}

.doctor-profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.admin-panel {
  display: grid;
  gap: 1rem;
}

.admin-two-column {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  gap: 1rem;
  align-items: start;
}

.admin-form,
.admin-record-card,
.admin-stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.admin-form {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.admin-form-head {
  display: grid;
  gap: 0.2rem;
}

.admin-form-head.compact-head {
  margin-bottom: 0;
}

.admin-form-head.compact-head h3 {
  font-size: 1rem;
}

.admin-form-head h3,
.admin-record-card h3 {
  margin: 0;
  color: var(--text);
}

.doctor-login-fields {
  display: grid;
  gap: 0.85rem;
  padding: 0.95rem;
  border: 1px solid rgba(81, 214, 195, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.06);
}

.admin-form-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.admin-form .button {
  width: 100%;
}

.admin-record-grid {
  display: grid;
  gap: 0.8rem;
}

.admin-record-grid.wide {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.admin-record-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
}

.admin-record-card.inactive {
  opacity: 0.64;
}

.admin-record-card p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.admin-record-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
}

.admin-record-list div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.admin-record-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-record-list dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.verification-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.verification-mini-status {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.28rem 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
  font-weight: 800;
}

.verification-mini-status.verified {
  color: #bff7df;
  border-color: rgba(81, 214, 195, 0.22);
  background: rgba(16, 185, 129, 0.08);
}

.verification-mini-status.unverified {
  color: #fbcf89;
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.11);
}

.history-panel-content,
.doctor-history-section {
  display: grid;
  gap: 1rem;
}

.history-filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}

.history-filter-bar .search-field {
  grid-column: span 2;
}

.history-filter-actions {
  display: flex;
  align-items: end;
  justify-content: flex-start;
}

.history-filter-actions .button {
  min-height: 2.85rem;
  width: 100%;
}

.history-custom-range {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.07);
}

.history-custom-group {
  display: grid;
  gap: 0.45rem;
}

.history-custom-group strong {
  color: var(--text);
}

.history-date-selects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.history-date-selects select {
  min-width: 0;
}

.history-custom-range p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.history-record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.history-record-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(8, 18, 32, 0.74);
}

.history-record-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.history-record-head h3 {
  margin: 0.25rem 0 0;
  font-size: 1rem;
}

.history-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.compact-stats {
  margin-bottom: 1rem;
}

.admin-doctor-form {
  position: sticky;
  top: 1rem;
}

.compact-field input {
  min-height: 2.75rem;
}

.compact-check {
  align-items: center;
  min-height: auto;
}

.admin-schedule-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.schedule-card-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.admin-schedule-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.admin-schedule-lines span {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(122, 215, 255, 0.18);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.admin-upcoming-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-upcoming-list li {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
}

.admin-upcoming-list span {
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-stat-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem;
}

.admin-stat-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-stat-card strong {
  font-family: var(--display-font);
  font-size: 1.7rem;
  color: var(--text);
}

.clinic-record-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
  gap: 1rem;
}

.clinic-record-list {
  display: grid;
  gap: 0.65rem;
}

.clinic-record-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
}

.clinic-record-row div {
  display: grid;
  gap: 0.15rem;
}

.clinic-record-row span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.empty-board {
  min-height: 7rem;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 0.4rem;
  color: var(--muted);
}

.system-chatbot {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 50;
  display: grid;
  justify-items: end;
  gap: 0.7rem;
}

.chatbot-toggle {
  min-height: 3.1rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(81, 214, 195, 0.34);
  border-radius: 999px;
  color: #e9fff7;
  background:
    linear-gradient(180deg, rgba(81, 214, 195, 0.18), rgba(37, 99, 235, 0.12)),
    rgba(8, 16, 26, 0.92);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
  font-weight: 900;
  cursor: pointer;
}

.chatbot-panel {
  width: min(380px, calc(100vw - 2rem));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(8, 16, 26, 0.96);
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.chatbot-panel[hidden] {
  display: none;
}

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.chatbot-header strong {
  display: block;
  margin-top: 0.15rem;
  color: var(--text);
  font-size: 1.05rem;
}

.chatbot-close {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.chatbot-messages {
  display: grid;
  align-content: start;
  gap: 0.65rem;
  max-height: 320px;
  min-height: 190px;
  overflow-y: auto;
  padding: 1rem;
}

.chatbot-message {
  max-width: 88%;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.chatbot-message.bot {
  justify-self: start;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.chatbot-message.pending {
  color: var(--muted);
  font-style: italic;
}

.chatbot-message.user {
  justify-self: end;
  color: #e9fff7;
  background: rgba(37, 99, 235, 0.35);
}

.chatbot-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1rem 0.9rem;
}

.chatbot-prompts button {
  min-height: 2rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(122, 215, 255, 0.18);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
  cursor: pointer;
}

.chatbot-prompts button:hover {
  color: var(--text);
  border-color: rgba(81, 214, 195, 0.3);
}

.chatbot-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.chatbot-form input {
  min-width: 0;
  min-height: 2.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  padding: 0 0.75rem;
}

.chatbot-form .button {
  min-height: 2.65rem;
  padding: 0.65rem 0.85rem;
}

@keyframes floatBlob {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(24px, -20px, 0) scale(1.05);
  }
}

@media (max-width: 1180px) {
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    align-items: start;
    padding: 1.25rem 0 2rem;
  }

  .auth-card {
    justify-self: stretch;
  }

  .auth-hero h1 {
    font-size: 3.45rem;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .search-builder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 1rem 0;
  }

  .auth-card {
    justify-self: stretch;
    max-width: none;
  }

  .auth-feature-grid {
    grid-template-columns: 1fr;
  }

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

  .auth-feature {
    min-height: auto;
  }

  .auth-hero h1 {
    font-size: 3rem;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doctor-grid {
    grid-template-columns: 1fr;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .search-builder {
    grid-template-columns: 1fr;
  }

  .ai-match-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-match-card.primary {
    grid-column: 1 / -1;
  }

  .admin-two-column,
  .clinic-record-layout {
    grid-template-columns: 1fr;
  }

  .admin-doctor-form {
    position: static;
  }

  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .client-status-path {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .history-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-filter-bar .search-field {
    grid-column: 1 / -1;
  }

  .doctor-dashboard-grid,
  .doctor-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clinic-record-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100vw - 1rem, 1440px);
    padding-top: 0.5rem;
  }

  .auth-shell {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 0.5rem 1rem;
  }

  .auth-hero,
  .auth-card,
  .auth-banner {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 1rem;
  }

  .auth-hero h1 {
    font-size: 1.65rem;
    line-height: 1.05;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .auth-copy,
  .auth-feature p {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .auth-brand {
    align-items: flex-start;
    max-width: 100%;
    min-width: 0;
  }

  .auth-brand-copy .eyebrow {
    display: block;
    line-height: 1.35;
    letter-spacing: 0.1em;
  }

  .auth-logo {
    width: 3.5rem;
    height: 3.5rem;
  }

  .auth-workflow {
    grid-template-columns: 1fr;
  }

  .auth-copy,
  .auth-feature p,
  .auth-mode-login .auth-note {
    font-size: 1rem;
  }

  .auth-feature h2 {
    font-size: 1.1rem;
  }

  .auth-mode-login .auth-card input:not([type="radio"]),
  .auth-mode-login .auth-card select {
    min-height: 3.4rem;
    padding: 0.95rem 1rem;
    font-size: 1rem;
  }

  .auth-mode-login .auth-submit {
    min-height: 3.5rem;
    font-size: 1rem;
  }

  .auth-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  body.role-client .client-page-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-filter-bar,
  .history-record-grid {
    grid-template-columns: 1fr;
  }

  .history-filter-bar .search-field {
    grid-column: auto;
  }

  .history-custom-range {
    grid-template-columns: 1fr;
  }

  .history-date-selects {
    grid-template-columns: 1fr;
  }

  .account-verification-banner,
  .verification-header {
    flex-direction: column;
    align-items: stretch;
  }

  .client-page-link,
  .admin-page-link {
    min-height: 2.75rem;
    padding: 0.7rem;
    font-size: 0.9rem;
  }

  .admin-management-shell {
    padding: 1rem;
  }

  .ai-match-panel {
    grid-template-columns: 1fr;
  }

  .admin-schedule-editor,
  .admin-stat-grid,
  .verification-status-grid,
  .doctor-dashboard-grid,
  .doctor-profile-grid {
    grid-template-columns: 1fr;
  }

  .verification-actions,
  .face-capture-box .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-record-list div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .system-chatbot {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .chatbot-panel {
    width: calc(100vw - 1.5rem);
  }

  .chatbot-messages {
    max-height: 260px;
  }

  .hero,
  .work-panel,
  .intake-panel,
  .summary-panel,
  .bottom-panel,
  .flow-strip {
    padding: 1rem;
  }

  .hero h1 {
    line-height: 1;
  }

  .mini-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .section-header,
  .slot-head,
  .doctor-top,
  .appointment-head,
  .summary-row,
  .status-row {
    flex-direction: column;
  }

  .slot-head p,
  .board-stats {
    text-align: left;
    justify-content: flex-start;
  }

  .client-appointment-hero {
    flex-direction: column;
  }

  .client-latest-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .client-latest-actions {
    justify-content: stretch;
  }

  .client-latest-actions .status-chip {
    justify-content: center;
  }

  .client-record-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .doctor-appointment-hero {
    flex-direction: column;
  }

  .client-status-grid {
    grid-template-columns: 1fr;
  }

  .client-status-path,
  .client-appointment-grid,
  .doctor-appointment-grid {
    grid-template-columns: 1fr;
  }

  .button-row,
  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
    justify-content: center;
  }

  .payment-grid {
    grid-template-columns: 1fr;
  }

  .payment-mode-grid,
  .wallet-grid {
    grid-template-columns: 1fr;
  }

  .payment-gateway-head {
    flex-direction: column;
  }

  .gateway-status {
    width: 100%;
  }

  .time-slot-grid {
    grid-template-columns: 82px repeat(var(--slot-day-count), minmax(104px, 1fr));
  }

  .stepper {
    grid-template-columns: 1fr;
  }
}

/* Modal Styles */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal[hidden] {
  display: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  z-index: 1001;
  background: var(--panel-strong);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-family: var(--display-font);
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
}

.modal-doctors-list {
  display: grid;
  gap: 1rem;
}

.modal-doctor-item {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-doctor-item:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

.modal-doctor-item h3 {
  margin: 0 0 0.5rem 0;
  font-family: var(--display-font);
  font-size: 1.1rem;
}

.modal-doctor-item p {
  margin: 0.3rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

#doctor-details-content {
  display: grid;
  gap: 1rem;
}

.doctor-detail-row {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.doctor-detail-row strong {
  color: var(--primary);
  display: block;
  margin-bottom: 0.5rem;
}

.doctor-detail-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Compliance Section */
.payment-gateway {
  display: grid;
  gap: 0.95rem;
  margin: 0;
  padding: 1rem;
  border: 1px solid rgba(81, 214, 195, 0.24);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(81, 214, 195, 0.08), rgba(37, 99, 235, 0.05)),
    rgba(255, 255, 255, 0.03);
}

.payment-gateway.is-disabled {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.025);
}

.payment-gateway-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.payment-gateway-head strong {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--display-font);
}

.payment-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.payment-mode-card,
.wallet-card {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(9, 21, 34, 0.9), rgba(13, 28, 44, 0.9)),
    rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.payment-mode-card {
  padding: 0.9rem;
}

.payment-mode-card:hover,
.wallet-card:hover {
  transform: translateY(-1px);
  border-color: rgba(122, 215, 255, 0.32);
}

.payment-mode-card.active,
.wallet-card.active {
  border-color: rgba(59, 130, 246, 0.78);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.18), rgba(10, 24, 40, 0.92)),
    rgba(37, 99, 235, 0.08);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.26) inset;
}

.payment-icon {
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  flex: 0 0 auto;
  border-radius: 12px;
  color: #d7f2ff;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(122, 215, 255, 0.2);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.payment-mode-card strong,
.wallet-card strong {
  display: block;
  color: var(--text);
  font-size: 0.94rem;
}

.payment-mode-card small,
.wallet-card small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.78rem;
}

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.wallet-grid[hidden] {
  display: none;
}

.wallet-card {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: start;
  min-height: 8.2rem;
  padding: 0.85rem;
}

.wallet-card::after {
  content: "";
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 2px solid rgba(160, 174, 192, 0.55);
}

.wallet-card.active::after {
  border-color: rgba(122, 215, 255, 0.95);
  background: radial-gradient(circle, rgba(122, 215, 255, 0.95) 0 38%, transparent 42%);
}

.wallet-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  margin-bottom: 0.15rem;
  padding: 0.4rem 0.65rem;
  border-radius: 10px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.gcash-logo {
  background: linear-gradient(135deg, #1363ff, #34a8ff);
}

.maya-logo {
  color: #d9ffe8;
  background: linear-gradient(135deg, #111827, #00a86b);
  border: 1px solid rgba(70, 255, 172, 0.35);
}

.card-logo {
  color: #eaf3ff;
  background: linear-gradient(135deg, #172554, #0f172a);
  border: 1px solid rgba(122, 215, 255, 0.25);
  letter-spacing: 0.08em;
}

.gateway-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(247, 178, 103, 0.24);
  color: var(--warning);
  background: rgba(247, 178, 103, 0.1);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gateway-status.good {
  color: var(--success);
  border-color: rgba(81, 214, 195, 0.24);
  background: rgba(81, 214, 195, 0.08);
}

.gateway-status.muted {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.payment-field-full {
  grid-column: 1 / -1;
}

.gateway-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

body.payment-page {
  min-height: 100vh;
  color: #243957;
  background: #000;
}

body.payment-page::before {
  display: none;
}

.payment-shell {
  width: min(1350px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1.8rem 0;
}

.payment-brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.7rem;
  color: #8ea0c4;
}

.payment-brand-lockup {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.payment-brand-lockup strong {
  color: #1178ff;
  font-size: 2rem;
  line-height: 1;
}

.payment-brand-lockup span,
.payment-language {
  font-size: 1rem;
}

.payment-language {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #1178ff;
}

.payment-checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(340px, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.payment-qr-panel,
.payment-summary-panel {
  min-height: 438px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.payment-qr-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  column-gap: 2rem;
  padding: 2rem;
}

.payment-copy h1,
.payment-summary-panel h2 {
  margin: 0;
  color: #344e73;
  font-family: var(--display-font);
  font-size: 1.45rem;
}

.payment-copy p {
  margin: 0.8rem 0 2rem;
  color: #8393b6;
  line-height: 1.55;
}

.payment-wallet-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 156px;
  min-height: 70px;
  padding: 0.9rem 1.2rem;
  border: 1px solid #edf0f7;
  border-radius: 8px;
  color: #095eea;
  background: #fff;
  font-weight: 900;
  font-size: 1.15rem;
}

.payment-qr-card {
  align-self: start;
  overflow: hidden;
  border: 1px solid #edf0f7;
  border-radius: 10px 10px 28px 28px;
  background: #f8f9fc;
  text-align: center;
}

.payment-qr-card canvas {
  display: block;
  width: 100%;
  height: auto;
  padding: 1.45rem;
  background: #fff;
}

.payment-qr-card p {
  margin: 0;
  padding: 1rem 0.9rem;
  border-top: 1px solid #edf0f7;
  color: #8a99bb;
  line-height: 1.35;
}

.payment-help-button {
  grid-column: 2;
  justify-self: center;
  align-self: end;
  appearance: none;
  border: 0;
  background: transparent;
  color: #8a99bb;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.payment-summary-panel {
  padding: 2rem 1.9rem;
}

.payment-summary-list {
  display: grid;
  gap: 1.55rem;
  margin-top: 1.85rem;
}

.payment-summary-list div,
.payment-total-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: baseline;
}

.payment-summary-list span,
.payment-total-row span,
.payment-expiry span {
  color: #8a99bb;
}

.payment-summary-list strong {
  color: #435b80;
  font-size: 1.02rem;
  font-weight: 500;
  text-align: right;
}

.payment-total-row {
  margin-top: 1.7rem;
  padding-top: 1.35rem;
  border-top: 1px solid #edf0f7;
}

.payment-total-row strong {
  color: #051a38;
  font-size: 1.85rem;
  line-height: 1;
}

.payment-expiry {
  display: grid;
  justify-items: end;
  gap: 0.7rem;
  margin-top: 1.8rem;
}

.payment-expiry strong {
  color: #ff671f;
  font-size: 1.05rem;
}

.payment-expiry strong.is-expired {
  color: #ef4444;
}

.payment-confirm-box {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.payment-confirm-button {
  width: 100%;
  justify-content: center;
}

.payment-confirm-button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.payment-confirm-box p {
  margin: 0;
  color: #8a99bb;
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: right;
}

.payment-confirm-box p.is-success {
  color: #047857;
  font-weight: 800;
}

.payment-confirm-box p.is-error {
  color: #dc2626;
  font-weight: 800;
}

@media (max-width: 920px) {
  .payment-checkout-layout {
    grid-template-columns: 1fr;
  }

  .payment-qr-panel,
  .payment-summary-panel {
    min-height: auto;
  }
}

@media (max-width: 680px) {
  .payment-shell {
    width: min(100% - 1rem, 540px);
    padding: 1rem 0;
  }

  .payment-brand-bar,
  .payment-brand-lockup {
    align-items: flex-start;
  }

  .payment-brand-bar {
    flex-direction: column;
    margin-bottom: 1rem;
  }

  .payment-brand-lockup {
    flex-direction: column;
    gap: 0.45rem;
  }

  .payment-qr-panel {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.25rem;
  }

  .payment-help-button {
    grid-column: auto;
  }

  .payment-summary-panel {
    padding: 1.25rem;
  }

  .payment-summary-list div,
  .payment-total-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .payment-summary-list strong,
  .payment-expiry {
    justify-items: start;
    text-align: left;
  }
}

.compliance-section {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
}

/* Payment checkout uses the same calm surfaces as the application shell. */
body.payment-page {
  min-height: 100vh;
  color: var(--text);
  background: var(--bg-0);
}

body.payment-page::before { display: none; }
.payment-shell { width: min(1040px, calc(100vw - 2rem)); padding: 2rem 0 3rem; }
.payment-brand-bar { min-height: 3.5rem; margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.payment-brand-lockup { gap: 0.65rem; }
.payment-brand-mark { flex: 0 0 auto; width: 2.1rem; height: 2.1rem; border-radius: 7px; }
.payment-brand-lockup strong { color: var(--text); font-size: 1rem; }
.payment-brand-lockup span, .payment-language { color: var(--muted); }
.payment-language { gap: 0.4rem; font-size: 0.86rem; }
.payment-language span:first-child { display: inline-grid; place-items: center; min-width: 1.7rem; min-height: 1.35rem; color: var(--primary); background: #e7f3f3; border: 1px solid #c5e3e3; border-radius: 4px; font-size: 0.7rem; font-weight: 800; }
.payment-checkout-layout { gap: 1.25rem; }
.payment-qr-panel, .payment-summary-panel { color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.payment-qr-panel { padding: 2rem; }
.payment-summary-panel { padding: 1.5rem; }
.payment-copy h1 { color: var(--text); font-size: clamp(1.8rem, 4vw, 2.55rem); letter-spacing: -0.035em; }
.payment-copy p { color: var(--muted); line-height: 1.6; }
.payment-wallet-badge { display: inline-flex; padding: 0.35rem 0.55rem; color: var(--primary); background: #e7f3f3; border: 1px solid #c5e3e3; border-radius: 5px; font-size: 0.78rem; font-weight: 700; }
.payment-qr-card { padding: 1.25rem; background: #f8fafb; border: 1px solid var(--border); border-radius: var(--radius-md); }
.payment-qr-card canvas { border: 8px solid #fff; box-shadow: 0 2px 8px rgba(27,42,51,.08); }
.payment-qr-card p { color: var(--muted); }
.payment-help-button { color: var(--primary); background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.payment-help-button:hover { background: #f0f8f8; border-color: var(--primary); }
.payment-summary-panel h2 { color: var(--text); font-size: 1.3rem; }
.payment-summary-list { border-top-color: var(--border); }
.payment-summary-list div { border-bottom-color: var(--border); }
.payment-summary-list span, .payment-expiry span, .payment-total-row span { color: var(--muted); }
.payment-summary-list strong, .payment-total-row strong, .payment-expiry strong { color: var(--text); }
.payment-total-row { border-top-color: var(--border); border-bottom-color: var(--border); }
.payment-expiry { color: var(--muted); background: #fff8e8; border-color: #efd08b; border-radius: var(--radius-md); }
.payment-expiry strong { color: var(--warning); }
.payment-confirm-box { border-top-color: var(--border); }
.payment-confirm-button { width: 100%; }
.payment-confirm-box p { color: var(--muted); text-align: left; }
.payment-confirm-box p.is-success { color: var(--success); }
.payment-confirm-box p.is-error { color: var(--danger); }

@media (max-width: 680px) {
  .payment-shell { width: min(100% - 1rem, 540px); padding: 1rem 0 2rem; }
  .payment-brand-bar { align-items: flex-start; gap: 0.8rem; }
  .payment-brand-lockup { flex-direction: column; align-items: flex-start; }
  .payment-qr-panel, .payment-summary-panel { padding: 1.1rem; }
}

/* ========================================================================== *
   Civic clinic UI refresh
   Presentation-only layer. Existing selectors, states, and behaviors remain
   unchanged so the application shell and its JavaScript can keep working.
   ========================================================================== */
:root {
  --bg-0: #f5f7f9;
  --bg-1: #ffffff;
  --bg-2: #edf1f4;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --border: #d9e1e7;
  --border-strong: #b9c7d1;
  --text: #1b2a33;
  --muted: #61717c;
  --faint: #87959e;
  --primary: #176b73;
  --primary-2: #21858a;
  --warning: #a66500;
  --danger: #b42318;
  --success: #147a55;
  --shadow: 0 8px 24px rgba(27, 42, 51, 0.07);
  --radius-xl: 18px;
  --radius-lg: 12px;
  --radius-md: 9px;
  --radius-sm: 7px;
  --body-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html { background: var(--bg-0); }

body,
body.login-page {
  color: var(--text);
  background: var(--bg-0);
  font-family: var(--body-font);
  line-height: 1.5;
}

body::before,
.backdrop,
.auth-backdrop { display: none; }

h1, h2, h3, h4, h5, h6 { color: var(--text); letter-spacing: -0.025em; }
p { color: var(--muted); }

a { color: var(--primary); }

.card,
.auth-hero,
.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.card:hover { transform: none; border-color: var(--border); }

.eyebrow,
.section-kicker,
.mini-label {
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
}

.button {
  min-height: 2.65rem;
  padding: 0.68rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  box-shadow: none;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.button:hover { transform: none; box-shadow: none; }
.button-primary { color: #fff; background: var(--primary); box-shadow: none; }
.button-primary:hover { background: #115a61; box-shadow: 0 4px 10px rgba(23, 107, 115, 0.18); }
.button-ghost { color: var(--text); background: #fff; border-color: var(--border-strong); }
.button-ghost:hover { color: var(--primary); background: #f4f8f9; border-color: var(--primary); }
.button-danger,
.button.danger { color: #fff; background: var(--danger); }

.button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(33, 133, 138, 0.28);
  outline-offset: 2px;
}

input,
textarea,
select {
  min-height: 2.75rem;
  padding: 0.68rem 0.78rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

textarea { min-height: 6rem; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(33, 133, 138, 0.12); }
.field { gap: 0.38rem; }
.field > span { color: var(--text); font-size: 0.86rem; font-weight: 650; }

/* Public application shell */
.app-shell {
  width: min(1180px, calc(100vw - 2rem));
  padding: 2rem 0 3rem;
}

.hero {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 2.5rem;
  padding: 2.25rem;
  margin-bottom: 1.25rem;
  background: #fff;
}

.hero h1,
.auth-hero h1 {
  max-width: 14ch;
  margin: 0.65rem 0 1rem;
  color: var(--text);
  font-size: clamp(2.25rem, 5vw, 3.65rem);
  line-height: 1.05;
}

.hero-text,
.auth-copy { max-width: 58ch; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.logo-section { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.logo-icon { width: 2.25rem; height: 2.25rem; border-radius: 8px; background: url("assets/app-icon.svg") center / cover no-repeat; font-size: 0; }
.brand-name { color: var(--text); font-size: 1rem; }

.hero-status-card,
.mini-metric,
.flow-strip,
.search-choice,
.slot-panel,
.intake-section,
.triage-card,
.info-card,
.doctor-card,
.appointment-card,
.client-appointment-card,
.doctor-appointment-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.hero-status-card { min-height: 9rem; padding: 1.1rem; }
.hero-status-card strong { color: var(--text); font-size: 1.2rem; }
.hero-status-card span, .mini-metric span { color: var(--muted); }
.mini-metric { padding: 0.9rem; }
.mini-metric strong { color: var(--text); font-size: 1.35rem; }
.hero-actions { margin-top: 1.2rem; }

.flow-strip { padding: 1.25rem; margin-bottom: 1.25rem; }
.section-header { margin-bottom: 1.1rem; }
.section-header h2 { margin-top: 0.25rem; font-size: clamp(1.35rem, 2vw, 1.75rem); }
.section-support { color: var(--muted); }

.client-page-nav,
.admin-page-nav {
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 4px 14px rgba(27, 42, 51, 0.05);
  backdrop-filter: none;
}

.client-page-link,
.admin-page-link {
  min-height: 2.7rem;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.client-page-link:hover,
.admin-page-link:hover { color: var(--text); background: #f2f6f7; border-color: transparent; transform: none; }
.client-page-link.active,
.admin-page-link.active { color: var(--primary); background: #e7f3f3; border-color: #c5e3e3; }
body.role-client .client-page-link::before { width: 1.55rem; height: 1.55rem; color: var(--muted); background: #f1f4f5; border-color: var(--border); border-radius: 50%; }
body.role-client .client-page-link.active::before { color: #fff; background: var(--primary); border-color: var(--primary); }

.account-verification-banner { border-radius: var(--radius-md); background: #fff8e8; border-color: #efd08b; box-shadow: none; }
.account-verification-banner strong { color: var(--text); }
.account-verification-banner span { color: #72530e; }

.workspace { gap: 1.25rem; }
.work-panel,
.intake-panel,
.summary-panel,
.profile-panel,
.bottom-panel,
.admin-management-shell,
.doctor-dashboard-shell {
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

body.app-authenticated .work-panel,
body.app-authenticated .intake-panel,
body.app-authenticated .summary-panel,
body.app-authenticated .profile-panel,
body.app-authenticated .bottom-panel,
body.app-authenticated .admin-management-shell,
body.app-authenticated .doctor-dashboard-shell { padding: 1.5rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }

.search-builder { gap: 1rem; }
.search-choice { padding: 1rem; }
.search-choice-head strong { color: var(--text); font-size: 1rem; }
.chip-row { gap: 0.5rem; }
.chip { padding: 0.48rem 0.75rem; color: var(--muted); background: #fff; border: 1px solid var(--border-strong); border-radius: 999px; }
.chip:hover { color: var(--primary); background: #f1f7f7; transform: none; }
.chip.active { color: #fff; background: var(--primary); border-color: var(--primary); }

.doctor-card { padding: 1.1rem; }
.doctor-card:hover { transform: none; border-color: var(--primary-2); background: #fbfdfd; }
.doctor-card.selected { background: #f0f8f8; border-color: var(--primary); box-shadow: 0 0 0 1px rgba(23, 107, 115, 0.08) inset; }
.doctor-card h3, .doctor-card p, .doctor-meta { color: var(--text); }
.doctor-card p, .doctor-meta { color: var(--muted); }
.doctor-specialty, .doctor-badge, .status-chip, .appointment-id, .badge { border-radius: 5px; text-transform: none; letter-spacing: 0; }
.doctor-specialty { color: var(--primary); background: #e7f3f3; border-color: #c5e3e3; }
.doctor-badge { color: var(--success); background: #eaf7f1; border-color: #bfe4d2; }
.doctor-action { padding: 0.6rem 0.8rem; color: var(--primary); background: #fff; border: 1px solid var(--border-strong); border-radius: 6px; }
.doctor-action:hover { background: #eef7f7; border-color: var(--primary); }

.slot-panel, .intake-section, .triage-card, .info-card { padding: 1.1rem; }
.slot-day-card { padding: 0.85rem; background: #f8fafb; border: 1px solid var(--border); border-radius: var(--radius-md); }
.slot-day-card.selected { border-color: var(--primary); box-shadow: 0 0 0 1px rgba(23, 107, 115, 0.08) inset; }
.slot-day-count, .payment-status-pill { border-radius: 5px; text-transform: none; letter-spacing: 0; }
.slot-day-count.open { color: var(--success); background: #eaf7f1; border-color: #bfe4d2; }
.slot-chip { min-height: 3.5rem; color: var(--text); background: #fff; border-color: var(--border); border-radius: 6px; }
.slot-chip.available { background: #f0f8f8; border-color: #bddddd; }
.slot-chip.available:hover { background: #e7f3f3; border-color: var(--primary); transform: none; }
.slot-chip.selected { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: none; }
.slot-chip.selected span { color: #d9f1f1; }
.slot-chip.booked { background: #fdf1f1; border-color: #efc1c1; }

.intake-section-list { gap: 1.25rem; }
.intake-section { gap: 1rem; }
.intake-section-head { border-bottom-color: var(--border); }
.payment-gateway { padding: 1rem; background: #f8fafb; border: 1px solid var(--border); border-radius: var(--radius-md); }
.payment-mode-card, .wallet-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: none; }
.payment-mode-card:hover, .wallet-card:hover, .payment-mode-card.active, .wallet-card.active { border-color: var(--primary); background: #f0f8f8; box-shadow: none; }
.triage-card { background: #fffaf0; border-color: #efd08b; }
.radio-pill { padding: 0.75rem 0.85rem; background: #fff; border-color: var(--border); border-radius: 7px; }
.radio-pill:has(input:checked) { border-color: var(--primary); background: #f0f8f8; }
.compliance-item { padding: 0.85rem; background: #f8fafb; border: 1px solid var(--border); border-radius: var(--radius-md); }
.checkbox-custom { border-color: var(--border-strong); border-radius: 4px; background: #fff; }
.checkbox-label input:checked + .checkbox-custom { background: var(--primary); border-color: var(--primary); box-shadow: none; }
.checkbox-text strong { color: var(--text); }
.validation-message.error { color: var(--danger); }
.validation-message.success { color: var(--success); }
.validation-message.info { color: var(--primary); }

.summary-row, .status-row { padding: 0.8rem 0; border-radius: 0; border-top: 1px solid var(--border); background: transparent; }
.status-row strong { color: var(--success); }
.status-row strong.pending { color: var(--warning); }
.board-stats span, .admin-stat-chip { border-radius: 6px; color: var(--muted); background: #f5f8f9; border-color: var(--border); }
.admin-stat-chip:hover, .admin-stat-chip.active { color: var(--primary); background: #e7f3f3; border-color: #acd5d5; transform: none; }

/* Authenticated header reads like an application header, not a floating banner. */
.auth-banner {
  position: sticky;
  top: 0;
  width: 100%;
  margin: 0;
  padding: 0.75rem max(1rem, calc((100vw - 1180px) / 2));
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: #fff;
  box-shadow: 0 2px 10px rgba(27, 42, 51, 0.05);
  backdrop-filter: none;
}
.auth-banner-copy strong { color: var(--text); }
.auth-banner-copy span { color: var(--muted); }
.auth-current-page { color: var(--primary) !important; background: #e7f3f3 !important; border-color: #c5e3e3 !important; }
.auth-role-badge { border-radius: 5px; color: var(--primary) !important; background: #e7f3f3 !important; border-color: #c5e3e3 !important; text-transform: capitalize; letter-spacing: 0; }
.auth-logout { min-height: 2.3rem; padding: 0.45rem 0.75rem; }

/* Login and registration */
.auth-shell { width: min(1060px, calc(100vw - 2rem)); grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr); gap: 1.75rem; padding: 3rem 0; }
.auth-hero, .auth-card { padding: 2rem; }
.auth-brand { gap: 0.75rem; }
.auth-logo { width: 3.25rem; height: 3.25rem; border-radius: 10px; box-shadow: none; }
.auth-brand-copy strong { color: var(--text); }
.auth-hero h1 { max-width: 12ch; margin-top: 2.1rem; font-size: clamp(2.35rem, 5vw, 3.75rem); }
.auth-workflow { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 1.5rem; }
.auth-workflow span { min-height: 2.3rem; color: var(--primary); background: #f0f8f8; border-color: #c5e3e3; border-radius: 6px; font-size: 0.82rem; font-weight: 650; }
.auth-feature-grid { margin-top: 1.5rem; }
.auth-feature { min-height: 9rem; padding: 1rem; background: #f8fafb; border-color: var(--border); border-radius: var(--radius-md); }
.auth-feature-tag { padding: 0; color: var(--primary); background: transparent; border: 0; border-radius: 0; text-transform: none; letter-spacing: 0; font-size: 0.8rem; font-weight: 700; }
.auth-feature h2 { color: var(--text); }
.auth-alert { padding: 0.75rem 0.85rem; color: var(--danger); background: #fdf1f1; border-color: #efc1c1; border-radius: var(--radius-md); }
.auth-alert-success { color: var(--success); background: #eaf7f1; border-color: #bfe4d2; }
.auth-role-options { gap: 0.55rem; }
.auth-role-option { min-height: 2.75rem; color: var(--muted); background: #fff; border-color: var(--border-strong); border-radius: 6px; font-size: 0.86rem; font-weight: 650; }
.auth-role-option:hover { color: var(--text); background: #f8fafb; border-color: var(--primary-2); transform: none; }
.auth-role-input:checked + .auth-role-option { color: var(--primary); background: #e7f3f3; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(23, 107, 115, 0.1); }
.auth-role-icon { color: var(--primary); background: #d9eeee; }
.auth-role-input:checked + .auth-role-option .auth-role-icon { color: #fff; background: var(--primary); }
.auth-note { padding: 0.85rem 1rem; color: var(--muted); background: #f8fafb; border-color: var(--border); border-radius: var(--radius-md); }
.auth-switch { border-top-color: var(--border); }
.auth-switch a { color: var(--primary); }

/* Tables, management panels, reports, and generated admin views. */
table { width: 100%; border-collapse: collapse; color: var(--text); background: #fff; }
th { padding: 0.75rem 0.8rem; color: var(--muted); background: #f5f8f9; border-bottom: 1px solid var(--border); font-size: 0.78rem; font-weight: 700; text-align: left; }
td { padding: 0.8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: #fbfdfd; }
.admin-table, .history-table, .records-table { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.admin-table table, .history-table table, .records-table table { min-width: 680px; }
.admin-panel, .doctor-dashboard-panel, .appointments-board, .profile-form, .account-verification-panel { gap: 1rem; }
.admin-section, .admin-card, .doctor-section, .report-card, .settings-card { background: #fff; border-color: var(--border); border-radius: var(--radius-md); box-shadow: none; }
.empty-state { color: var(--muted); }
.status-chip { padding: 0.3rem 0.55rem; font-weight: 700; }
.status-chip.success, .status-chip.approved, .status-chip.completed, .status-chip.active { color: var(--success); background: #eaf7f1; border-color: #bfe4d2; }
.status-chip.warning, .status-chip.pending { color: var(--warning); background: #fff7e6; border-color: #efd08b; }
.status-chip.danger, .status-chip.rejected, .status-chip.cancelled { color: var(--danger); background: #fdf1f1; border-color: #efc1c1; }

.system-footer { margin-top: 2rem; padding: 1.5rem 0 0.5rem; background: transparent; border-top-color: var(--border); }
.system-footer p { color: var(--muted); }
.system-footer strong { color: var(--primary); }

@media (max-width: 860px) {
  .hero, .auth-shell { grid-template-columns: 1fr; }
  .hero h1, .auth-hero h1 { max-width: 16ch; }
  .auth-card { max-width: 620px; justify-self: stretch; }
  .auth-feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .app-shell, .auth-shell { width: min(100% - 1rem, 1180px); padding-top: 1rem; }
  .hero, .auth-hero, .auth-card, body.app-authenticated .work-panel, body.app-authenticated .intake-panel, body.app-authenticated .summary-panel, body.app-authenticated .profile-panel, body.app-authenticated .bottom-panel, body.app-authenticated .admin-management-shell, body.app-authenticated .doctor-dashboard-shell { padding: 1.1rem; }
  .hero h1, .auth-hero h1 { font-size: 2.25rem; }
  .auth-workflow, .auth-feature-grid { grid-template-columns: 1fr 1fr; }
  .search-builder, .doctor-grid, .intake-field-grid { grid-template-columns: 1fr; }
  .slot-days-grid { grid-template-columns: 1fr; }
  .button-row { align-items: stretch; }
  .button-row .button { flex: 1 1 11rem; }
  .auth-banner { padding: 0.65rem 0.75rem; }
  .auth-banner-copy { flex-wrap: wrap; }
  .auth-banner-actions { width: 100%; justify-content: space-between; }
  .auth-banner-actions .auth-logout { margin-left: auto; }
  .section-header { flex-direction: column; }
  .slot-head p { max-width: none; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

.compliance-item {
  display: flex;
  align-items: flex-start;
  padding: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
  flex: 1;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  display: none;
}

.checkbox-custom {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border-strong);
  border-radius: 6px;
  background: rgba(26, 32, 44, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  margin-top: 0.15rem;
}

.checkbox-label input:checked + .checkbox-custom {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.3);
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: "âœ“";
  color: white;
  font-weight: bold;
  font-size: 0.9rem;
}

.checkbox-label input:focus + .checkbox-custom {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.checkbox-text {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.checkbox-text strong {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}

.checkbox-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Professional Footer */
.system-footer {
  margin-top: 3rem;
  padding: 2rem 0 1rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  text-align: center;
}

.footer-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2rem;
}

.system-footer p {
  margin: 0.5rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.system-footer strong {
  color: var(--primary);
  font-weight: 600;
}

.footer-note-small {
  font-size: 0.85rem;
  color: var(--faint);
}

/* Client task focus */
body.role-client .app-shell {
  width: min(1120px, calc(100vw - 2rem));
  padding-top: 0;
}

body.role-client .hero {
  display: none;
}

body.role-client .client-page-nav {
  position: sticky;
  top: 5.25rem;
  z-index: 18;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
}

body.role-client .client-page-link {
  justify-content: flex-start;
  gap: 0.65rem;
  text-align: left;
  white-space: nowrap;
}

body.role-client .client-page-link::before {
  content: attr(data-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid rgba(122, 215, 255, 0.22);
  border-radius: 999px;
  background: rgba(122, 215, 255, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

body.role-client .client-page-link.active::before {
  border-color: rgba(81, 214, 195, 0.46);
  background: rgba(81, 214, 195, 0.16);
  color: #e9fff7;
}

body.role-client [data-client-page] {
  display: none;
}

body.role-client:not([data-client-page]) [data-client-page="book"],
body.role-client[data-client-page="book"] [data-client-page="book"],
body.role-client[data-client-page="intake"] [data-client-page="intake"],
body.role-client[data-client-page="review"] [data-client-page="review"],
body.role-client[data-client-page="appointments"] [data-client-page="appointments"],
body.role-client[data-client-page="history"] [data-client-page="history"],
body.role-client[data-client-page="profile"] [data-client-page="profile"] {
  display: block;
}

body.role-client [data-client-page][hidden] {
  display: none !important;
}

body.role-client .workspace {
  display: block;
  margin-bottom: 1rem;
}

body.role-client .work-panel,
body.role-client .intake-panel,
body.role-client .summary-panel,
body.role-client .profile-panel,
body.role-client .bottom-panel {
  width: 100%;
  max-width: none;
}

body.role-client .account-verification-banner {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

@media (max-width: 680px) {
  body.role-client .app-shell {
    width: min(100vw - 1rem, 1120px);
  }

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

  body.role-client .client-page-nav {
    position: static;
    display: flex;
    overflow-x: auto;
    padding: 0.35rem;
  }

  body.role-client .client-page-link {
    min-width: 9.5rem;
    flex: 0 0 auto;
  }
}

/* Compact authenticated header */
body.app-authenticated .auth-banner {
  top: 0.5rem;
  width: min(1120px, calc(100vw - 2rem));
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
}

body.app-authenticated .auth-banner-copy {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

body.app-authenticated .auth-banner-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-authenticated .auth-current-page {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.32rem 0.65rem;
  border: 1px solid rgba(122, 215, 255, 0.18);
  border-radius: 999px;
  background: rgba(122, 215, 255, 0.07);
  color: #d7f0ff;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

body.app-authenticated .auth-banner-actions {
  gap: 0.55rem;
}

body.app-authenticated .auth-role-badge {
  min-height: 1.8rem;
  padding: 0.32rem 0.65rem;
}

body.app-authenticated .auth-logout {
  min-height: 1.8rem;
  padding: 0.48rem 0.75rem;
}

body.app-authenticated .app-shell {
  padding-top: 0;
}

body.app-authenticated .hero,
body.app-authenticated .flow-strip {
  display: none;
}

body.role-client .client-page-nav {
  top: 4rem;
}

@media (max-width: 680px) {
  body.app-authenticated .auth-banner {
    width: min(100vw - 1rem, 1120px);
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.55rem;
  }

  body.app-authenticated .auth-banner-copy {
    flex: 1 1 13rem;
    gap: 0.5rem;
  }

  body.app-authenticated .auth-current-page {
    max-width: 100%;
  }

  body.app-authenticated .auth-banner-actions {
    flex: 0 0 auto;
    margin-left: auto;
  }
}

/* ========================================================================== *
   100% browser-zoom density pass
   Balanced scale for dashboards, forms, and management screens. This layer
   changes presentation only; existing markup, states, and behaviors remain.
   ========================================================================== */

.app-shell {
  width: min(1280px, calc(100vw - 3rem));
  padding: 1.25rem 0 2rem;
}

.auth-shell {
  width: min(1280px, calc(100vw - 3rem));
  gap: 1rem;
  padding: 1rem 0;
}

.auth-hero,
.auth-card {
  padding: 1.25rem;
}

.auth-hero h1,
.hero h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.08;
}

.hero {
  gap: 1.5rem;
  padding: 1.5rem;
}

.hero-status-card {
  min-height: 7.5rem;
  padding: 0.9rem;
}

body.payment-page .payment-shell {
  width: min(1120px, calc(100vw - 3rem));
  padding: 1.25rem 0 2rem;
}

body.payment-page .payment-qr-panel,
body.payment-page .payment-summary-panel {
  padding: 1.25rem;
}

body.app-authenticated .app-shell {
  width: min(1320px, calc(100vw - 3rem));
  padding: 1rem 0 2rem;
}

body.app-authenticated .auth-banner {
  width: min(1320px, calc(100vw - 3rem));
  min-height: 3.5rem;
  padding: 0.65rem max(1rem, calc((100vw - 1280px) / 2));
}

body.app-authenticated .client-page-nav,
body.app-authenticated .admin-page-nav {
  margin-bottom: 1rem;
}

body.app-authenticated .flow-strip {
  margin-bottom: 1rem;
  padding: 1rem;
}

body.app-authenticated .workspace {
  gap: 1rem;
  margin-bottom: 1.25rem;
}

body.app-authenticated .work-panel,
body.app-authenticated .intake-panel,
body.app-authenticated .summary-panel,
body.app-authenticated .profile-panel,
body.app-authenticated .bottom-panel,
body.app-authenticated .admin-management-shell,
body.app-authenticated .doctor-dashboard-shell {
  padding: 1.25rem;
}

body.app-authenticated .section-header {
  margin-bottom: 1rem;
}

body.app-authenticated .section-header h2,
body.app-authenticated #admin-page-title {
  font-size: clamp(1.35rem, 1.8vw, 1.8rem);
  line-height: 1.18;
}

body.app-authenticated .section-support {
  font-size: 0.92rem;
  line-height: 1.45;
}

body.app-authenticated .admin-panel,
body.app-authenticated .doctor-dashboard-panel,
body.app-authenticated .appointments-board,
body.app-authenticated .profile-form,
body.app-authenticated .account-verification-panel {
  gap: 0.85rem;
}

body.app-authenticated .history-record-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}

body.app-authenticated .history-record-card,
body.app-authenticated .appointment-card,
body.app-authenticated .client-appointment-card,
body.app-authenticated .doctor-appointment-card {
  gap: 0.75rem;
  padding: 1rem;
}

body.app-authenticated .history-filter-bar {
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

body.app-authenticated .compact-stats,
body.app-authenticated .admin-stat-grid {
  gap: 0.7rem;
}

body.app-authenticated .admin-stat-card,
body.app-authenticated .admin-record-card,
body.app-authenticated .admin-form {
  padding: 0.9rem;
}

body.app-authenticated .admin-record-grid {
  gap: 0.75rem;
}

body.app-authenticated .intake-section,
body.app-authenticated .payment-gateway,
body.app-authenticated .triage-card,
body.app-authenticated .info-card {
  padding: 0.95rem;
}

body.app-authenticated input,
body.app-authenticated textarea,
body.app-authenticated select {
  min-height: 2.6rem;
  padding: 0.58rem 0.7rem;
}

body.app-authenticated .button {
  min-height: 2.5rem;
  padding: 0.58rem 0.85rem;
}

body.app-authenticated .client-page-link,
body.app-authenticated .admin-page-link {
  min-height: 2.45rem;
  padding: 0.5rem 0.68rem;
}

@media (max-width: 1020px) {
  .app-shell,
  .auth-shell,
  body.app-authenticated .app-shell,
  body.app-authenticated .auth-banner,
  body.payment-page .payment-shell {
    width: min(100% - 2rem, 1180px);
  }

  body.app-authenticated .history-record-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .app-shell,
  .auth-shell,
  body.app-authenticated .app-shell,
  body.app-authenticated .auth-banner,
  body.payment-page .payment-shell {
    width: calc(100% - 2rem);
  }

  .app-shell,
  body.app-authenticated .app-shell {
    padding: 0.85rem 0 1.5rem;
  }

  .auth-shell {
    padding: 0.85rem 0;
  }

  .auth-hero,
  .auth-card,
  .hero,
  body.app-authenticated .work-panel,
  body.app-authenticated .intake-panel,
  body.app-authenticated .summary-panel,
  body.app-authenticated .profile-panel,
  body.app-authenticated .bottom-panel,
  body.app-authenticated .admin-management-shell,
  body.app-authenticated .doctor-dashboard-shell {
    padding: 1rem;
  }

  .auth-hero h1,
  .hero h1 {
    font-size: 2rem;
  }

  body.app-authenticated .history-record-grid {
    grid-template-columns: 1fr;
  }

  body.app-authenticated .history-record-card,
  body.app-authenticated .appointment-card,
  body.app-authenticated .client-appointment-card,
  body.app-authenticated .doctor-appointment-card {
    padding: 0.9rem;
  }
}

/* Sticky client page navigation */
body.role-client .client-page-nav {
  position: sticky;
  top: 4rem;
  z-index: 19;
  overflow-x: auto;
  background: rgba(8, 16, 26, 0.88);
}

body.role-client .client-page-nav::-webkit-scrollbar {
  height: 6px;
}

body.role-client .client-page-nav::-webkit-scrollbar-thumb {
  background: rgba(122, 215, 255, 0.24);
  border-radius: 999px;
}

@media (max-width: 680px) {
  body.role-client .client-page-nav {
    position: sticky;
    top: 5.25rem;
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  body.role-client .client-page-link {
    min-width: max-content;
    flex: 0 0 auto;
  }
}

/* Reduce non-repeated cards */
body.app-authenticated .work-panel,
body.app-authenticated .intake-panel,
body.app-authenticated .summary-panel,
body.app-authenticated .profile-panel,
body.app-authenticated .bottom-panel,
body.app-authenticated .admin-management-shell,
body.app-authenticated .doctor-dashboard-shell {
  padding: 0 0 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.role-client .search-choice,
body.role-client .slot-panel,
body.role-client .intake-section,
body.role-client .payment-gateway,
body.role-client .triage-card,
body.role-client .info-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.role-client .search-choice,
body.role-client .slot-panel,
body.role-client .payment-gateway,
body.role-client .triage-card,
body.role-client .info-card {
  padding: 0;
}

body.role-client .intake-section {
  padding: 0 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.role-client .intake-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

body.role-client .info-card {
  min-height: 0;
}

body.role-client .summary-row,
body.role-client .status-row,
body.role-client .compliance-item,
body.role-client .appointment-reminders,
body.role-client .client-guidance {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: transparent;
  padding: 0.72rem 0;
}

body.role-client .summary-grid,
body.role-client .status-board {
  gap: 0;
}

body.role-client .payment-mode-grid,
body.role-client .wallet-grid {
  gap: 0.5rem;
}

body.role-client .payment-mode-card,
body.role-client .wallet-card {
  display: flex;
  align-items: center;
  min-height: 2.9rem;
  padding: 0.62rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: none;
}

body.role-client .wallet-card {
  align-content: center;
  justify-items: start;
}

body.role-client .wallet-logo,
body.role-client .payment-icon {
  width: 2rem;
  height: 2rem;
  min-height: 2rem;
  border-radius: 999px;
  font-size: 0.62rem;
}

/* Breathing room */
body.app-authenticated .app-shell {
  padding-bottom: 2.75rem;
}

body.app-authenticated .workspace {
  gap: 1.45rem;
  margin-bottom: 1.75rem;
}

body.app-authenticated .section-header {
  margin-bottom: 1.35rem;
}

body.app-authenticated .section-header.compact {
  margin-bottom: 1.15rem;
}

body.app-authenticated .section-support {
  margin-top: 0.65rem;
}

body.app-authenticated .button-row {
  gap: 0.9rem;
  margin-top: 1.45rem;
}

body.app-authenticated .page-actions {
  margin-top: 1.65rem;
}

body.app-authenticated .doctor-grid,
body.app-authenticated .appointments-board,
body.app-authenticated .doctor-dashboard-panel,
body.app-authenticated .profile-form,
body.app-authenticated .account-verification-panel {
  gap: 1.15rem;
}

body.app-authenticated .appointment-card,
body.app-authenticated .client-appointment-card,
body.app-authenticated .doctor-appointment-card {
  gap: 1.15rem;
  padding: 1.2rem;
}

body.role-admin .admin-booking-card {
  gap: 0.78rem;
  padding: 0.95rem;
}

body.role-client .client-page-nav {
  margin-bottom: 1.4rem;
}

body.role-client .work-panel,
body.role-client .intake-panel,
body.role-client .summary-panel,
body.role-client .profile-panel,
body.role-client .bottom-panel {
  padding-bottom: 1.75rem;
}

body.role-client .search-builder {
  gap: 1.15rem;
  margin-bottom: 1.35rem;
}

body.role-client .chip-row {
  gap: 0.8rem;
  margin-bottom: 1.35rem;
}

body.role-client .doctor-grid {
  margin-bottom: 1.35rem;
}

body.role-client .slot-panel,
body.role-client .payment-gateway,
body.role-client .triage-card,
body.role-client .info-card {
  gap: 1.15rem;
}

body.role-client .intake-section-list {
  gap: 1.45rem;
}

body.role-client .intake-section {
  gap: 1.05rem;
  padding-bottom: 1.45rem;
}

body.role-client .intake-section-head {
  padding-bottom: 0.9rem;
}

body.role-client .intake-field-grid {
  gap: 1.05rem 1.2rem;
}

body.role-client .field-stack {
  gap: 1.05rem;
}

body.role-client .payment-mode-grid,
body.role-client .wallet-grid {
  gap: 0.75rem;
}

body.role-client .summary-grid,
body.role-client .status-board {
  gap: 0.18rem;
}

body.role-client .summary-row,
body.role-client .status-row,
body.role-client .compliance-item,
body.role-client .appointment-reminders,
body.role-client .client-guidance {
  padding: 0.9rem 0;
}

body.role-client .footer-note {
  margin-top: 1.25rem;
}

@media (max-width: 680px) {
  body.app-authenticated .app-shell {
    padding-bottom: 1.75rem;
  }

  body.app-authenticated .section-header {
    margin-bottom: 1.05rem;
  }

  body.app-authenticated .button-row {
    margin-top: 1.15rem;
  }

  body.role-client .client-page-nav {
    margin-bottom: 1rem;
  }

  body.role-client .work-panel,
  body.role-client .intake-panel,
  body.role-client .summary-panel,
  body.role-client .profile-panel,
  body.role-client .bottom-panel {
    padding-bottom: 1.25rem;
  }

  body.role-client .search-builder,
  body.role-client .intake-section-list {
    gap: 1rem;
  }

  body.role-client .intake-section {
    padding-bottom: 1.15rem;
  }

  body.app-authenticated .appointment-card,
  body.app-authenticated .client-appointment-card,
  body.app-authenticated .doctor-appointment-card {
    padding: 1rem;
  }
}

/* Final precedence pass for late role-specific legacy rules. */
body {
  color: var(--text);
  background: var(--bg-0);
}

.card,
.auth-hero,
.auth-card,
body.app-authenticated .work-panel,
body.app-authenticated .intake-panel,
body.app-authenticated .summary-panel,
body.app-authenticated .profile-panel,
body.app-authenticated .bottom-panel,
body.app-authenticated .admin-management-shell,
body.app-authenticated .doctor-dashboard-shell {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.card:hover { transform: none; border-color: var(--border); }

.auth-banner {
  position: sticky;
  top: 0;
  width: 100%;
  margin: 0;
  padding: 0.75rem max(1rem, calc((100vw - 1180px) / 2));
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: #fff;
  box-shadow: 0 2px 10px rgba(27, 42, 51, 0.05);
  backdrop-filter: none;
}

.auth-banner-copy strong,
.auth-banner-copy span { color: var(--text); }
.auth-current-page { color: var(--primary) !important; background: #e7f3f3 !important; border-color: #c5e3e3 !important; }
.auth-role-badge { color: var(--primary) !important; background: #e7f3f3 !important; border-color: #c5e3e3 !important; border-radius: 5px; text-transform: capitalize; letter-spacing: 0; }
.auth-logout { min-height: 2.3rem; padding: 0.45rem 0.75rem; }

.client-page-nav,
.admin-page-nav {
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 4px 14px rgba(27, 42, 51, 0.05);
  backdrop-filter: none;
}

.client-page-link,
.admin-page-link {
  color: var(--muted);
  border-color: transparent;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 650;
}

.client-page-link:hover,
.admin-page-link:hover { color: var(--text); background: #f2f6f7; border-color: transparent; transform: none; }
.client-page-link.active,
.admin-page-link.active { color: var(--primary); background: #e7f3f3; border-color: #c5e3e3; }
body.role-client .client-page-link::before { color: var(--muted); background: #f1f4f5; border-color: var(--border); }
body.role-client .client-page-link.active::before { color: #fff; background: var(--primary); border-color: var(--primary); }

.account-verification-banner { background: #fff8e8; border-color: #efd08b; box-shadow: none; }
.account-verification-banner strong { color: var(--text); }
.account-verification-banner span { color: #72530e; }

.work-panel,
.intake-panel,
.summary-panel,
.profile-panel,
.bottom-panel,
.admin-management-shell,
.doctor-dashboard-shell,
body.app-authenticated .work-panel,
body.app-authenticated .intake-panel,
body.app-authenticated .summary-panel,
body.app-authenticated .profile-panel,
body.app-authenticated .bottom-panel,
body.app-authenticated .admin-management-shell,
body.app-authenticated .doctor-dashboard-shell {
  padding: 1.5rem;
}

.search-choice,
.slot-panel,
.intake-section,
.triage-card,
.info-card,
.doctor-card,
.appointment-card,
.client-appointment-card,
.doctor-appointment-card,
.payment-gateway,
.compliance-item {
  color: var(--text);
  background: #fff;
  border-color: var(--border);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.search-choice:hover,
.doctor-card:hover { background: #fbfdfd; border-color: var(--primary-2); transform: none; }
.doctor-card.selected { background: #f0f8f8; border-color: var(--primary); box-shadow: 0 0 0 1px rgba(23, 107, 115, 0.08) inset; }
.search-choice-head strong, .doctor-card h3, .doctor-card p, .doctor-meta { color: var(--text); }
.doctor-card p, .doctor-meta, .slot-head p { color: var(--muted); }
.intake-section-head { border-bottom-color: var(--border); }

input, textarea, select { color: var(--text); background: #fff; border-color: var(--border-strong); border-radius: var(--radius-sm); }
input:focus, textarea:focus, select:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(33, 133, 138, 0.12); }
.field > span { color: var(--text); }
.button-primary { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: none; }
.button-primary:hover { background: #115a61; border-color: #115a61; box-shadow: 0 4px 10px rgba(23, 107, 115, 0.18); transform: none; }
.button-ghost { color: var(--text); background: #fff; border-color: var(--border-strong); }
.button-ghost:hover { color: var(--primary); background: #f4f8f9; border-color: var(--primary); transform: none; }

.slot-day-card { background: #f8fafb; border-color: var(--border); }
.slot-chip { color: var(--text); background: #fff; border-color: var(--border); border-radius: 6px; }
.slot-chip.available { background: #f0f8f8; border-color: #bddddd; }
.slot-chip.available:hover { background: #e7f3f3; border-color: var(--primary); transform: none; }
.slot-chip.selected { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: none; }
.slot-chip.selected span { color: #d9f1f1; }
.payment-mode-card, .wallet-card { background: #fff; border-color: var(--border); box-shadow: none; }
.payment-mode-card.active, .wallet-card.active, .payment-mode-card:hover, .wallet-card:hover { background: #f0f8f8; border-color: var(--primary); box-shadow: none; }
.triage-card { background: #fffaf0; border-color: #efd08b; }
.compliance-item { background: #f8fafb; }
.checkbox-custom { background: #fff; border-color: var(--border-strong); }
.checkbox-label input:checked + .checkbox-custom { background: var(--primary); border-color: var(--primary); box-shadow: none; }

.summary-row, .status-row { padding: 0.8rem 0; border-color: var(--border); border-radius: 0; background: transparent; }
.status-row strong { color: var(--success); }
.status-row strong.pending { color: var(--warning); }
.board-stats span, .admin-stat-chip { color: var(--muted); background: #f5f8f9; border-color: var(--border); border-radius: 6px; }
.admin-stat-chip:hover, .admin-stat-chip.active { color: var(--primary); background: #e7f3f3; border-color: #acd5d5; transform: none; }

table { color: var(--text); background: #fff; }
th { color: var(--muted); background: #f5f8f9; border-bottom-color: var(--border); }
td { border-bottom-color: var(--border); }
tr:hover td { background: #fbfdfd; }
.system-footer { background: transparent; border-top-color: var(--border); }
.system-footer p { color: var(--muted); }
.system-footer strong { color: var(--primary); }

@media (max-width: 680px) {
  .app-shell, .auth-shell { width: min(100% - 1rem, 1180px); }
  .auth-banner { padding: 0.65rem 0.75rem; }
  .auth-banner-actions { width: 100%; justify-content: space-between; }
  .work-panel, .intake-panel, .summary-panel, .profile-panel, .bottom-panel, .admin-management-shell, .doctor-dashboard-shell,
  body.app-authenticated .work-panel, body.app-authenticated .intake-panel, body.app-authenticated .summary-panel,
  body.app-authenticated .profile-panel, body.app-authenticated .bottom-panel, body.app-authenticated .admin-management-shell,
  body.app-authenticated .doctor-dashboard-shell { padding: 1.1rem; }
}

/* Admin management surfaces: keep generated cards on the same light canvas. */
body.role-admin .admin-booking-toolbar,
body.role-admin .admin-booking-card,
body.role-admin .admin-booking-section,
body.role-admin .admin-form,
body.role-admin .admin-record-card,
body.role-admin .admin-stat-card,
body.role-admin .history-filter-bar,
body.role-admin .history-summary-card {
  color: var(--text);
  background: #fff;
  border-color: var(--border);
  box-shadow: none;
}

body.role-admin .admin-booking-toolbar { background: #f5f8f9; }
body.role-admin .admin-booking-toolbar-head strong,
body.role-admin .admin-booking-card-head h3,
body.role-admin .admin-form-head h3,
body.role-admin .admin-record-card h3,
body.role-admin .admin-stat-card strong { color: var(--text); }
body.role-admin .admin-booking-section { background: #f8fafb; }
body.role-admin .admin-booking-field span,
body.role-admin .admin-record-list dt,
body.role-admin .admin-stat-card span { color: var(--muted); }
body.role-admin .admin-booking-field strong,
body.role-admin .admin-record-list dd,
body.role-admin .admin-stat-card strong { color: var(--text); }

body.role-admin .admin-booking-card.pending {
  background: #fff;
  border-color: var(--border);
  border-left: 4px solid #e6bd68;
}

body.role-admin .admin-booking-card.cancelled,
body.role-admin .admin-booking-card.completed,
body.role-admin .admin-booking-card.active {
  background: #fff;
  border-color: var(--border);
}

body.role-admin .admin-booking-badge {
  border-radius: 5px;
  font-size: 0.74rem;
  letter-spacing: 0;
  text-transform: none;
}
body.role-admin .admin-booking-badge.warning,
body.role-admin .admin-booking-badge.pending { color: var(--warning); background: #fff1cc; border-color: #e6bd68; }
body.role-admin .admin-booking-badge.success { color: var(--success); background: #eaf7f1; border-color: #bfe4d2; }
body.role-admin .admin-booking-badge.danger { color: var(--danger); background: #fdf1f1; border-color: #efc1c1; }
body.role-admin .admin-booking-badge.muted { color: var(--muted); background: #f1f4f5; border-color: var(--border); }

body.role-admin .admin-form,
body.role-admin .admin-record-card { border-radius: var(--radius-md); }
body.role-admin .doctor-login-fields { background: #f0f8f8; border-color: #c5e3e3; }
body.role-admin .admin-record-card.inactive { opacity: 0.72; background: #f8fafb; }
body.role-admin .history-filter-bar input,
body.role-admin .history-filter-bar select { background: #fff; }

@media (max-width: 760px) {
  body.role-admin .admin-filter-grid { grid-template-columns: 1fr; }
}

/* Final admin readability pass for history and nested appointment content. */
body.role-admin .history-record-card,
body.role-admin .history-custom-range,
body.role-admin .clinic-record-row,
body.role-admin .admin-schedule-lines span,
body.role-admin .admin-upcoming-list li {
  color: var(--text);
  background: #fff;
  border-color: var(--border);
  box-shadow: none;
}

body.role-admin .history-record-card { border-radius: var(--radius-md); }
body.role-admin .history-record-head h3,
body.role-admin .history-record-card .admin-record-list dd,
body.role-admin .clinic-record-row strong { color: var(--text); }
body.role-admin .history-note,
body.role-admin .clinic-record-row span,
body.role-admin .admin-upcoming-list span { color: var(--muted); }
body.role-admin .history-custom-range { background: #f8fafb; }
body.role-admin .admin-schedule-lines span { color: var(--muted); }

.status-chip.active,
.status-chip.confirmed { color: #1e40af; background: #dbeafe; border-color: #93c5fd; }
.status-chip.pending { color: #92400e; background: #fef3c7; border-color: #fcd34d; }
.status-chip.completed,
.status-chip.paid { color: #166534; background: #dcfce7; border-color: #86efac; }
.status-chip.cancelled,
.status-chip.rejected { color: #991b1b; background: #fee2e2; border-color: #fca5a5; }
.status-chip.no-show { color: #9a3412; background: #ffedd5; border-color: #fdba74; }

.payment-status-pill.paid { color: #166534; background: #dcfce7; border-color: #86efac; }
.payment-status-pill.pending { color: #92400e; background: #fef3c7; border-color: #fcd34d; }
.payment-status-pill.unpaid { color: #9a3412; background: #ffedd5; border-color: #fdba74; }

body.role-admin .auth-role-badge,
body.role-admin .appointment-id { color: var(--muted); background: #f1f4f5; border-color: var(--border); }
body.role-admin .auth-role-badge.role-admin { color: var(--primary) !important; background: #e7f3f3 !important; border-color: #c5e3e3 !important; }

@media (max-width: 760px) {
  body.role-admin .history-record-grid { grid-template-columns: 1fr; }
}

/* Final semantic contrast pass for light admin surfaces. */
.status-chip.account-active {
  color: #126047;
  background: #e7f5ef;
  border-color: #9bd7bd;
}

.status-chip.account-inactive {
  color: #8f2d2d;
  background: #fdf0f0;
  border-color: #e7b4b4;
}

.admin-review-alert {
  color: #6b4a00;
  background: #fff7e0;
  border-color: #e8bb54;
}

.admin-review-alert > span {
  color: #fff;
  background: #d99500;
}

.admin-review-alert strong {
  color: #6b4a00;
}

.admin-review-alert.danger {
  color: #8f2d2d;
  background: #fdf0f0;
  border-color: #e7b4b4;
}

.admin-review-alert.danger > span {
  color: #fff;
  background: #c53b3b;
}

.admin-review-alert.danger strong { color: #8f2d2d; }

.admin-review-alert.info {
  color: #155e75;
  background: #edf8fb;
  border-color: #9ed6e2;
}

.admin-review-alert.info > span {
  color: #fff;
  background: #16758a;
}

.admin-review-alert.info strong { color: #155e75; }

/* Keep doctor and client history views on the same readable light surfaces. */
body.app-authenticated .history-filter-bar,
body.app-authenticated .history-record-card,
body.app-authenticated .history-custom-range,
body.app-authenticated .history-summary-card {
  color: var(--text);
  background: #fff;
  border-color: var(--border);
  box-shadow: none;
}

body.app-authenticated .history-record-card {
  border-radius: var(--radius-md);
}

body.app-authenticated .history-record-head h3,
body.app-authenticated .history-record-card .admin-record-list dd,
body.app-authenticated .history-record-card .clinic-record-row strong {
  color: var(--text);
}

body.app-authenticated .history-record-card .admin-record-list dt,
body.app-authenticated .history-note,
body.app-authenticated .history-record-card .clinic-record-row span {
  color: var(--muted);
}

body.app-authenticated .history-record-card .appointment-id {
  color: var(--muted);
  background: #f1f4f5;
  border-color: var(--border);
}

body.app-authenticated .history-record-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(247, 250, 251, 0.98), rgba(218, 229, 234, 0.94));
  border: 1px solid #b8cbd3;
  border-color: #b8cbd3;
  box-shadow:
    0 14px 30px rgba(27, 42, 51, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  backdrop-filter: blur(12px) saturate(115%);
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

body.app-authenticated .history-record-card::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.5), transparent 42%);
  content: "";
  pointer-events: none;
}

body.app-authenticated .history-record-card > * {
  position: relative;
  z-index: 1;
}

body.app-authenticated .history-record-card:hover {
  background: linear-gradient(145deg, rgba(250, 253, 254, 0.98), rgba(215, 228, 233, 0.96));
  border-color: #8faab6;
  box-shadow:
    0 20px 36px rgba(27, 42, 51, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  transform: translateY(-5px);
}

body.app-authenticated .email-notification-panel {
  color: var(--text);
  background: rgba(239, 244, 246, 0.88);
  border-color: #cbd9df;
}

body.app-authenticated .email-notification-preview,
body.app-authenticated .email-history-list .reminder-line {
  color: var(--muted);
}

body.app-authenticated .email-notification-history summary {
  border-top-color: #d5e0e5;
  color: var(--primary);
}

.email-history-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid #d5e0e5;
}

.email-history-pagination > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.email-history-page-button {
  min-height: 1.9rem;
  padding: 0.28rem 0.5rem;
  border: 1px solid #b7cbd3;
  border-radius: 6px;
  color: var(--primary);
  background: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.email-history-page-button:hover:not(:disabled) {
  background: #e7f1f3;
  border-color: var(--primary);
}

.email-history-page-button:disabled {
  color: #9aa9b0;
  background: #edf1f3;
  border-color: #d8e0e4;
  cursor: not-allowed;
}

/* Role-based user management. */
.user-management-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.2rem 0 1.15rem;
}

.user-management-header h3,
.user-management-note h3 {
  margin: 0.25rem 0 0;
  color: var(--text);
}

.user-management-header p,
.user-management-note p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.user-management-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.user-role-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #f5f8f9;
}

.user-role-tab {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  min-height: 2.5rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 750;
  cursor: pointer;
}

.user-role-tab strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  min-height: 1.45rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  color: var(--muted);
  background: #e5ecef;
  font-size: 0.72rem;
}

.user-role-tab:hover {
  color: var(--primary);
  background: #edf5f6;
}

.user-role-tab.active {
  color: var(--primary);
  background: #fff;
  border-color: #b9d6da;
  box-shadow: 0 2px 7px rgba(27, 42, 51, 0.07);
}

.user-role-tab.active strong {
  color: #fff;
  background: var(--primary);
}

.user-management-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.28fr);
  gap: 1.25rem;
  align-items: start;
}

.user-management-primary {
  min-width: 0;
}

.user-management-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.8rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #f8fafb;
}

.user-management-search .field {
  min-width: 0;
}

.user-management-search .button {
  min-height: 2.75rem;
}

.user-management-search .button-ghost {
  background: #fff;
}

.user-management-note {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #f8fafb;
}

.admin-user-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.admin-user-table {
  min-width: 980px;
  background: #fff;
}

.admin-user-table th {
  white-space: nowrap;
}

.admin-user-table td {
  color: var(--text);
  vertical-align: top;
}

.admin-user-table td:first-child {
  min-width: 10rem;
}

.admin-user-table td:nth-child(6) {
  min-width: 13rem;
  white-space: nowrap;
}

.user-created {
  display: inline-block;
  white-space: nowrap;
}

.admin-user-table td:first-child strong,
.admin-user-table td:first-child span,
.admin-user-table td:nth-child(4) span {
  display: block;
}

.admin-user-table td:first-child span,
.admin-user-secondary {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.admin-user-table .verification-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.admin-user-table .compact-actions {
  min-width: 8rem;
  margin: 0;
}

@media (max-width: 920px) {
  .user-management-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .user-management-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-role-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .user-role-tab {
    min-width: 0;
    padding-inline: 0.45rem;
    font-size: 0.78rem;
  }

  .user-management-search {
    grid-template-columns: 1fr;
  }

  .user-management-search .button {
    width: 100%;
  }

  .admin-user-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .admin-user-table {
    display: block;
    min-width: 0;
    background: transparent;
  }

  .admin-user-table thead {
    display: none;
  }

  .admin-user-table tbody {
    display: grid;
    gap: 0.8rem;
  }

  .admin-user-table tr {
    display: block;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: 0 4px 12px rgba(27, 42, 51, 0.05);
  }

  .admin-user-table td,
  .admin-user-table td:first-child,
  .admin-user-table td:nth-child(6) {
    display: grid;
    grid-template-columns: minmax(6.5rem, 0.75fr) minmax(0, 1.35fr);
    gap: 0.7rem;
    min-width: 0;
    padding: 0.58rem 0;
    border-bottom: 1px solid #edf1f3;
    white-space: normal;
  }

  .admin-user-table td:last-child {
    border-bottom: 0;
  }

  .admin-user-table td::before {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    content: attr(data-label);
  }

  .admin-user-table td:first-child strong,
  .admin-user-table td:first-child span,
  .admin-user-table td:nth-child(4) span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .user-created {
    white-space: normal;
    line-height: 1.35;
  }

  .admin-user-table .compact-actions {
    min-width: 0;
  }
}

/* Light client progress navigation. */
body.role-client .client-page-nav {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(229, 238, 241, 0.94));
  border-color: #bfd1d8;
  box-shadow:
    0 10px 24px rgba(27, 42, 51, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px) saturate(115%);
}

body.role-client .client-page-link {
  color: #5b6d76;
  border-color: transparent;
}

body.role-client .client-page-link:hover {
  color: var(--primary);
  background: #eef5f6;
  border-color: #c9dde2;
}

body.role-client .client-page-link.active {
  color: #0f6269;
  background: #e2f1f2;
  border-color: #9fcdd1;
  box-shadow: inset 0 -2px 0 #176b73;
}

body.role-client .client-page-link::before {
  color: #5b6d76;
  background: #edf2f4;
  border-color: #c3d2d8;
}

body.role-client .client-page-link.active::before {
  color: #fff;
  background: #176b73;
  border-color: #176b73;
}

/* Keep client-record copy inside its panel at every viewport width. */
body.role-client .history-panel,
body.role-client .history-panel .section-header,
body.role-client #client-history-panel,
body.role-client #client-history-panel > * {
  min-width: 0;
  max-width: 100%;
}

body.role-client .history-panel {
  padding: clamp(1rem, 2vw, 1.5rem);
}

body.role-client .history-panel .section-support,
body.role-client .client-history-note span,
body.role-client .empty-board span,
body.role-client .history-note,
body.role-client .history-record-card,
body.role-client .history-record-card * {
  max-width: 100%;
  overflow-wrap: anywhere;
}

body.role-client .history-filter-bar,
body.role-client .history-filter-bar .search-field,
body.role-client .history-filter-bar input,
body.role-client .history-filter-bar select {
  min-width: 0;
  max-width: 100%;
}

body.role-client .history-record-grid {
  min-width: 0;
}

/* Authenticated header layout: actions left, identity centered. */
body.app-authenticated .auth-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: 4rem;
  padding: 0.85rem max(1rem, calc((100vw - 1180px) / 2));
}

body.app-authenticated .auth-banner-actions {
  grid-column: 1;
  grid-row: 1;
  justify-content: flex-start;
}

body.app-authenticated .auth-banner-copy {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  min-width: max-content;
  text-align: center;
}

body.app-authenticated .auth-banner-copy strong {
  font-size: 1.08rem;
}

body.app-authenticated .auth-current-page {
  min-height: 2.1rem;
  padding: 0.42rem 0.8rem;
  font-size: 0.9rem;
}

@media (max-width: 680px) {
  body.app-authenticated .auth-banner {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    min-height: 0;
    padding: 0.85rem 1rem;
  }

  body.app-authenticated .auth-banner-copy {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    justify-content: center;
    flex-wrap: wrap;
  }

  body.app-authenticated .auth-banner-actions {
    grid-column: 1;
    grid-row: 2;
    justify-content: flex-start;
  }
}

/* Final density precedence: keep the compact scale after legacy overrides. */
.app-shell { width: min(1280px, calc(100vw - 3rem)); padding: 1.25rem 0 2rem; }
.auth-shell { width: min(1280px, calc(100vw - 3rem)); gap: 1rem; padding: 1rem 0; }
.auth-hero, .auth-card { padding: 1.25rem; }
.auth-hero h1, .hero h1 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.08; }
.hero { gap: 1.5rem; padding: 1.5rem; }
body.payment-page .payment-shell { width: min(1120px, calc(100vw - 3rem)); padding: 1.25rem 0 2rem; }
body.payment-page .payment-qr-panel, body.payment-page .payment-summary-panel { padding: 1.25rem; }

body.app-authenticated .app-shell {
  width: min(1320px, calc(100vw - 3rem));
  padding: 1rem 0 2rem;
}

body.app-authenticated .auth-banner {
  width: min(1320px, calc(100vw - 3rem));
  min-height: 3.5rem;
  padding: 0.65rem max(1rem, calc((100vw - 1280px) / 2));
}

body.app-authenticated .client-page-nav,
body.app-authenticated .admin-page-nav { margin-bottom: 1rem; }
body.app-authenticated .flow-strip { margin-bottom: 1rem; padding: 1rem; }
body.app-authenticated .workspace { gap: 1rem; margin-bottom: 1.25rem; }
body.app-authenticated .work-panel,
body.app-authenticated .intake-panel,
body.app-authenticated .summary-panel,
body.app-authenticated .profile-panel,
body.app-authenticated .bottom-panel,
body.app-authenticated .admin-management-shell,
body.app-authenticated .doctor-dashboard-shell { padding: 1.25rem; }
body.app-authenticated .section-header { margin-bottom: 1rem; }
body.app-authenticated .section-header h2,
body.app-authenticated #admin-page-title { font-size: clamp(1.35rem, 1.8vw, 1.8rem); line-height: 1.18; }
body.app-authenticated .section-support { font-size: 0.92rem; line-height: 1.45; }
body.app-authenticated .admin-panel,
body.app-authenticated .doctor-dashboard-panel,
body.app-authenticated .appointments-board,
body.app-authenticated .profile-form,
body.app-authenticated .account-verification-panel { gap: 0.85rem; }
body.app-authenticated .history-record-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.85rem; }
body.app-authenticated .history-record-card,
body.app-authenticated .appointment-card,
body.app-authenticated .client-appointment-card,
body.app-authenticated .doctor-appointment-card { gap: 0.75rem; padding: 1rem; }
body.app-authenticated .history-filter-bar { gap: 0.6rem; margin-bottom: 0.8rem; }
body.app-authenticated .compact-stats,
body.app-authenticated .admin-stat-grid { gap: 0.7rem; }
body.app-authenticated .admin-stat-card,
body.app-authenticated .admin-record-card,
body.app-authenticated .admin-form { padding: 0.9rem; }
body.app-authenticated .admin-record-grid { gap: 0.75rem; }
body.app-authenticated .intake-section,
body.app-authenticated .payment-gateway,
body.app-authenticated .triage-card,
body.app-authenticated .info-card { padding: 0.95rem; }
body.app-authenticated input,
body.app-authenticated textarea,
body.app-authenticated select { min-height: 2.6rem; padding: 0.58rem 0.7rem; }
body.app-authenticated .button { min-height: 2.5rem; padding: 0.58rem 0.85rem; }
body.app-authenticated .client-page-link,
body.app-authenticated .admin-page-link { min-height: 2.45rem; padding: 0.5rem 0.68rem; }

@media (max-width: 1020px) {
  .app-shell, .auth-shell, body.app-authenticated .app-shell,
  body.app-authenticated .auth-banner, body.payment-page .payment-shell { width: min(100% - 2rem, 1180px); }
  body.app-authenticated .history-record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .app-shell, .auth-shell, body.app-authenticated .app-shell,
  body.app-authenticated .auth-banner, body.payment-page .payment-shell { width: calc(100% - 2rem); }
  .app-shell, body.app-authenticated .app-shell { padding: 0.85rem 0 1.5rem; }
  .auth-shell { padding: 0.85rem 0; }
  .auth-hero, .auth-card, .hero,
  body.app-authenticated .work-panel,
  body.app-authenticated .intake-panel,
  body.app-authenticated .summary-panel,
  body.app-authenticated .profile-panel,
  body.app-authenticated .bottom-panel,
  body.app-authenticated .admin-management-shell,
  body.app-authenticated .doctor-dashboard-shell { padding: 1rem; }
  .auth-hero h1, .hero h1 { font-size: 2rem; }
  body.app-authenticated .history-record-grid { grid-template-columns: 1fr; }
  body.app-authenticated .history-record-card,
  body.app-authenticated .appointment-card,
  body.app-authenticated .client-appointment-card,
  body.app-authenticated .doctor-appointment-card { padding: 0.9rem; }
}

/* Prevent identity controls from colliding on narrow authenticated headers. */
@media (max-width: 680px) {
  body.app-authenticated .auth-banner-copy {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex-wrap: nowrap;
    justify-content: center;
    overflow: hidden;
  }

  body.app-authenticated .auth-banner-copy strong {
    min-width: 0;
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1rem;
  }

  body.app-authenticated .auth-current-page {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.app-authenticated .auth-banner-actions {
    display: flex;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
