:root {
  /* Palette aligned to Docs/images screen mockups */
  --bg: #eef5f2;
  --bg-deep: #e4efe9;
  --ink: #000;
  --muted: #000;
  --panel: rgba(255, 255, 255, 0.55);
  --panel-solid: #fafbfb;
  --panel-border: rgba(255, 255, 255, 0.65);
  --panel-border-outer: rgba(16, 61, 52, 0.12);
  --line: #d8e2de;
  --accent: #103d34;
  --accent-bright: #1a5c4e;
  --accent-2: #e5a138;
  --accent-2-ink: #000;
  --btn-bg: var(--accent);
  --btn-text: #ffffff;
  --btn-hover: var(--accent-bright);
  --btn-hover-text: #ffffff;
  --btn-accent: var(--accent-2);
  --danger: #b2615a;
  --danger-bg: #fde8e5;
  --ok: #1a5c4e;
  --ok-bg: #e8f3ef;
  --warn: #b8831f;
  --warn-bg: #fff6e5;
  --shadow: 0 10px 32px rgba(11, 45, 38, 0.08);
  --glass-blur: 16px;
  --radius: 16px;
  --font: "Manrope", sans-serif;
  --display: "Manrope", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(229, 161, 56, 0.14), transparent 55%),
    radial-gradient(800px 520px at 92% 8%, rgba(26, 92, 78, 0.12), transparent 50%),
    radial-gradient(700px 420px at 70% 100%, rgba(16, 61, 52, 0.08), transparent 55%),
    linear-gradient(165deg, var(--bg) 0%, #f7faf8 45%, var(--bg-deep) 100%);
  background-attachment: fixed;
}

.material-symbols-outlined,
.icon {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
  vertical-align: middle;
  color: currentColor;
}
.icon {
  stroke: currentColor;
}

a { color: #000; text-decoration: none; }
h1, h2, h3 { font-family: var(--display); margin: 0 0 0.4rem; letter-spacing: -0.01em; font-weight: 600; color: #000; }
h1 { font-size: clamp(1.85rem, 3.5vw, 2.35rem); }
h2 { font-size: 1.35rem; }
p { color: var(--muted); font-size: 1.02rem; }

.shell {
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}
.sidebar {
  position: fixed;
  top: 1rem;
  bottom: 1rem;
  left: 1rem;
  transform: none;
  z-index: 40;
  width: 270px;
  height: auto;
  max-height: none;
  padding: 1.25rem 0.95rem;
  --sidebar-bg-top: #1a5c4e;
  --sidebar-bg-bottom: #103d34;
  --sidebar-nav-active: #245a4d;
  --sidebar-text: #edf6f2;
  background: linear-gradient(180deg, var(--sidebar-bg-top) 0%, var(--sidebar-bg-bottom) 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 22px 48px rgba(11, 45, 38, 0.22),
    0 4px 14px rgba(11, 45, 38, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}
.sidebar-top {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.sidebar-top .brand,
.sidebar-top .brand--stacked {
  flex: 1 1 auto;
  min-width: 0;
}
.sidebar-close {
  display: none;
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: var(--sidebar-text);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
  place-items: center;
  margin-top: 0.15rem;
}
.sidebar-close .icon {
  width: 1.15rem;
  height: 1.15rem;
}
.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.18);
}
.sidebar-close:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sidebar-text) 70%, transparent);
  outline-offset: 2px;
}
.mobile-nav-toggle {
  display: none;
}
.sidebar-backdrop {
  display: none;
}
a.brand {
  text-decoration: none;
  color: inherit;
}
a.brand:hover strong,
a.brand:focus-visible strong {
  color: #fff;
}
.brand-mark {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, var(--accent-2), #d4962f);
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}
a.brand-mark:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sidebar-text) 70%, transparent);
  outline-offset: 2px;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.brand-mark .icon { width: 1.45rem; height: 1.45rem; color: #fff; }
.brand strong { display: block; font-size: 1.08rem; color: var(--sidebar-text); }
.brand small {
  color: color-mix(in srgb, var(--sidebar-text) 68%, transparent);
  font-size: 0.92rem;
}
.brand--stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding: 0;
}
.brand--stacked .brand-mark {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  max-height: none;
  border-radius: 14px;
  background: #fff;
}
.brand--stacked .brand-mark img {
  object-fit: contain;
  padding: 0.45rem;
}
.brand--stacked .brand-mark .icon {
  width: 2rem;
  height: 2rem;
  color: var(--accent);
}
.brand--stacked > small {
  display: block;
  padding: 0 0.35rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--sidebar-text) 78%, transparent);
}
.sidebar nav {
  display: grid;
  gap: 1rem;
  flex: 1 1 auto;
  align-content: start;
}
.sidebar .nav-group {
  display: grid;
  gap: 0.3rem;
}
.sidebar .nav-label {
  margin: 0;
  padding: 0.15rem 0.9rem 0.35rem;
  color: color-mix(in srgb, var(--sidebar-text) 55%, transparent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sidebar nav a {
  color: color-mix(in srgb, var(--sidebar-text) 88%, transparent);
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.02rem;
  font-weight: 600;
}
.sidebar nav a .icon { width: 1.2rem; height: 1.2rem; opacity: 0.92; }
.sidebar nav a.active,
.sidebar nav a:hover {
  background: var(--sidebar-nav-active);
  color: var(--sidebar-text);
}
.sidebar .nav-tree {
  display: grid;
  gap: 0.15rem;
}
.sidebar .nav-parent {
  margin: 0;
  padding: 0.8rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: color-mix(in srgb, var(--sidebar-text) 88%, transparent);
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 12px;
}
.sidebar .nav-parent .icon {
  width: 1.2rem;
  height: 1.2rem;
  opacity: 0.92;
}
.sidebar .nav-parent:hover,
.sidebar .nav-parent.is-active {
  background: var(--sidebar-nav-active);
  color: var(--sidebar-text);
}
.sidebar .nav-sub {
  display: none;
  gap: 0.2rem;
  padding: 0 0 0.15rem 0.55rem;
  margin: 0 0 0.2rem 0.85rem;
  border-left: 1px solid color-mix(in srgb, var(--sidebar-text) 18%, transparent);
}
.sidebar .nav-tree.is-open .nav-sub {
  display: grid;
}
.sidebar .nav-tree.is-open .nav-parent {
  padding: 0.55rem 0.9rem 0.25rem;
  background: transparent;
  color: color-mix(in srgb, var(--sidebar-text) 72%, transparent);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sidebar .nav-tree.is-open .nav-parent:hover {
  background: transparent;
  color: var(--sidebar-text);
}
.sidebar .nav-tree.is-open .nav-parent .icon {
  width: 1.15rem;
  height: 1.15rem;
  opacity: 0.85;
}
.sidebar .nav-sub a {
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
}
.assign-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  min-width: 16rem;
}
.assign-inline select,
.assign-inline input[type="number"] {
  width: auto;
  min-width: 6.5rem;
  max-width: 9rem;
  margin: 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.88rem;
}
.assign-inline input[type="number"] {
  min-width: 4.5rem;
  max-width: 5.5rem;
}
.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  color: var(--sidebar-text);
  text-decoration: none;
}
.sidebar-user:hover,
.sidebar-user.active {
  background: var(--sidebar-nav-active);
  color: var(--sidebar-text);
}
.sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent-2), #d4962f);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sidebar-user-meta {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}
.sidebar-user-meta strong {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-meta small {
  color: color-mix(in srgb, var(--sidebar-text) 68%, transparent);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-logout { margin-top: 0; }
.sidebar-logout button,
.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  background: var(--btn-bg);
  color: var(--btn-text);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    filter 0.18s ease;
}
.btn .icon { width: 1.15rem; height: 1.15rem; color: inherit; }
.btn:hover {
  background: var(--btn-hover);
  color: var(--btn-hover-text);
  box-shadow: 0 8px 18px rgba(16, 61, 52, 0.22);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(16, 61, 52, 0.16);
  filter: brightness(0.96);
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--btn-bg) 22%, transparent);
}
.btn.secondary {
  background: transparent;
  color: #000;
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn.secondary:hover {
  background: color-mix(in srgb, var(--btn-bg) 10%, #fff);
  border-color: color-mix(in srgb, var(--btn-bg) 35%, var(--line));
  color: #000;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--btn-bg) 12%, transparent);
  transform: translateY(-1px);
}
.btn.secondary:active {
  background: color-mix(in srgb, var(--btn-bg) 14%, #fff);
  transform: translateY(0);
  box-shadow: none;
}
.btn.accent {
  background: var(--btn-bg);
  color: var(--btn-text);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--btn-bg) 28%, transparent);
}
.btn.accent .icon {
  color: inherit;
}
.btn.accent:hover {
  background: var(--btn-hover);
  color: var(--btn-hover-text);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--btn-hover) 34%, transparent);
  transform: translateY(-1px);
}
.btn.accent:hover .icon {
  color: inherit;
}
.btn.accent:active {
  background: var(--btn-hover);
  color: var(--btn-hover-text);
  transform: translateY(0);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--btn-hover) 28%, transparent);
  filter: brightness(0.96);
}
.btn.accent:active .icon {
  color: inherit;
}
.btn.accent:focus-visible {
  outline: none;
  color: var(--btn-text);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--btn-bg) 28%, transparent),
    0 4px 12px color-mix(in srgb, var(--btn-bg) 22%, transparent);
}
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover {
  background: #c56f67;
  color: #fff;
  box-shadow: 0 8px 18px rgba(178, 97, 90, 0.28);
}
.sidebar-logout button {
  width: 100%;
  background: rgba(255,255,255,0.08);
  justify-content: flex-start;
  gap: 0.55rem;
  box-shadow: none;
  transform: none;
}
.sidebar-logout button:hover {
  background: rgba(255,255,255,0.14);
  box-shadow: none;
  transform: none;
}

.content {
  position: fixed;
  top: 1rem;
  bottom: 1rem;
  left: calc(270px + 2.25rem);
  right: 1rem;
  width: auto;
  margin: 0;
  max-width: none;
  box-sizing: border-box;
  min-height: 0;
  height: auto;
  /* Side inset; top/bottom use spacers so scroll end keeps even room */
  padding: 0 1.75rem;
  overflow-x: hidden;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.88);
  border: 10px solid #fff;
  border-radius: 24px;
  box-shadow:
    0 18px 42px rgba(11, 45, 38, 0.1),
    0 2px 10px rgba(11, 45, 38, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  scrollbar-width: thin;
  scrollbar-color: var(--accent-bright) transparent;
}
.content::-webkit-scrollbar {
  width: 5px;
}
.content::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
.content::-webkit-scrollbar-track {
  background: transparent;
}
.content::-webkit-scrollbar-thumb {
  background: var(--accent-bright);
  border-radius: 999px;
}
.content::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}
.content::before,
.content::after {
  content: "";
  display: block;
  height: 1.75rem;
  flex-shrink: 0;
  pointer-events: none;
}
body:has(.shell) {
  overflow: hidden;
  height: 100vh;
}
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin: 0 0 1.5rem;
  position: relative;
  z-index: 5;
}
.page-head > [data-portal-ajax-title],
.page-head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}
.page-head h1 {
  margin: 0 0 0.35rem;
  text-transform: capitalize;
}
.page-head p {
  margin: 0;
}
.dt-toolbar h2,
.panel-toolbar h2,
.panel > h2,
.form-panel h2,
.queue-panel h2 {
  text-transform: capitalize;
}
.inline-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.inline-form select {
  width: auto;
  min-width: 6.5rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.4rem 2rem 0.4rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(16, 61, 52, 0.18);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%231a5c4e' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 0.9rem;
}
[data-portal-ajax-root] {
  position: relative;
}
[data-portal-ajax-root].is-loading {
  pointer-events: none;
}
.skel {
  display: block;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    rgba(16, 61, 52, 0.06) 0%,
    rgba(16, 61, 52, 0.12) 45%,
    rgba(16, 61, 52, 0.06) 90%
  );
  background-size: 200% 100%;
  animation: skel-shimmer 1.1s ease-in-out infinite;
}
.skel-kicker { width: 5.5rem; height: 0.7rem; margin-bottom: 0.55rem; }
.skel-title { width: min(14rem, 55%); height: 1.55rem; margin-bottom: 0.55rem; }
.skel-sub { width: min(22rem, 75%); height: 0.95rem; }
.skel-metric-label { width: 55%; height: 0.85rem; }
.skel-metric-value { width: 45%; height: 1.6rem; margin-top: 0.55rem; }
.skel-panel-title { width: 10rem; height: 1.1rem; margin-bottom: 1rem; }
.skel-row {
  height: 1rem;
  margin-bottom: 0.85rem;
  width: 100%;
}
.skel-row:nth-child(2) { width: 92%; }
.skel-row:nth-child(3) { width: 86%; }
.skel-row:nth-child(4) { width: 94%; }
.skel-row:nth-child(5) { width: 78%; }
.skel-panel {
  margin-top: 1.25rem;
  padding: 1.1rem 1.2rem;
}
@keyframes skel-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.page-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #000;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: flex-end;
}
.payments-head-actions {
  flex-shrink: 0;
}
.payments-head-actions .date-range-form.page-actions {
  /* Nested form already uses page-actions; keep it inline in the head cluster. */
  display: inline-flex;
}
.assign-modal-form .date-range-picker {
  width: 100%;
}
.assign-modal-form .date-range-controls {
  width: 100%;
}
.assign-modal-form .date-range-trigger {
  flex: 1 1 auto;
  justify-content: flex-start;
}
.export-csv-dialog {
  width: min(100%, 32rem);
}
.export-csv-form .export-csv-dates,
.export-csv-form .export-csv-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 0.85rem;
}
.export-csv-form .export-csv-dates label,
.export-csv-form .export-csv-filters label {
  margin: 0;
}
.export-csv-form input[type="date"] {
  width: 100%;
  font: inherit;
  font-weight: 500;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(16, 61, 52, 0.18);
  background: #fff;
  color: var(--ink);
}
@media (max-width: 520px) {
  .export-csv-form .export-csv-dates,
  .export-csv-form .export-csv-filters {
    grid-template-columns: 1fr;
  }
}
.toolbar-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.toolbar-form input[type="date"] {
  width: auto;
  min-width: 10.5rem;
}
.date-range-form {
  gap: 0.65rem;
  flex-wrap: wrap;
  position: relative;
}
.date-range-picker {
  position: relative;
}
.date-range-controls {
  display: inline-flex;
  align-items: stretch;
  gap: 0.35rem;
  height: 2.55rem;
}
.date-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 100%;
  margin: 0;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--panel-border-outer);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: #000;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.date-step:hover {
  border-color: rgba(26, 92, 78, 0.35);
  background: var(--ok-bg);
  color: #000;
}
.date-range-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 100%;
  min-width: 11.25rem;
  margin: 0;
  padding: 0 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--panel-border-outer);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: #000;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.date-range-trigger:hover,
.date-range-picker.is-open .date-range-trigger {
  border-color: rgba(26, 92, 78, 0.35);
  box-shadow: 0 0 0 3px rgba(26, 92, 78, 0.12);
}
.date-range-trigger .icon {
  width: 1.1em;
  height: 1.1em;
  color: #000;
}
.date-range-label {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.date-range-popover {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 40;
  width: min(20.5rem, calc(100vw - 2rem));
  padding: 0.85rem 0.9rem 0.75rem;
  border-radius: 16px;
  border: 1px solid var(--panel-border-outer);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.drp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.drp-month {
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.drp-nav {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.drp-nav:hover {
  background: var(--ok-bg);
  color: var(--accent);
}
.drp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: 0.2rem;
}
.drp-weekdays span {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.25rem 0;
}
.drp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem 0;
}
.drp-day {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  z-index: 1;
}
.drp-day::before {
  content: "";
  position: absolute;
  inset: 12% 8%;
  border-radius: 8px;
  z-index: -1;
}
.drp-day.is-outside {
  color: #b7c4c0;
}
.drp-day.is-today:not(.is-selected)::before {
  box-shadow: inset 0 0 0 1.5px rgba(26, 92, 78, 0.55);
  background: transparent;
}
.drp-day.is-in-range::before {
  background: #e8eceb;
  border-radius: 0;
  inset: 12% 0;
}
.drp-day.is-start.is-in-range::before,
.drp-day.is-start:not(.is-end)::before {
  border-radius: 8px 0 0 8px;
  inset: 12% 0 12% 8%;
}
.drp-day.is-end.is-in-range::before,
.drp-day.is-end:not(.is-start)::before {
  border-radius: 0 8px 8px 0;
  inset: 12% 8% 12% 0;
}
.drp-day.is-selected::before {
  background: var(--accent-bright);
  border-radius: 8px;
  inset: 12% 8%;
}
.drp-day.is-selected {
  color: #fff;
  font-weight: 700;
}
.drp-day.is-start:not(.is-end)::before {
  background: var(--accent-bright);
}
.drp-day.is-end:not(.is-start)::before {
  background: var(--accent-bright);
}
.drp-day.is-start:not(.is-end)::after,
.drp-day.is-end:not(.is-start)::after {
  content: "";
  position: absolute;
  top: 12%;
  bottom: 12%;
  width: 50%;
  background: #e8eceb;
  z-index: -2;
}
.drp-day.is-start:not(.is-end)::after {
  right: 0;
}
.drp-day.is-end:not(.is-start)::after {
  left: 0;
}
.drp-day:hover:not(.is-selected)::before {
  background: rgba(26, 92, 78, 0.08);
}
.drp-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}
.drp-today,
.drp-clear {
  border: 0;
  background: transparent;
  color: var(--accent-bright);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  border-radius: 8px;
}
.drp-clear {
  color: var(--muted);
}
.drp-today:hover,
.drp-clear:hover {
  background: var(--ok-bg);
}
.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.92rem;
  border-radius: 10px;
}

.panel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.panel-toolbar h2 { margin: 0; }
.panel-table {
  /* Horizontal flush with page-head so section titles share one left edge */
  padding: 1.1rem 0 0.85rem;
}
.panel-table > .dt-toolbar,
.panel-table > .panel-toolbar {
  margin-bottom: 0.95rem;
}

.find-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 1.25rem;
  row-gap: 0.35rem;
}
.find-head h1 {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  align-self: center;
}
.find-head .page-actions {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  width: 100%;
  padding-top: 0;
  margin: 0;
}
.find-head-sub {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
}
.find-live {
  position: relative;
  width: 50%;
  min-width: 18rem;
  max-width: 28rem;
  z-index: 8;
}
.find-live .find-live-input-wrap,
.find-live .dt-search-wrap {
  display: flex;
  flex: 1 1 auto;
  max-width: none;
  min-width: 0;
  width: 100%;
}
.find-live-input {
  font-size: 0.98rem;
  padding-top: 0.62rem;
  padding-bottom: 0.62rem;
  width: 100%;
}
.find-live.is-loading .find-live-input {
  opacity: 0.85;
}
.find-live-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  left: 0;
  width: 100%;
  max-width: none;
  max-height: min(28rem, 70vh);
  overflow: auto;
  padding: 0.55rem;
  border-radius: 16px;
  border: 1px solid var(--panel-border-outer);
  background: #fff;
  box-shadow: 0 14px 36px rgba(16, 61, 52, 0.14);
}
.find-live-msg {
  margin: 0;
  padding: 0.55rem 0.65rem;
}
.find-live-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.find-live-item {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: linear-gradient(180deg, #f7faf9 0%, #f3f6f5 100%);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.find-live-item:hover {
  border-color: rgba(16, 61, 52, 0.16);
  background: #fff;
  box-shadow: 0 4px 14px rgba(16, 61, 52, 0.08);
}
.find-live-item.is-inactive {
  opacity: 0.72;
}
.find-live-item-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 0.85rem;
}
.find-live-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.find-live-item-meta {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
  flex: 1 1 10rem;
}
.find-live-name {
  color: var(--ink);
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.find-live-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.3;
}
.find-live-op {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(16, 61, 52, 0.08);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}
.find-live-sep {
  opacity: 0.45;
}
.find-live-phone {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.find-live-inactive {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}
.find-live-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
  margin: 0.45rem 0.15rem 0.05rem;
  padding-top: 0.45rem;
  border-top: 1px solid #e8eceb;
}
.find-live-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.find-live-more {
  margin-left: auto;
}
.find-appt {
  position: relative;
  flex-shrink: 0;
}
.find-appt > summary {
  list-style: none;
  cursor: pointer;
}
.find-appt > summary::-webkit-details-marker {
  display: none;
}
.find-appt-form {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 16rem;
  padding: 0.55rem;
  border-radius: 12px;
  border: 1px solid var(--panel-border-outer);
  background: #fff;
  box-shadow: 0 8px 20px rgba(16, 61, 52, 0.12);
}
.find-live-empty {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  margin: 0;
  padding: 1.15rem 1rem 1.05rem;
  text-align: center;
  border-radius: 14px;
  border: 1px solid rgba(16, 61, 52, 0.1);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(26, 92, 78, 0.07), transparent 55%),
    #f8faf9;
}
.find-live-empty-mark {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(16, 61, 52, 0.12);
  color: var(--accent-bright);
  box-shadow: 0 4px 12px rgba(16, 61, 52, 0.06);
}
.find-live-empty-mark .icon {
  width: 1.15rem;
  height: 1.15rem;
}
.find-live-empty-copy {
  display: grid;
  gap: 0.28rem;
  max-width: 18rem;
}
.find-live-empty-title {
  margin: 0;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.find-live-empty-query {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}
.find-live-empty-query strong {
  display: inline-block;
  margin-left: 0.15rem;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  background: rgba(16, 61, 52, 0.08);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
}
.find-live-empty-hint {
  margin: 0.15rem 0 0;
  color: #6b7f79;
  font-size: 0.82rem;
  line-height: 1.35;
}
.find-live-empty-map {
  margin: 0.35rem 0 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.find-live-empty-map strong {
  font-weight: 800;
}
.find-live-empty-cta {
  width: auto;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
  border-radius: 10px;
  box-shadow: none;
}
.find-live-empty-cta .icon {
  width: 1rem;
  height: 1rem;
}
@media (max-width: 980px) {
  .find-head {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .find-head h1 {
    grid-column: 1;
    grid-row: 1;
  }
  .find-head .page-actions {
    grid-column: 1;
    grid-row: 2;
  }
  .find-head-sub {
    grid-column: 1;
    grid-row: 3;
  }
  .find-live {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  .find-live-panel {
    left: 0;
    right: 0;
    width: 100%;
  }
}
.table-wrap {
  overflow-x: auto;
  margin: 0;
  padding: 0;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.98rem;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  display: table-cell;
  text-align: left;
  padding: 0.78rem 1rem;
  background: #f3f4f6;
  color: #4b5563;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
}
.data-table thead th:first-child { border-radius: 13px 0 0 0; }
.data-table thead th:last-child { border-radius: 0 13px 0 0; width: 16.5rem; }
.data-table thead th.row-actions-col {
  width: 6.5rem;
}
.data-table th[data-sort="name"] {
  width: 28%;
  min-width: 10rem;
}

.data-table tbody td {
  display: table-cell;
  text-align: left;
  padding: 0.92rem 1rem;
  vertical-align: middle;
  border: 0;
  border-bottom: 1px solid #eee;
  color: var(--ink);
  background: transparent;
  background-clip: padding-box;
  transition: background 0.14s ease;
}
.data-table tbody td.balance-due {
  color: #8b1e1e;
  font-weight: 600;
}
.data-table tbody tr:nth-child(even) td {
  background: #fcfcfd;
}
.data-table tbody tr:last-child td {
  border-bottom: 0;
}
.data-table tbody tr:hover td {
  background: #f8f9fa;
}
.data-table tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 #9ca3af;
}
.data-table .empty-row {
  text-align: center;
  padding: 2rem 1rem !important;
  color: var(--muted);
  background: transparent !important;
  box-shadow: none !important;
  font-size: 0.98rem;
}

/* Data table: search / sort / pager */
[data-dt].is-loading {
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
[data-dt].is-loading .table-wrap {
  filter: saturate(0.85);
}

.dt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}
.dt-toolbar h2 {
  margin: 0;
  font-size: 1.2rem;
}
.dt-toolbar-end {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem 0.75rem;
  margin-left: auto;
  min-width: 0;
  flex: 1 1 auto;
}
.dt-toolbar-end .dt-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}
.dt-toolbar-end .dt-search-wrap {
  flex: 1 1 11rem;
  min-width: 9rem;
  max-width: 16rem;
}
.dt-toolbar-end .dt-size-wrap,
.dt-toolbar-end .dt-summary--toolbar,
.dt-toolbar-end .dt-pager--top {
  flex: 0 0 auto;
}
.dt-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.dt-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 13rem;
  flex: 1 1 13rem;
  max-width: 20rem;
}
.dt-search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--muted);
  pointer-events: none;
  opacity: 0.75;
}
.dt-search {
  width: 100%;
  padding: 0.55rem 0.8rem 0.55rem 2.15rem;
  border: 1px solid rgba(16, 61, 52, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(11, 45, 38, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dt-search::placeholder {
  color: #8aa09a;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}
.dt-search:hover { border-color: rgba(16, 61, 52, 0.22); }
.dt-search:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: none;
}
.dt-size-wrap { display: inline-flex; }
.dt-page-size {
  appearance: none;
  padding: 0.5rem 1.85rem 0.5rem 0.8rem;
  border: 1px solid rgba(16, 61, 52, 0.14);
  border-radius: 999px;
  background:
    #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23536865' d='M1.1 1.2 6 6.1l4.9-4.9 1.1 1.1L6 8.3.0 2.3z'/%3E%3C/svg%3E")
    no-repeat right 0.75rem center / 10px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(11, 45, 38, 0.04);
}
.dt-page-size:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(26, 92, 78, 0.16);
}
.dt-summary {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}
.dt-summary strong {
  color: var(--ink);
  font-weight: 600;
}
.dt-summary--toolbar {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(16, 61, 52, 0.05);
  border: 1px solid rgba(16, 61, 52, 0.08);
}

.data-table th[data-sort] {
  cursor: pointer;
  user-select: none;
  padding-right: 1.55rem;
  position: relative;
  transition: color 0.14s ease, background 0.14s ease;
}
.data-table th[data-sort]:hover {
  color: var(--accent);
  background: linear-gradient(180deg, #eaf2ef 0%, #e4ede9 100%);
}
.data-table th[data-sort]::after {
  content: "";
  position: absolute;
  right: 0.65rem;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(16, 61, 52, 0.28);
  opacity: 0.45;
}
.data-table th[data-sort].is-sorted-asc,
.data-table th[data-sort].is-sorted-desc {
  color: var(--accent);
}
.data-table th[data-sort].is-sorted-asc::after {
  border-top: none;
  border-bottom: 5px solid var(--accent-bright);
  opacity: 1;
  margin-top: -7px;
}
.data-table th[data-sort].is-sorted-desc::after {
  border-top-color: var(--accent-bright);
  opacity: 1;
}

.dt-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-top: 0.95rem;
  padding: 0.65rem 0.15rem 0.15rem;
}
.dt-pager--top {
  margin: 0;
  padding: 0;
  border: 0;
  justify-content: flex-end;
  flex: 0 0 auto;
}
.dt-pager--top .dt-summary {
  display: none;
}
.dt-pager--bottom {
  margin-top: 0.95rem;
  padding-top: 0.75rem;
  border-top: none;
}
.dt-pager-btns {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(16, 61, 52, 0.05);
  border: 1px solid rgba(16, 61, 52, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.dt-page-btn {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.dt-page-btn:hover:not([disabled]) {
  background: #fff;
  color: var(--accent-bright);
  box-shadow: 0 1px 4px rgba(11, 45, 38, 0.1);
}
.dt-page-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}
.dt-page-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  min-width: 3.75rem;
  justify-content: center;
  padding: 0.5rem 0.85rem;
  margin: 0 0.1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #edf6f2;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(16, 61, 52, 0.22);
}
.dt-page-indicator em {
  font-style: normal;
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1;
}
.dt-page-indicator span {
  opacity: 0.78;
  font-weight: 500;
  line-height: 1;
}

@media (max-width: 720px) {
  .dt-toolbar {
    align-items: stretch;
  }
  .dt-toolbar-end {
    flex-wrap: wrap;
    width: 100%;
    margin-left: 0;
  }
  .dt-toolbar-end .dt-controls {
    width: 100%;
    justify-content: flex-start;
  }
  .dt-controls {
    width: 100%;
  }
  .dt-search-wrap {
    max-width: none;
    flex: 1 1 100%;
  }
  .dt-summary--toolbar {
    display: none;
  }
  .dt-pager--top {
    width: 100%;
    justify-content: stretch;
  }
  .dt-pager--top .dt-pager-btns {
    width: 100%;
    justify-content: space-between;
  }
  .dt-pager {
    flex-direction: column;
    align-items: stretch;
  }
  .dt-pager-btns {
    justify-content: space-between;
  }
  .data-table thead th,
  .data-table tbody td {
    padding: 0.75rem 0.7rem;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.user-cell { display: grid; gap: 0.15rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.row-actions { text-align: right; white-space: nowrap; }
.empty-row,
.empty-copy {
  color: var(--muted);
  padding: 0.15rem 0 0.35rem !important;
}
.panel > .empty-copy,
.panel-table > .empty-copy {
  margin: 0;
}
.status {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  background: #eef3f1;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
}
.status-ok { background: var(--ok-bg); color: var(--ok); }
.status-warn { background: var(--warn-bg); color: var(--warn); }
.status-danger { background: var(--danger-bg); color: var(--danger); }
.form-panel {
  max-width: none;
}
.patient-detail-section {
  margin: 0 0 0.85rem;
  font-size: 1.1rem;
}
.patient-detail-panel {
  padding: 0;
}
.patient-create-appointment {
  display: grid;
  gap: 0.85rem;
}
.patient-create-appointment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.75rem;
}
.patient-create-appointment-head h2 {
  margin: 0;
  font-size: 1.1rem;
}
.patient-create-appointment-head .muted {
  font-size: 0.9rem;
}
.patient-detail-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  margin: 0;
  padding: 0;
}
.patient-detail-fact {
  min-width: 0;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--panel-border-outer);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}
.patient-detail-fact dt {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.patient-detail-fact dd {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}
.patient-detail-fact--wide {
  grid-column: 1 / -1;
}
.patient-detail-balance {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.patient-detail-balance.is-due {
  color: #8b1e1e;
}
.patient-detail-phone {
  display: block;
}
.patient-detail-phone.phone-cell .password-field {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
}
.patient-detail-phone.phone-cell .password-field__input {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
@media (max-width: 900px) {
  .patient-detail-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .patient-detail-facts {
    grid-template-columns: 1fr;
  }
}
.patient-history-table thead th:last-child {
  width: auto;
}
.patient-history-table {
  min-width: 56rem;
}
.patient-history-table th,
.patient-history-table td {
  white-space: nowrap;
}
.patient-history-table .patient-visit-notes {
  white-space: normal;
}
.patient-visit-notes {
  max-width: 18rem;
  white-space: normal;
  word-break: break-word;
  color: var(--muted);
  font-size: 0.9rem;
}
.form-stack { display: grid; gap: 1.25rem; }
.settings-form { max-width: none; }
.settings-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 14px;
  border: 1px solid var(--panel-border-outer);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.settings-tab {
  flex: 1 0 auto;
  margin: 0;
  padding: 0.55rem 0.95rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.settings-tab:hover {
  color: var(--ink);
  background: rgba(26, 92, 78, 0.06);
}
.settings-tab.is-active {
  color: #fff;
  background: var(--accent-bright);
  box-shadow: 0 4px 12px rgba(16, 61, 52, 0.18);
}
.settings-tab:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}
.settings-tab-panel { max-width: none; }
.settings-tab-panel[hidden] { display: none !important; }
.settings-tab-panel h2 { margin-top: 0; }
.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  padding-top: 0.25rem;
  border-top: 0;
}
.role-checks {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdfc;
}
.role-checks label {
  background: #fff;
}
.alert-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}
.alert-item {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}
.action-code {
  font-size: 0.88rem;
  background: #eef3f1;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}
.audit-id-link {
  font-weight: 600;
  color: var(--accent-bright);
  text-decoration: none;
}
.audit-id-link:hover {
  text-decoration: underline;
}
.audit-detail-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: rgba(26, 92, 78, 0.05);
  border: 1px solid var(--line);
}
.audit-detail-hero > div {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}
.audit-detail-hero strong {
  font-size: 1.05rem;
  word-break: break-word;
}
.audit-detail-section {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
}
.audit-detail-note {
  margin: -0.35rem 0 0;
  font-size: 0.95rem;
}
.mono-input,
textarea.mono-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  word-break: break-all;
}
@media (max-width: 720px) {
  .audit-detail-hero {
    grid-template-columns: 1fr;
  }
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: stretch;
  width: 100%;
}
.metric, .panel {
  background: var(--panel);
  border: none;
  border-radius: var(--radius);
  box-shadow: none;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
}
.metric {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.35rem;
  min-width: 0;
  margin: 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--panel-border-outer);
  background: rgba(255, 255, 255, 0.72);
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.35;
}
.metric strong {
  display: block;
  margin-top: 0;
  font-size: 1.85rem;
  font-family: var(--display);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* Payment transactions: compact money + modes + visit status */
.stats-board {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.stats-board__money {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}
.stats-board__tile {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.25rem;
  margin: 0;
  padding: 1.2rem 1.25rem;
  min-height: 7.25rem;
  min-width: 0;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--panel-border-outer);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
}
.stats-board__tile span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.3;
  order: -1;
}
.stats-board__tile strong {
  font-family: var(--display);
  font-size: clamp(1.55rem, 2.4vw, 1.9rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stats-board__tile em {
  font-style: normal;
  font-size: 0.88rem;
  color: var(--muted);
  opacity: 0.85;
}
.stats-board__tile--primary {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(232, 243, 239, 0.95));
  border-color: rgba(16, 61, 52, 0.18);
}
.stats-board__tile--primary strong {
  font-size: clamp(1.8rem, 2.8vw, 2.2rem);
  color: var(--accent);
}
.stats-board__tile--accent {
  background:
    linear-gradient(145deg, rgba(16, 61, 52, 0.94), rgba(26, 92, 78, 0.88));
  border-color: transparent;
  color: #fff;
}
.stats-board__tile--accent span,
.stats-board__tile--accent em {
  color: #fff;
  opacity: 0.8;
}
.stats-board__modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.stats-board__modes li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  margin: 0;
  padding: 0.65rem 0.95rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--panel-border-outer);
  border-radius: 999px;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
}
.stats-board__modes span {
  color: var(--muted);
  font-size: 0.9rem;
}
.stats-board__modes strong {
  font-family: var(--display);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.stats-board__modes em {
  font-style: normal;
  font-size: 0.85rem;
  color: var(--muted);
  opacity: 0.8;
  min-width: 1.25rem;
  text-align: center;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(16, 61, 52, 0.08);
}
.stats-board__ops {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--panel-border-outer);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  overflow: hidden;
}
.stats-board__ops li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.9rem 1.1rem;
  min-width: 0;
}
.stats-board__ops li + li {
  border-left: 1px solid var(--line);
}
.stats-board__ops span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.3;
}
.stats-board__ops strong {
  font-family: var(--display);
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 0 0 0.25rem;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  padding: 1.1rem 1.2rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--panel-border-outer);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  min-width: 0;
}
.stat-card__label {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.3;
}
.stat-card__value {
  font-family: var(--display);
  font-size: 1.55rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.stat-card__meta {
  font-style: normal;
  font-size: 0.9rem;
  color: var(--muted);
  opacity: 0.85;
}
.stat-card--emphasis {
  background: rgba(16, 61, 52, 0.06);
  border-color: rgba(16, 61, 52, 0.16);
}
.stat-card--emphasis .stat-card__value {
  color: var(--accent);
}

/* Flush with page-head so titles / body share one left edge; forms keep inset padding */
.panel {
  padding: 1.25rem 0;
  margin-bottom: 1rem;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.panel h2 { margin-bottom: 0.85rem; }
.queue-panel + .queue-panel {
  margin-top: 1rem;
}
.queue-panel {
  padding: 0;
  margin-bottom: 0;
}
.panel.queue-panel,
.panel.queue-panel:has(form) {
  padding: 1.25rem 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border: none;
}
.queue-tabs {
  margin-bottom: 0.65rem;
}
.queue-tabs .settings-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-align: center;
  text-transform: capitalize;
}
.queue-tab-count {
  font-size: 0.78rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.2;
}
.queue-tabs .settings-tab.is-active .queue-tab-count.status-warn {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.queue-tabs .settings-tab.is-active .queue-tab-count.status-ok,
.queue-tabs .settings-tab.is-active .queue-tab-count.status-danger {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.queue-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.queue-panel-head h2 {
  margin: 0 0 0.2rem;
}
.queue-panel-head .muted {
  margin: 0;
  font-size: 0.95rem;
}
.queue-page-size {
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.queue-panel .dt-toolbar h2 {
  margin: 0 0 0.2rem;
}
.queue-panel .dt-toolbar .muted {
  margin: 0;
  font-size: 0.95rem;
}
.queue-panel,
[data-queue-board],
[data-queue-fragment] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.queue-panel .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.queue-panel .data-table {
  width: 100%;
}
.queue-panel .data-table th,
.queue-panel .data-table td {
  white-space: nowrap;
}
.queue-live-hint {
  align-self: center;
  font-size: 0.9rem;
}

/* Doctor desk — modern ticket queue + visit instruction */
.doctor-queue-page-head .doctor-visit-eyebrow {
  margin-bottom: 0.15rem !important;
}
.doctor-queue-page-actions {
  align-items: center;
  gap: 0.65rem;
}
.doctor-queue-toolbar {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--line, rgba(16, 61, 52, 0.14));
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 61, 52, 0.04);
}
.doctor-queue-live {
  display: none;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0 0.85rem;
  min-height: 2.4rem;
  border: 0;
  border-right: 1px solid var(--line, rgba(16, 61, 52, 0.12));
  border-radius: 0;
  background: color-mix(in srgb, var(--ok, #1a7a4c) 10%, #fff);
  color: color-mix(in srgb, var(--ok, #1a7a4c) 82%, #0b2d26);
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1;
}
.doctor-queue-live:not([hidden]) {
  display: inline-flex;
}
.doctor-queue-live-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--ok, #1a7a4c);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok, #1a7a4c) 45%, transparent);
  animation: doctor-queue-pulse 1.8s ease-out infinite;
}
@keyframes doctor-queue-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok, #1a7a4c) 45%, transparent); }
  70% { box-shadow: 0 0 0 0.4rem transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.doctor-queue-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.4rem;
  padding: 0 0.95rem;
  border: 0;
  background: transparent;
  color: var(--ink, #0b2d26);
  text-decoration: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.doctor-queue-refresh .icon {
  width: 1rem;
  height: 1rem;
}
.doctor-queue-refresh:hover {
  background: color-mix(in srgb, var(--accent, #103d34) 7%, #fff);
  color: var(--accent, #103d34);
}
.doctor-queue-refresh:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent, #103d34) 45%, transparent);
  outline-offset: -2px;
}
.doctor-queue-board {
  width: 100%;
}

/* Doctor patients — card list on mobile, table on desktop */
@media (max-width: 720px) {
  .doctor-patients-panel .dt-toolbar {
    align-items: stretch;
  }
  .doctor-patients-panel .dt-toolbar-end {
    width: 100%;
    flex-wrap: wrap;
  }
  .doctor-patients-panel .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }
  .doctor-patients-panel .data-table {
    display: block;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }
  .doctor-patients-panel .data-table thead {
    display: none;
  }
  .doctor-patients-panel .data-table tbody {
    display: grid;
    gap: 0.75rem;
  }
  .doctor-patients-panel .data-table tr.doctor-patient-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "op status"
      "name name"
      "phone phone"
      "balance balance"
      "actions actions";
    gap: 0.35rem 0.75rem;
    padding: 1rem 1.05rem;
    border: 1px solid var(--panel-border-outer, #e5e7eb);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 61, 52, 0.04);
  }
  .doctor-patients-panel .data-table tr.doctor-patient-row--empty {
    grid-template-columns: 1fr;
    grid-template-areas: "empty";
    text-align: center;
  }
  .doctor-patients-panel .data-table td {
    display: block;
    width: auto;
    max-width: none;
    padding: 0;
    border: 0;
    background: transparent;
    white-space: normal;
  }
  .doctor-patients-panel .data-table td[data-col="op"] {
    grid-area: op;
    align-self: center;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 650;
    letter-spacing: 0.02em;
  }
  .doctor-patients-panel .data-table td[data-col="op"] strong {
    font-weight: 700;
    color: var(--ink);
  }
  .doctor-patients-panel .data-table td[data-col="name"] {
    grid-area: name;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
  }
  .doctor-patients-panel .data-table td[data-col="phone"] {
    grid-area: phone;
    margin-top: 0.15rem;
  }
  .doctor-patients-panel .data-table td[data-col="balance"] {
    grid-area: balance;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
  }
  .doctor-patients-panel .data-table td[data-col="balance"]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .doctor-patients-panel .data-table td[data-col="status"] {
    grid-area: status;
    justify-self: end;
    align-self: center;
  }
  .doctor-patients-panel .data-table td[data-col="actions"] {
    grid-area: actions;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.45rem;
    padding-top: 0.75rem;
    border-top: 1px solid color-mix(in srgb, var(--line, #e5e7eb) 90%, transparent);
    text-align: left;
    white-space: normal;
  }
  .doctor-patients-panel .data-table td[data-col="actions"] .btn {
    flex: 1 1 auto;
    min-width: 6.5rem;
    justify-content: center;
  }
  .doctor-patients-panel .data-table td[data-col="empty"] {
    grid-area: empty;
    padding: 1.25rem 0.5rem;
    color: var(--muted);
  }
  .doctor-patients-panel .phone-cell .password-field {
    max-width: none;
    width: 100%;
  }
}
.dq {
  width: 100%;
  max-width: none;
  display: grid;
  gap: 1.35rem;
}
.dq-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}
.dq-stat {
  display: grid;
  gap: 0.4rem;
  padding: 1.15rem 1.25rem;
  border-radius: 18px;
  border: 1px solid var(--panel-border-outer);
  background: #fff;
}
.dq-stat--accent {
  background: #fff;
  border-color: color-mix(in srgb, var(--accent) 22%, var(--panel-border-outer));
}
.dq-stat-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dq-stat-value {
  font-family: var(--display);
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.dq-stat--accent .dq-stat-value {
  color: var(--accent);
}
.dq-section {
  display: grid;
  gap: 0.75rem;
}
.dq-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0 0.1rem;
}
.dq-section-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--ink);
}
.dq-section-head .muted {
  margin: 0;
  font-size: 0.92rem;
}
.dq-now {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem 1.25rem;
  align-items: center;
  padding: 1.35rem 1.4rem;
  border-radius: 22px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--panel-border-outer);
  box-shadow: none;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.dq-now:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--panel-border-outer));
  box-shadow: none;
}
.dq-now:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.dq-now-avatar {
  display: grid;
  place-items: center;
  width: 4.1rem;
  height: 4.1rem;
  border-radius: 1.25rem;
  background: var(--accent);
  color: #fff;
  font-size: 1.85rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1;
}
.dq-now-body {
  min-width: 0;
  display: grid;
  gap: 0.28rem;
}
.dq-now-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dq-now-name {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}
.dq-now-meta {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.4;
}
.dq-now-due {
  margin: 0.25rem 0 0;
  color: var(--warn);
  font-size: 0.92rem;
  font-weight: 650;
}
.dq-now-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 3rem;
  padding: 0.7rem 1.15rem;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}
.dq-now:hover .dq-now-cta {
  background: var(--accent-bright, var(--btn-hover, #1a5c4e));
}
.dq-now-cta .icon {
  width: 1.1rem;
  height: 1.1rem;
}
.dq-wait-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 0.65rem;
}
.dq-wait-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--panel-border-outer);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dq-wait-row:hover {
  background: #fff;
  border-color: color-mix(in srgb, var(--accent) 28%, var(--panel-border-outer));
  transform: none;
}
.dq-wait-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.dq-wait-token {
  display: grid;
  place-items: center;
  min-width: 2.6rem;
  height: 2.6rem;
  padding: 0 0.45rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-2) 22%, #fff);
  border: 1px solid color-mix(in srgb, var(--accent-2) 40%, transparent);
  color: color-mix(in srgb, var(--accent-2) 35%, #2a1a00);
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  line-height: 1;
}
.dq-wait-copy {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}
.dq-wait-copy strong {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.dq-wait-copy small {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.dq-wait-open {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}
.dq-wait-open-label {
  display: inline;
}
.dq-wait-open .icon {
  width: 1rem;
  height: 1rem;
}
.dq-empty {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.9rem;
  min-height: 16rem;
  place-content: center;
  padding: 2.25rem 1.5rem;
  border-radius: 22px;
  border: 1px solid var(--panel-border-outer);
  background: #fff;
}
.dq-empty-mark {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}
.dq-empty-mark .icon {
  width: 1.45rem;
  height: 1.45rem;
}
.dq-empty-copy p {
  margin: 0 0 0.35rem;
}
.dq-empty-copy .muted {
  margin: 0 auto;
  max-width: 26rem;
  line-height: 1.45;
}

.doctor-visit-head h1 {
  font-size: clamp(1.55rem, 2.4vw, 1.95rem);
  margin-bottom: 0.2rem;
}
.doctor-visit-eyebrow {
  margin: 0 0 0.2rem !important;
  font-size: 0.82rem !important;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent) !important;
}
.doctor-visit-meta {
  margin: 0 !important;
}
.content:has(> .dv) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.content:has(> .dv)::before,
.content:has(> .dv)::after {
  display: none;
}
.dv {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 0;
}
.dv-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: grid;
  gap: 1.15rem;
  padding: 1.75rem 1rem 1rem 0;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-bright) transparent;
}
.dv-scroll::-webkit-scrollbar {
  width: 5px;
}
.dv-scroll::-webkit-scrollbar-thumb {
  background: var(--accent-bright);
  border-radius: 999px;
}
.dv-head {
  margin-bottom: 0;
}
.dv-layout {
  display: contents;
}
.dv-main,
.dv-side {
  display: contents;
  min-width: 0;
}
.dv-panel {
  padding: 1.2rem 1.25rem 1.3rem;
  border-radius: 18px;
  border: 1px solid var(--panel-border-outer);
  background: #fff;
}
.dv-panel-head {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 1rem;
}
.dv-panel-head h2 {
  margin: 0;
  font-size: 1.1rem;
}
.dv-panel-head .muted {
  margin: 0;
  font-size: 0.92rem;
}
.dv-balance {
  display: grid;
  grid-template-columns: repeat(2, minmax(10.5rem, max-content));
  gap: 0.55rem;
  justify-content: start;
}
.dv-balance-card {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--panel-border-outer);
  background: #fff;
  min-width: 10.5rem;
}
.dv-balance-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dv-balance-card strong {
  font-family: var(--display);
  font-size: 1.2rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.dv-balance-card--accent {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--panel-border-outer));
}
.dv-balance-card--accent strong {
  color: var(--accent);
}
.dv-balance-card [data-balance-after].is-invalid {
  color: var(--danger);
  font-size: 1.05rem;
}
.doctor-visit-form {
  display: grid;
  gap: 1rem;
  min-width: 0;
}
.doctor-visit-form .dv-panel {
  display: grid;
  gap: 1rem;
}
.dv-top-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 1rem;
  align-items: start;
}
.dv-notes-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.dv-field {
  display: grid;
  gap: 0.35rem;
  align-content: start;
}
.dv-notes-row > .dv-sketch-block,
.dv-notes-row > .dv-summary-field {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.45rem;
  min-width: 0;
  min-height: 16rem;
  height: 100%;
  box-sizing: border-box;
}
.dv-sketch-block {
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid var(--panel-border-outer);
  background: #fbfcfc;
}
.dv-sketch-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: 600;
}
.dv-sketch-body {
  position: relative;
  min-height: 0;
  height: 100%;
  border-radius: 12px;
  border: 1px solid var(--panel-border-outer);
  background: #fff;
  overflow: hidden;
}
.dv-sketch-empty {
  margin: 0;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  text-align: center;
  font-size: 0.88rem;
  pointer-events: none;
}
.dv-sketch-empty[hidden] {
  display: none !important;
}
.dv-notes-row .dv-sketch-preview {
  height: 100%;
  min-height: 0;
  max-height: none;
  margin: 0;
}
.dv-notes-row .dv-sketch-preview[hidden] {
  display: none !important;
}
.dv-notes-row .dv-sketch-preview img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  border: none;
  border-radius: 0;
  background: #fff;
}
.dv-notes-row .dv-summary-field {
  margin: 0;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid var(--panel-border-outer);
  background: #fbfcfc;
}
.dv-notes-row .dv-summary-field textarea {
  min-height: 0;
  height: 100%;
  resize: none;
}
.doctor-visit-form .doctor-visit-send {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--panel-border-outer);
  background: #f7faf8;
  margin: 0;
}
.dv-sticky-bar {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  padding: 0.75rem 1rem 0.15rem 0;
  margin-top: auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.96) 28%, #fff 100%);
  border-top: 1px solid rgba(16, 61, 52, 0.1);
}
.dv-sticky-bar .doctor-visit-submit {
  box-shadow: 0 10px 28px rgba(11, 45, 38, 0.18);
}
.dv-actions {
  display: flex;
  justify-content: flex-start;
}
.doctor-visit-submit {
  min-height: 2.85rem;
  padding-inline: 1.35rem;
  font-size: 1.02rem;
  flex-shrink: 0;
}
.dv-summary-field {
  display: grid;
  gap: 0.45rem;
}
.dv-summary-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.dv-summary-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.dv-mic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--panel-border-outer);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.dv-mic-btn .icon {
  width: 1.1rem;
  height: 1.1rem;
}
.dv-mic-btn:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--panel-border-outer));
  color: var(--accent);
}
.dv-mic-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}
.dv-mic-btn.is-recording {
  background: color-mix(in srgb, var(--danger, #c0392b) 12%, #fff);
  border-color: color-mix(in srgb, var(--danger, #c0392b) 45%, var(--panel-border-outer));
  color: var(--danger, #c0392b);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger, #c0392b) 16%, transparent);
  animation: dv-mic-pulse 1.4s ease-in-out infinite;
}
.dv-mic-btn.is-busy {
  opacity: 0.65;
  cursor: wait;
}
.dv-mic-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}
.dv-mic-status {
  min-height: 1.1em;
  font-size: 0.85rem;
}
.dv-sketch-preview {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.15rem;
}
.dv-sketch-preview[hidden] {
  display: none !important;
}
.dv-sketch-preview__label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
}
.dv-sketch-preview img {
  display: block;
  width: 100%;
  max-height: 14rem;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--panel-border-outer);
  background: #fff;
}
.dv-sketch-preview img[hidden] {
  display: none !important;
}
.dv-op-upload {
  display: grid;
  gap: 0.4rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  min-width: 0;
  align-content: start;
}
.dv-op-upload__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.dv-top-row .dv-op-upload__pick,
.dv-top-row .dv-op-upload__row > .btn {
  flex: 1 1 auto;
  justify-content: center;
  white-space: nowrap;
}
.dv-op-upload__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.dv-op-upload__label {
  font-weight: 600;
  color: var(--ink);
}
.dv-op-upload__hint {
  margin: 0;
  font-size: 0.9rem;
  text-align: right;
}
.dv-op-upload__pick {
  cursor: pointer;
  margin: 0;
}
.dv-op-upload__status {
  font-size: 0.85rem;
  min-height: 1.1em;
}
.dv-op-upload__preview {
  margin-top: 0.25rem;
}
.dv-op-upload__preview[hidden] {
  display: none !important;
}
.dv-op-upload__preview img {
  display: block;
  width: 100%;
  max-height: 16rem;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--panel-border-outer);
  background: #fff;
}
.dv-op-upload__preview img[hidden] {
  display: none !important;
}
body.dv-camera-open {
  overflow: hidden;
}
.dv-camera-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(8, 28, 24, 0.72);
}
.dv-camera-modal[hidden] {
  display: none !important;
}
.dv-camera-modal__panel {
  width: min(100%, 52rem);
  max-height: min(100dvh, 44rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(16, 61, 52, 0.12);
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(8, 28, 24, 0.28);
}
.dv-camera-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid rgba(16, 61, 52, 0.1);
}
.dv-camera-modal__head h2 {
  margin: 0;
  font-size: 1.15rem;
}
.dv-camera-modal__head .muted {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
}
.dv-camera-modal__stage {
  min-height: 16rem;
  background: #0b1f1b;
  display: grid;
  place-items: center;
}
.dv-camera-modal__stage video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(60dvh, 28rem);
  object-fit: cover;
  background: #000;
}
.dv-camera-modal__foot {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.9rem 1.15rem;
  border-top: 1px solid rgba(16, 61, 52, 0.1);
  background: #fff;
}
body.dv-sketch-open .dv-sticky-bar,
body.dv-camera-open .dv-sticky-bar {
  display: none;
}
body.dv-sketch-open {
  overflow: hidden;
}
.dv-sketch-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  background: #ffffff;
}
.dv-sketch-modal[hidden] {
  display: none !important;
}
.dv-sketch-modal__panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100dvh;
  height: 100%;
  background: #ffffff;
}
.dv-sketch-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid rgba(16, 61, 52, 0.1);
  background: #ffffff;
}
.dv-sketch-modal__head h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #111;
}
.dv-sketch-modal__head .muted {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
}
.dv-sketch-modal__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dv-sketch-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(16, 61, 52, 0.14);
  background: #fff;
  color: #111;
  cursor: pointer;
}
.dv-sketch-modal__close .icon {
  width: 1.15rem;
  height: 1.15rem;
}
.dv-sketch-modal__close:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, rgba(16, 61, 52, 0.14));
  color: var(--accent);
}
.dv-sketch-modal__stage {
  min-height: 0;
  background: #ffffff;
  padding: 0;
}
.dv-sketch-modal__stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #ffffff;
  cursor: crosshair;
  touch-action: none;
}
@keyframes dv-mic-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger, #c0392b) 12%, transparent);
  }
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger, #c0392b) 18%, transparent);
  }
}
.dv-history .doctor-visit-history-list {
  max-height: none;
  overflow: visible;
}
.doctor-visit-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.doctor-visit-history-item {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--panel-border-outer);
  background: #fff;
}
.doctor-visit-history-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
  margin-bottom: 0.35rem;
}
.doctor-visit-history-when {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}
.doctor-visit-history-summary {
  margin: 0 0 0.25rem;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.4;
}
.doctor-visit-history-meta {
  margin: 0;
  font-size: 0.88rem;
}
.doctor-visit-history-empty {
  margin: 0;
  padding: 0.35rem 0;
}
@media (max-width: 980px) {
  .content:has(> .dv) {
    display: block;
    overflow: visible;
    height: auto;
  }
  .dv {
    display: block;
  }
  .dv-scroll {
    overflow: visible;
    padding: 0;
  }
  .dv-layout {
    display: contents;
  }
  .dv-top-row {
    grid-template-columns: 1fr;
  }
  .dv-notes-row {
    grid-template-columns: 1fr;
  }
  .dv-balance {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dv-balance-card {
    min-width: 0;
  }
  .dv-sticky-bar {
    position: sticky;
    bottom: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem 0;
    justify-content: flex-end;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(16, 61, 52, 0.1);
  }
}
@media (max-width: 640px) {
  .dv-balance {
    grid-template-columns: 1fr;
  }
  .dv-sticky-bar {
    justify-content: stretch;
  }
  .doctor-visit-submit {
    width: 100%;
    justify-content: center;
  }
}
.doctor-patients {
  max-width: 42rem;
}
.doctor-patients-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1.15rem;
  max-width: 42rem;
}
.doctor-patients-search {
  flex: 1 1 16rem;
  min-width: 0;
}
.doctor-patients-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}
.doctor-patient-facts {
  max-width: 42rem;
  margin-bottom: 1.25rem;
}
.doctor-patient-history {
  max-width: 42rem;
}
.doctor-consult-panel,
.doctor-visit-history-panel {
  margin-bottom: 1.25rem;
}
.doctor-consult-facts {
  padding: 0 0 0.35rem;
}
.doctor-consult-summary {
  white-space: pre-wrap;
  line-height: 1.45;
}
.doctor-consult-actions {
  padding: 0.25rem 0 0.85rem;
}
.doctor-consult-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.doctor-consult-history-item {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--panel-border-outer);
  background: rgba(255, 255, 255, 0.72);
}
.doctor-consult-history-item.is-open {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--panel-border-outer));
}
.doctor-consult-history-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem 1rem;
  margin-bottom: 0.65rem;
}
.doctor-consult-history-when {
  display: block;
  font-weight: 700;
  color: var(--ink);
  font-size: 1rem;
}
.doctor-consult-history-meta {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
}
.doctor-consult-history-badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.doctor-consult-history-summary {
  margin: 0 0 0.75rem;
  line-height: 1.45;
  color: var(--ink);
}
.doctor-consult-history-summary strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.doctor-consult-history-amounts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem 1rem;
  margin: 0;
}
.doctor-consult-history-amounts div {
  min-width: 0;
}
.doctor-consult-history-amounts dt {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.doctor-consult-history-amounts dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
@media (max-width: 860px) {
  .doctor-consult-history-amounts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 860px) {
  .dq-stats {
    grid-template-columns: 1fr;
  }
  .dq-now {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .dq-now-cta {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .dq-now-avatar {
    width: 3.35rem;
    height: 3.35rem;
    border-radius: 1rem;
    font-size: 1.5rem;
  }
  .dq-wait-list {
    grid-template-columns: 1fr;
  }
  .dq-wait-row {
    gap: 0.65rem;
    padding: 0.85rem 0.8rem;
  }
  .dq-wait-token {
    min-width: 2.75rem;
    height: 2.75rem;
    font-size: 1.05rem;
    color: #5c3d08;
    background: #f3e6c8;
    border-color: #e0c788;
  }
  .dq-wait-copy strong {
    font-size: 1.05rem;
  }
  .dq-wait-copy small {
    font-size: 0.9rem;
  }
  .dq-wait-open-label {
    display: none;
  }
  .doctor-visit-metrics {
    grid-template-columns: 1fr;
    max-width: none;
  }
  .doctor-consult-history-amounts {
    grid-template-columns: 1fr;
  }
}

.queue-action-stack {
  position: relative;
  z-index: 2;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
  pointer-events: auto;
}
.queue-action-stack a,
.queue-action-stack button,
.queue-action-stack .inline-form {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}
.queue-action-stack .inline-form {
  display: inline-flex;
  margin: 0;
}
.queue-action-menu {
  position: relative;
}
.queue-action-menu > summary {
  list-style: none;
  cursor: pointer;
}
.queue-action-menu > summary::-webkit-details-marker {
  display: none;
}
.queue-action-menu[open] > .queue-reassign-form,
.queue-action-menu[open] > .queue-cancel-form {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  padding: 0.65rem;
  min-width: 12rem;
  max-width: min(18rem, 80vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.queue-cancel-form input,
.queue-cancel-form select,
.queue-reassign-form select,
.queue-reassign-form input {
  width: 100%;
  min-width: 0;
}
@media (max-width: 860px) {
  .queue-action-menu[open] > .queue-reassign-form,
  .queue-action-menu[open] > .queue-cancel-form {
    position: static;
    right: auto;
    top: auto;
    max-width: none;
    margin-top: 0.35rem;
    box-shadow: none;
  }
}
[data-queue-board].is-loading {
  opacity: 0.72;
  pointer-events: none;
}
.receipt-sheet {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.75rem 1.85rem 1.35rem;
  background: #fff;
  border: 1px solid var(--panel-border-outer);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.receipt-form {
  --receipt-ink: #1e3a5f;
  --receipt-line: #1e3a5f;
  color: var(--receipt-ink);
  font-family: "Manrope", sans-serif;
}
.receipt-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.receipt-form-head h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--receipt-ink);
  line-height: 1;
}
.receipt-form-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-align: left;
  max-width: 16rem;
}
.receipt-form-logo {
  width: 2.75rem;
  height: 2.75rem;
  object-fit: contain;
  flex: 0 0 auto;
}
.receipt-form-logo-fallback {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--receipt-ink);
  border-radius: 6px;
  color: var(--receipt-ink);
  flex: 0 0 auto;
}
.receipt-form-logo-fallback .icon {
  width: 1.35rem;
  height: 1.35rem;
}
.receipt-form-brand strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}
.receipt-form-brand span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--receipt-ink) 72%, #fff);
  line-height: 1.3;
}
.receipt-form-fields {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}
.receipt-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 2rem;
}
.receipt-form-row--full {
  grid-template-columns: 1fr;
}
.receipt-form-row label {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--receipt-ink);
}
.receipt-form-row label span {
  flex: 1 1 auto;
  min-width: 3rem;
  padding: 0.1rem 0.15rem 0.2rem;
  border-bottom: 1.5px solid var(--receipt-line);
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}
.receipt-form-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1.5px solid var(--receipt-line);
  margin: 0;
}
.receipt-form-table th,
.receipt-form-table td {
  border: 1px solid var(--receipt-line);
  padding: 0.55rem 0.6rem;
  vertical-align: top;
  color: var(--receipt-ink);
  background: #fff;
}
.receipt-form-table thead th {
  text-align: center;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.65rem 0.5rem;
}
.receipt-form-table .col-qty {
  width: 4.25rem;
  text-align: center;
}
.receipt-form-table .col-desc {
  width: auto;
  text-align: left;
}
.receipt-form-table .col-price,
.receipt-form-table .col-amount {
  width: 7.25rem;
  text-align: right;
}
.receipt-form-table td.col-desc {
  font-weight: 500;
}
.receipt-form-table td.col-desc small {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--receipt-ink) 68%, #fff);
}
.receipt-form-blank td {
  height: 2.15rem;
}
.receipt-form-totals {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.85rem;
  padding: 0 0.15rem;
}
.receipt-form-total-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  min-width: 12rem;
  justify-content: flex-start;
}
.receipt-form-total-row--end {
  margin-left: auto;
  justify-content: flex-end;
}
.receipt-form-total-row span {
  font-size: 0.98rem;
  font-weight: 700;
}
.receipt-form-total-row strong {
  min-width: 7.25rem;
  padding: 0.1rem 0.15rem 0.2rem;
  border-bottom: 1.5px solid var(--receipt-line);
  text-align: left;
  font-size: 1.05rem;
  font-weight: 700;
}
.receipt-form-total-row--end strong {
  text-align: right;
}
.receipt-form-total-row.is-due span,
.receipt-form-total-row.is-due strong {
  color: #8b1e1e;
  border-bottom-color: #8b1e1e;
}
.receipt-form-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--receipt-line) 35%, #fff);
  font-size: 0.86rem;
  color: color-mix(in srgb, var(--receipt-ink) 78%, #fff);
}
.receipt-form-foot p {
  margin: 0 0 0.25rem;
  font-size: inherit;
  color: inherit;
}
.receipt-form-foot > div:last-child {
  text-align: right;
}
.receipt-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}
@media (max-width: 640px) {
  .receipt-form-head {
    flex-direction: column;
  }
  .receipt-form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .receipt-form-table .col-price,
  .receipt-form-table .col-amount {
    width: 5.5rem;
  }
  .receipt-form-foot {
    grid-template-columns: 1fr;
  }
  .receipt-form-foot > div:last-child {
    text-align: left;
  }
}
@media print {
  body {
    background: #fff !important;
  }
  .no-print,
  .shell .sidebar,
  .shell .mobile-nav-toggle,
  .shell .sidebar-backdrop,
  .sidebar-foot,
  .page-head.no-print,
  .receipt-actions.no-print,
  .flash-stack,
  .toast-host,
  [data-toast-root] {
    display: none !important;
  }
  .shell {
    display: block;
    height: auto;
    overflow: visible;
  }
  .shell .content {
    padding: 0.75rem !important;
    max-width: none;
    margin: 0;
    height: auto;
    overflow: visible;
  }
  .content::before,
  .content::after {
    display: none !important;
  }
  .receipt-sheet {
    border: none;
    box-shadow: none;
    max-width: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
  }
  .receipt-form,
  .receipt-form-table th,
  .receipt-form-table td,
  .receipt-form-total-row.is-due span,
  .receipt-form-total-row.is-due strong {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
.panel.form-panel,
.auth-card,
.panel:has(form) {
  padding: 1.25rem;
  background: var(--panel);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
    box-shadow: none;
  border: none;
}
.content > .panel:last-child,
.content > .panel-table:last-child,
.content > [data-portal-ajax-root]:last-child,
.content > .flash-stack:last-child {
  margin-bottom: 0;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.75rem 0.45rem; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 1.02rem; }
th { color: var(--muted); font-weight: 600; font-size: 0.98rem; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.auth-card {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.62);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: none;
  border: none;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
}
.auth-card-login {
  width: min(480px, 100%);
  padding: 2.25rem 2.1rem 1.9rem;
  text-align: center;
}
.auth-brand {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
  text-align: left;
}
.auth-brand--logo-only {
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  text-align: center;
}
.auth-brand--logo-only .auth-brand-mark {
  width: auto;
  height: auto;
  max-width: min(220px, 70vw);
  max-height: 112px;
  border-radius: 18px;
  background: transparent;
  overflow: visible;
}
.auth-brand--logo-only .auth-brand-mark img {
  width: auto;
  height: auto;
  max-width: min(220px, 70vw);
  max-height: 112px;
  object-fit: contain;
  display: block;
  background: transparent;
  padding: 0;
  border-radius: 12px;
}
.auth-brand--logo-only .auth-brand-mark .icon {
  width: 2.4rem;
  height: 2.4rem;
}
.auth-brand--logo-only .auth-brand-mark:not(:has(img)) {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--accent-2), #d4962f);
  display: grid;
  place-items: center;
}
.auth-panel-name {
  margin: 0 !important;
  font-size: 1.15rem !important;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  text-align: center;
}
.auth-brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  background: linear-gradient(145deg, var(--accent-2), #d4962f);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.auth-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.auth-brand-mark .icon { width: 1.55rem; height: 1.55rem; color: #fff; }
.auth-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.auth-card-login h1 {
  margin: 0.1rem 0 0;
  font-size: clamp(1.25rem, 2.8vw, 1.45rem);
}
.auth-card.auth-card-login h1 {
  font-size: clamp(1.25rem, 2.8vw, 1.45rem);
}
.auth-lead {
  margin: 0 0 0.25rem;
  line-height: 1.45;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}
.auth-form { margin-top: 1.15rem; text-align: left; }
.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus,
.auth-form input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: #000 !important;
  caret-color: #000;
  transition: background-color 99999s ease-out 0s;
}
.auth-password-block { display: grid; gap: 0.35rem; }
.auth-password-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}
.auth-password-row label {
  margin: 0;
  font-weight: 600;
  font-size: 1.02rem;
}
.auth-forgot {
  font-size: 0.98rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.auth-forgot .icon { width: 1rem; height: 1rem; }
.auth-footnote a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
}
.auth-footnote .icon { width: 1rem; height: 1rem; }
.auth-submit { width: 100%; margin-top: 0.25rem; }
.auth-footnote {
  margin: 1.1rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}
.auth-alt-login {
  width: 100%;
  margin-top: 0.85rem;
  text-decoration: none;
}
.auth-desk-links {
  margin-top: 1.5rem;
  padding-top: 0;
  border-top: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  text-align: left;
}
.auth-desk-links__label {
  display: none;
}
.auth-desk-link {
  --desk-tint: #1a5c4e;
  --desk-icon-bg: #1a5c4e;
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 0;
  padding: 0.75rem 0.8rem;
  border-radius: 18px;
  border: 1px solid rgba(16, 61, 52, 0.08);
  background: #fff;
  box-shadow:
    0 1px 2px rgba(11, 45, 38, 0.04),
    0 8px 20px rgba(11, 45, 38, 0.06);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}
.auth-desk-link::before {
  display: none;
}
.auth-desk-link--reception {
  --desk-tint: #1a5c4e;
  --desk-icon-bg: linear-gradient(145deg, #1f6b5b, #154a40);
}
.auth-desk-link--doctor {
  --desk-tint: #c98928;
  --desk-icon-bg: linear-gradient(145deg, #e5a138, #c07f1c);
}
.auth-desk-link--portal {
  --desk-tint: #103d34;
  --desk-icon-bg: linear-gradient(145deg, #164a40, #0d322b);
}
.auth-desk-link:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--desk-tint) 22%, transparent);
  box-shadow:
    0 2px 4px rgba(11, 45, 38, 0.05),
    0 14px 28px rgba(11, 45, 38, 0.1);
}
.auth-desk-link:focus-visible {
  outline: 2px solid var(--desk-tint);
  outline-offset: 2px;
}
.auth-desk-link__icon {
  position: relative;
  z-index: 1;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--desk-icon-bg);
  color: #fff;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--desk-tint) 28%, transparent);
}
.auth-desk-link__icon .icon {
  width: 1.15rem;
  height: 1.15rem;
  stroke: #fff;
  stroke-width: 1.9;
  color: #fff;
}
.auth-desk-link__copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  flex: 1 1 auto;
  padding-right: 0;
}
.auth-desk-link__copy strong {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #0f1f1b;
}
.auth-desk-link__copy small {
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(15, 31, 27, 0.52);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.auth-desk-link__chevron {
  display: none;
}
@media (max-width: 420px) {
  .auth-desk-links {
    grid-template-columns: 1fr;
  }
}
.auth-debug-box {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: var(--ok-bg);
  border: 1px solid var(--line);
  word-break: break-all;
  font-size: 0.98rem;
  text-align: center;
}
.auth-debug-box p { margin: 0 0 0.35rem; text-align: center; }
.auth-card h1 { font-size: 2.2rem; text-align: center; }
.auth-card > p,
.auth-card .error-text,
.auth-card .muted {
  text-align: center;
}
.enrol-qr {
  display: grid;
  place-items: center;
  margin: 1.25rem auto 0.5rem;
  padding: 0.85rem;
  width: fit-content;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.auth-card-recovery .auth-lead {
  margin-bottom: 0.45rem;
}
.recovery-desc {
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-2) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--accent-2) 22%, transparent);
  font-size: 0.82rem;
  line-height: 1.45;
  color: color-mix(in srgb, var(--ink) 72%, transparent);
  text-align: left;
}
.auth-brand-mark--key {
  width: 52px !important;
  height: 52px !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 14px !important;
  background: linear-gradient(145deg, #e5a138, #c07f1c) !important;
  display: grid !important;
  place-items: center;
}
.auth-brand-mark--key .icon {
  width: 1.35rem;
  height: 1.35rem;
  color: #fff;
  stroke: #fff;
}
.recovery-codes {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  background: color-mix(in srgb, var(--accent) 5%, #fff);
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: 16px;
  text-align: left;
}
.recovery-codes li {
  margin: 0;
  padding: 0;
}
.recovery-codes code {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-align: center;
  box-shadow: 0 1px 2px rgba(11, 45, 38, 0.03);
}
.recovery-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.recovery-actions .btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  margin: 0;
}
.auth-card-recovery .auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  margin-top: 0;
}
@media (max-width: 420px) {
  .recovery-codes,
  .recovery-actions {
    grid-template-columns: 1fr;
  }
}
.enrol-qr img {
  display: block;
  width: 220px;
  height: 220px;
}
.enrol-manual {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.enrol-manual summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}
.enrol-manual code {
  display: inline-block;
  margin-top: 0.35rem;
  word-break: break-all;
}
.otp-field {
  display: grid;
  gap: 0.55rem;
}
.otp-label { font-weight: 600; font-size: 1.02rem; color: #000; }
.otp-digits {
  display: flex;
  gap: 0.45rem;
  justify-content: space-between;
}
.otp-digit {
  width: 3rem;
  height: 3.35rem;
  text-align: center;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-family: var(--font);
  color: #000;
  padding: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.otp-digit:hover {
  border-color: rgba(26, 92, 78, 0.35);
  background: #f7fbf9;
}
.otp-digit:focus {
  outline: none;
  border-color: var(--accent-bright);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 92, 78, 0.14);
}
.stack { display: grid; gap: 0.85rem; margin-top: 1.25rem; }

.step-up-card {
  width: min(34rem, 100%);
  margin-left: auto;
  margin-right: auto;
  padding: 1.5rem 1.5rem 1.35rem;
  background: #fff;
  border-radius: 18px;
}
.step-up-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 1.15rem;
  padding: 1rem 1.05rem;
  border-radius: 14px;
  background: var(--ok-bg);
}
.step-up-banner strong {
  display: block;
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  color: #000;
}
.step-up-banner .muted {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #000;
}
.step-up-mark {
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-bright);
  color: #fff;
}
.step-up-mark .icon {
  width: 1.25rem;
  height: 1.25rem;
  color: #fff;
}
.step-up-form {
  margin-top: 0;
  gap: 1rem;
}
.step-up-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #6b7f79;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.step-up-divider::before,
.step-up-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.step-up-recovery input {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.step-up-submit {
  width: 100%;
  justify-content: center;
  margin-top: 0.25rem;
  min-height: 3rem;
}

label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 1.02rem; }
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  font: inherit;
  font-size: 1.05rem;
  color: #000;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea {
  min-height: 5.5rem;
  resize: vertical;
  line-height: 1.4;
}
.password-field {
  position: relative;
  display: block;
  width: 100%;
}
.password-field__input {
  padding-right: 2.9rem;
}
.password-field__input--masked {
  -webkit-text-security: disc;
  text-security: disc;
}
.password-field__toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #6b7f79;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.password-field__toggle .icon {
  width: 1.15rem;
  height: 1.15rem;
}
.password-field__toggle:hover {
  background: rgba(16, 61, 52, 0.08);
  color: var(--accent);
}
.password-field__toggle:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 1px;
}
.password-field__toggle[aria-pressed="true"] {
  color: var(--accent-bright);
}
.phone-cell {
  min-width: 9.5rem;
  white-space: nowrap;
}
.phone-cell .password-field {
  display: inline-block;
  width: auto;
  min-width: 8.75rem;
  max-width: 11rem;
  vertical-align: middle;
}
.phone-cell .password-field__input {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.2rem 2rem 0.2rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font: inherit;
  letter-spacing: 0.02em;
  cursor: default;
}
.phone-cell .password-field__input:hover,
.phone-cell .password-field__input:focus {
  border: 0;
  box-shadow: none;
  outline: none;
}
.phone-cell .password-field__toggle {
  width: 1.7rem;
  height: 1.7rem;
  right: 0;
}
input:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: rgba(16, 61, 52, 0.28);
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(26, 92, 78, 0.14);
}
select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 2.6rem 0.85rem 0.95rem;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  color: #000;
  line-height: 1.35;
  cursor: pointer;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%231a5c4e' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 1rem;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
select:hover:not(:disabled) {
  border-color: rgba(26, 92, 78, 0.35);
  background-color: #f7fbf9;
}
select:focus {
  outline: none;
  border-color: var(--accent-bright);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(26, 92, 78, 0.14);
}
select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background-color: #f3f6f5;
}
select option {
  color: #000;
  background: #fff;
  font-weight: 500;
}

/* Custom dropdown (enhances native <select>) */
.cselect {
  position: relative;
  display: block;
  width: 100%;
}
.cselect-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  background: none !important;
  box-shadow: none !important;
}
.cselect-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.cselect-trigger:hover:not(:disabled) {
  border-color: rgba(26, 92, 78, 0.35);
  background: #f7fbf9;
}
.cselect-trigger:focus-visible {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(26, 92, 78, 0.14);
}
.cselect.is-open .cselect-trigger {
  border-color: var(--accent-bright);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 92, 78, 0.14);
}
.cselect.is-disabled .cselect-trigger,
.cselect-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #f3f6f5;
}
.cselect-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cselect-label.is-placeholder {
  color: #6b7f79;
}
.cselect-chevron {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%231a5c4e' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
  transition: transform 0.18s ease;
}
.cselect.is-open .cselect-chevron {
  transform: rotate(180deg);
}
.cselect-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  z-index: 80;
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding: 0.4rem;
  max-height: min(17rem, 50vh);
  overflow: auto;
  border: 1px solid rgba(16, 61, 52, 0.14);
  border-radius: 14px;
  background: #fff;
  box-shadow:
    0 18px 40px rgba(11, 45, 38, 0.14),
    0 4px 12px rgba(11, 45, 38, 0.06);
}
.cselect-menu[hidden] {
  display: none !important;
}
.cselect-option {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #000;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.cselect-option:hover:not(:disabled),
.cselect-option:focus-visible {
  outline: none;
  background: var(--ok-bg);
  color: #000;
}
.cselect-option.is-selected {
  background: var(--accent-bright);
  color: #fff;
  font-weight: 600;
}
.cselect-option.is-selected:hover:not(:disabled),
.cselect-option.is-selected:focus-visible {
  background: var(--accent);
  color: #fff;
}
.cselect-option.is-disabled,
.cselect-option:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.cselect--compact,
.cselect--pill {
  width: auto;
  min-width: 6.5rem;
}
.cselect--compact .cselect-trigger,
.cselect--pill .cselect-trigger {
  padding: 0.45rem 0.75rem;
  font-size: 0.95rem;
  border-radius: 10px;
}
.cselect--pill .cselect-trigger {
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
}
.cselect--compact .cselect-menu,
.cselect--pill .cselect-menu {
  min-width: 100%;
  width: max-content;
  right: auto;
}
.cselect--pill .cselect-menu {
  border-radius: 14px;
}
.cselect--compact .cselect-option,
.cselect--pill .cselect-option {
  padding: 0.55rem 0.75rem;
  font-size: 0.92rem;
  white-space: nowrap;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}
.gender-checks {
  align-content: start;
  align-self: start;
}
.gender-checks > strong {
  font-weight: 600;
  font-size: 1.02rem;
}
.gender-checks label {
  padding: 0.65rem 0.85rem;
}
.checks > strong {
  display: block;
  flex: 0 0 100%;
  margin: 0 0 0.1rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: #000;
}
.checks label,
label.checks {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: max-content;
  max-width: 100%;
  justify-self: start;
  margin: 0;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.35;
  color: #000;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}
.checks label:hover,
label.checks:hover {
  border-color: rgba(26, 92, 78, 0.32);
  background: #f7fbf9;
}
.checks label:has(input:checked),
label.checks:has(input:checked) {
  border-color: rgba(26, 92, 78, 0.45);
  background: var(--ok-bg);
  box-shadow: inset 0 0 0 1px rgba(26, 92, 78, 0.08);
}
.checks label:has(input:focus-visible),
label.checks:has(input:focus-visible) {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(26, 92, 78, 0.14);
}
.checks input[type="checkbox"],
.checks input[type="radio"],
label.checks input[type="checkbox"],
label.checks input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  border: 2px solid #b7c9c2;
  background: #fff;
  box-shadow: none;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}
.checks input[type="checkbox"],
label.checks input[type="checkbox"] {
  border-radius: 6px;
}
.checks input[type="radio"],
label.checks input[type="radio"] {
  border-radius: 50%;
}
.checks input[type="checkbox"]::after,
label.checks input[type="checkbox"]::after {
  content: "";
  width: 0.32rem;
  height: 0.58rem;
  margin-top: -0.1rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform 0.12s ease;
}
.checks input[type="radio"]::after,
label.checks input[type="radio"]::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform 0.12s ease;
}
.checks input[type="checkbox"]:checked,
.checks input[type="radio"]:checked,
label.checks input[type="checkbox"]:checked,
label.checks input[type="radio"]:checked {
  border-color: var(--accent-bright);
  background: var(--accent-bright);
}
.checks input[type="checkbox"]:checked::after,
.checks input[type="radio"]:checked::after,
label.checks input[type="checkbox"]:checked::after,
label.checks input[type="radio"]:checked::after {
  transform: rotate(45deg) scale(1);
}
.checks input[type="radio"]:checked::after,
label.checks input[type="radio"]:checked::after {
  transform: scale(1);
}
.checks input[type="checkbox"]:disabled,
.checks input[type="radio"]:disabled,
label.checks input[type="checkbox"]:disabled,
label.checks input[type="radio"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.checks label:has(input:disabled),
label.checks:has(input:disabled) {
  opacity: 0.65;
  cursor: not-allowed;
}

.flash-stack { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.flash { padding: 0.8rem 1rem; border-radius: 12px; background: var(--ok-bg); color: var(--ok); }
.flash.error, .flash.warning { background: var(--warn-bg); color: var(--warn); }
.flash.error { background: var(--danger-bg); color: var(--danger); }
.error-text { color: var(--danger); }

/* Bottom-center toast messages (portal + reception) */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px) + 1rem);
  z-index: 120;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.65rem;
  width: min(calc(100vw - 1.5rem), 26rem);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 0.7rem;
  width: 100%;
  padding: 0.85rem 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(16, 61, 52, 0.1);
  background: rgba(255, 255, 255, 0.92);
  color: #0b2d26;
  box-shadow:
    0 16px 40px rgba(8, 28, 24, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  animation: toast-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.toast.is-leaving {
  animation: toast-out 0.26s ease forwards;
}
.toast-icon {
  display: inline-grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  margin-top: 0.05rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.toast-icon .icon {
  width: 1.05rem;
  height: 1.05rem;
}
.toast-message {
  margin: 0;
  padding-top: 0.28rem;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.4;
}
.toast-close {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6b7f79;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.toast-close .icon {
  width: 0.95rem;
  height: 0.95rem;
}
.toast-close:hover {
  background: rgba(16, 61, 52, 0.08);
  color: #0b2d26;
}
.toast--success {
  border-color: rgba(26, 92, 78, 0.18);
}
.toast--success .toast-icon {
  background: var(--ok-bg);
  color: var(--ok);
}
.toast--error {
  border-color: rgba(178, 97, 90, 0.22);
}
.toast--error .toast-icon {
  background: var(--danger-bg);
  color: var(--danger);
}
.toast--warning {
  border-color: rgba(184, 131, 31, 0.22);
}
.toast--warning .toast-icon {
  background: var(--warn-bg);
  color: var(--warn);
}
.toast--info,
.toast--debug {
  border-color: rgba(16, 61, 52, 0.12);
}
.toast--info .toast-icon,
.toast--debug .toast-icon {
  background: #eef4f2;
  color: var(--accent-bright);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(0.9rem) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(0.55rem) scale(0.98);
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-leaving {
    animation: none;
  }
  .sidebar,
  .sidebar-backdrop {
    transition: none;
  }
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid--patient {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.form-grid--patient > .col-3,
.form-grid--patient > label.col-3,
.form-grid--patient > .col-2,
.form-grid--patient > label.col-2,
.form-grid--patient > .checks.col-2 {
  min-width: 0;
}
.form-grid--patient > .col-3,
.form-grid--patient > label.col-3 { grid-column: span 3; }
.form-grid--patient > .col-2,
.form-grid--patient > label.col-2,
.form-grid--patient > .checks.col-2 { grid-column: span 2; }
.form-grid--patient > .full { grid-column: 1 / -1; }
@media (max-width: 720px) {
  .form-grid--patient {
    grid-template-columns: 1fr;
  }
  .form-grid--patient > .col-3,
  .form-grid--patient > label.col-3,
  .form-grid--patient > .col-2,
  .form-grid--patient > label.col-2,
  .form-grid--patient > .checks.col-2,
  .form-grid--patient > .full {
    grid-column: 1 / -1;
  }
}
.input-person-name {
  text-transform: capitalize;
}
.muted { color: var(--muted); }
.list-plain { padding-left: 1.1rem; }
.chip {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 8px;
  background: rgba(16, 61, 52, 0.08);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 980px) {
  body:has(.shell) {
    overflow: auto;
    height: auto;
  }
  body.sidebar-open:has(.shell) {
    overflow: hidden;
    height: 100dvh;
  }
  .shell {
    height: auto;
    overflow: visible;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    position: sticky;
    top: 0.75rem;
    z-index: 30;
    margin: 0.75rem 0.75rem 0;
    padding: 0.65rem 0.95rem;
    border: 1px solid rgba(16, 61, 52, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--accent, #103d34);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(11, 45, 38, 0.1);
  }
  .mobile-nav-toggle .icon {
    width: 1.2rem;
    height: 1.2rem;
  }
  .mobile-nav-toggle:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent, #103d34) 45%, transparent);
    outline-offset: 2px;
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(8, 24, 20, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }
  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar {
    position: fixed;
    top: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    width: min(270px, calc(100vw - 1.5rem));
    max-width: none;
    height: auto;
    max-height: none;
    margin: 0;
    z-index: 50;
    transform: translateX(calc(-100% - 1.25rem));
    transition: transform 0.24s ease;
    pointer-events: none;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
    pointer-events: auto;
  }
  .sidebar-close {
    display: grid;
  }
  .content {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
    width: calc(100% - 1.5rem);
    margin: 0.75rem auto 1rem;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 1.5rem;
  }
  .content::before,
  .content::after {
    display: none;
  }
  .metrics, .form-grid { grid-template-columns: 1fr 1fr; }
  .stats-board__money { grid-template-columns: 1fr; }
  .stats-board__ops { grid-template-columns: 1fr 1fr; }
  .stats-board__ops li { border-left: none; }
  .stats-board__ops li:nth-child(2n) { border-left: 1px solid var(--line); }
  .stats-board__ops li:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .metrics, .form-grid { grid-template-columns: 1fr; }
  .stats-board__ops { grid-template-columns: 1fr; }
  .stats-board__ops li { border-left: none; }
  .stats-board__ops li + li { border-top: 1px solid var(--line); }
  .content { padding: 1.25rem; width: calc(100% - 1rem); }
  .otp-digit { width: 2.35rem; height: 2.75rem; font-size: 1.15rem; }
  .error-actions { grid-template-columns: 1fr; }
}

.error-card { width: min(460px, 100%); text-align: center; }
.error-brand {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.error-brand .icon { width: 1.05rem; height: 1.05rem; }
.error-brand-logo {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  border-radius: 6px;
}
.error-code {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: clamp(3.5rem, 12vw, 5rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: rgba(16, 61, 52, 0.2);
}
.error-card h1 { font-size: clamp(1.7rem, 4vw, 2.15rem); margin-bottom: 0.55rem; text-align: center; }
.error-card p { margin: 0 0 0.55rem; text-align: center; }
.error-path {
  margin: 0.65rem 0 0 !important;
  font-size: 0.88rem;
}
.error-path code {
  display: inline-block;
  max-width: 100%;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(16, 61, 52, 0.06);
  color: var(--muted);
  word-break: break-all;
}
.error-detail {
  margin-top: 0.75rem !important;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 0.85rem;
  word-break: break-word;
}
.error-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1.4rem;
}
.error-actions .btn {
  display: inline-flex;
  place-items: center;
  text-align: center;
  text-decoration: none;
}

.icon-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.icon-tile {
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  padding: 1rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-size: 0.82rem;
  text-align: center;
}
.icon-tile .icon {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--accent);
}

/* Profile page */
.profile-layout {
  display: grid;
  gap: 1.25rem;
  width: 100%;
  margin: 0;
}
.profile-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 20rem);
  gap: 1.5rem 1.75rem;
  align-items: start;
}
.profile-scroll {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}
.profile-panel {
  max-width: none;
  width: 100%;
  padding: 1.6rem 1.6rem 1.4rem;
  background: #fff;
  border-radius: 20px;
}
.profile-panel h2,
.profile-panel h3 {
  margin: 0 0 0.25rem;
  color: #000;
}
.profile-section-head {
  margin: 0 0 1rem;
}
.profile-section-head .muted {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
  color: #000;
}
.profile-main-form {
  margin-top: 0;
  gap: 1rem;
}
.profile-sidebar {
  position: sticky;
  top: 0.25rem;
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  border: 1px solid rgba(16, 61, 52, 0.08);
}
.profile-avatar {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(229, 161, 56, 0.28), transparent 45%),
    linear-gradient(160deg, #1a5c4e 0%, #103d34 55%, #0c322b 100%);
  color: #edf6f2;
  border: 0;
  outline: none;
}
.profile-avatar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgb(255 255 255 / 51%) 60%, #ffffff 100%);
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-avatar-initials {
  font-size: clamp(2.8rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  position: relative;
  z-index: 2;
}
.profile-avatar-edit {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  z-index: 2;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.28);
  color: #0b2d26;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(14px) saturate(1.35);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
  box-shadow:
    0 8px 22px rgba(11, 45, 38, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.profile-avatar-edit .icon {
  width: 1rem;
  height: 1rem;
  color: var(--accent-bright);
}
.profile-avatar-edit:hover {
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(255, 255, 255, 0.75);
  transform: translateX(-50%) translateY(-1px);
}
.profile-sidebar-body {
  display: grid;
  gap: 0.85rem;
  width: 100%;
  padding: 1.15rem 1.2rem 1.25rem;
  justify-items: stretch;
  text-align: center;
}
.profile-sidebar-meta {
  display: grid;
  gap: 0.15rem;
  justify-items: center;
  width: 100%;
}
.profile-name {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 700;
  color: #000;
  line-height: 1.25;
}
.profile-username {
  margin: 0;
  color: #536865;
  font-size: 0.92rem;
  font-weight: 500;
}
.profile-role-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
}
.profile-role-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--accent-bright);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.profile-clear-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.8rem;
  border: 0;
  border-radius: 12px;
  background: #f5f8f7;
  color: #000;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.profile-clear-avatar:hover {
  background: var(--danger-bg);
  color: var(--danger);
}
.profile-clear-avatar input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  border: 2px solid #b7c9c2;
  border-radius: 5px;
  background: #fff;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
}
.profile-clear-avatar input[type="checkbox"]::after {
  content: "";
  width: 0.28rem;
  height: 0.5rem;
  margin-top: -0.08rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.12s ease;
}
.profile-clear-avatar input[type="checkbox"]:checked {
  border-color: var(--danger);
  background: var(--danger);
}
.profile-clear-avatar input[type="checkbox"]:checked::after {
  transform: rotate(45deg) scale(1);
}
.profile-clear-avatar:has(input:checked) {
  background: var(--danger-bg);
  color: var(--danger);
}
.profile-photo-hint {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: #6b7f79;
  text-align: center;
  line-height: 1.35;
}
.profile-panel--password .form-stack {
  margin-top: 0;
}
.profile-form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
  border-top: 0;
  padding-top: 0.35rem;
}
.profile-password-toggle {
  flex: 0 0 auto;
}
.profile-password-toggle-text--short,
.profile-save-text--short {
  display: none;
}
.profile-panel--password[hidden] {
  display: none !important;
}
.profile-panel--password.is-open {
  display: block;
}
@media (max-width: 860px) {
  .profile-columns {
    grid-template-columns: 1fr;
  }
  .profile-sidebar {
    position: relative;
    top: auto;
    order: -1;
  }
}
@media (max-width: 640px) {
  .profile-avatar-initials {
    font-size: 2.6rem;
  }
  .profile-panel {
    padding: 1.25rem;
  }
  .profile-form-actions {
    flex-wrap: nowrap;
    justify-content: stretch;
    gap: 0.5rem;
  }
  .profile-form-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
    font-size: 0.9rem;
  }
  .profile-password-toggle-text--full,
  .profile-save-text--full {
    display: none;
  }
  .profile-password-toggle-text--short,
  .profile-save-text--short {
    display: inline;
  }
}

/* Appointment / assign modal */
body.assign-modal-open {
  overflow: hidden;
}
.assign-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(8, 28, 24, 0.55);
  backdrop-filter: blur(4px);
}
.assign-modal[hidden] {
  display: none !important;
}
.assign-dialog {
  width: min(100%, 26rem);
  display: grid;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1.15rem;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(16, 61, 52, 0.1);
  box-shadow: 0 24px 48px rgba(8, 28, 24, 0.26);
}
.assign-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.assign-dialog-head h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--ink);
}
.assign-dialog-head .muted {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}
.assign-dialog-close {
  flex-shrink: 0;
  padding: 0.4rem 0.55rem;
}
.assign-dialog-close .icon {
  width: 1rem;
  height: 1rem;
}
.assign-patient-card {
  display: grid;
  gap: 0.3rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #f7faf9 0%, #f3f6f5 100%);
  border: 1px solid #e8eceb;
}
.assign-patient-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.assign-patient-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.assign-modal-form {
  display: grid;
  gap: 0.85rem;
}
.assign-modal-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}
.assign-modal-form select,
.assign-modal-form input[type="number"],
.assign-modal-form input[type="text"] {
  width: 100%;
  font: inherit;
  font-weight: 500;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(16, 61, 52, 0.18);
  background: #fff;
}
.assign-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.25rem;
}
.data-table .row-actions {
  width: 16.5rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  white-space: nowrap;
}
.data-table .row-actions--compact {
  width: 6.5rem;
}
body.avatar-crop-open {
  overflow: hidden;
}
.avatar-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(8, 28, 24, 0.58);
  backdrop-filter: blur(4px);
}
.avatar-crop-modal[hidden] {
  display: none !important;
}
.avatar-crop-dialog {
  width: min(100%, 28rem);
  display: grid;
  gap: 1.1rem;
  padding: 1.3rem 1.3rem 1.2rem;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(16, 61, 52, 0.1);
  box-shadow: 0 24px 48px rgba(8, 28, 24, 0.28);
}
.avatar-crop-dialog.is-wide-crop {
  width: min(100%, 36rem);
}
.avatar-crop-head h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #000;
}
.avatar-crop-head .muted {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: #536865;
}
.avatar-crop-stage {
  display: grid;
  place-items: center;
  padding: 0.15rem;
}
.avatar-crop-viewport {
  position: relative;
  width: min(100%, 22rem);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 18px;
  background: #0c322b;
  cursor: grab;
  touch-action: none;
  user-select: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 12px 28px rgba(8, 28, 24, 0.18);
}
.avatar-crop-viewport.is-wide {
  width: min(100%, 34rem);
}
.avatar-crop-viewport.is-dragging {
  cursor: grabbing;
}
.avatar-crop-viewport img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  max-height: none;
  display: block;
  pointer-events: none;
  will-change: transform;
}
.avatar-crop-controls {
  display: grid;
  gap: 0.9rem;
}
.avatar-crop-zoom {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #f7faf9 0%, #eef4f2 100%);
  border: 1px solid rgba(16, 61, 52, 0.08);
}
.avatar-crop-zoom-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: var(--accent-bright);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(11, 45, 38, 0.08);
  user-select: none;
}
.avatar-crop-zoom-track {
  display: block;
  margin: 0;
  min-width: 0;
}
.avatar-crop-zoom-value {
  min-width: 3.1rem;
  padding: 0.28rem 0.45rem;
  border-radius: 999px;
  background: rgba(26, 92, 78, 0.1);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.avatar-crop-zoom input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1.5rem;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.avatar-crop-zoom input[type="range"]:focus {
  outline: none;
}
.avatar-crop-zoom input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 0 0 4px rgba(26, 92, 78, 0.2),
    0 4px 10px rgba(11, 45, 38, 0.28);
}
.avatar-crop-zoom input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow:
    0 0 0 4px rgba(26, 92, 78, 0.2),
    0 4px 10px rgba(11, 45, 38, 0.28);
}
.avatar-crop-zoom input[type="range"]::-webkit-slider-runnable-track {
  height: 0.38rem;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--accent-bright) 0%,
    var(--accent-bright) var(--crop-zoom-pct, 0%),
    #d5e3de var(--crop-zoom-pct, 0%),
    #d5e3de 100%
  );
}
.avatar-crop-zoom input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: -0.38rem;
  border-radius: 50%;
  border: 2px solid #fff;
  background: linear-gradient(145deg, #1f6b5b, var(--accent));
  box-shadow: 0 4px 10px rgba(11, 45, 38, 0.28);
  transition: transform 0.12s ease;
}
.avatar-crop-zoom input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.08);
}
.avatar-crop-zoom input[type="range"]::-moz-range-track {
  height: 0.38rem;
  border: 0;
  border-radius: 999px;
  background: #d5e3de;
}
.avatar-crop-zoom input[type="range"]::-moz-range-progress {
  height: 0.38rem;
  border-radius: 999px;
  background: var(--accent-bright);
}
.avatar-crop-zoom input[type="range"]::-moz-range-thumb {
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: linear-gradient(145deg, #1f6b5b, var(--accent));
  box-shadow: 0 4px 10px rgba(11, 45, 38, 0.28);
}
.avatar-crop-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: stretch;
  gap: 0.65rem;
}
.avatar-crop-actions .btn {
  flex: 1 1 auto;
  justify-content: center;
  min-height: 2.7rem;
  border-radius: 12px;
}
.avatar-crop-actions .btn .icon {
  width: 1rem;
  height: 1rem;
}
.avatar-crop-actions .btn[data-crop-apply] {
  flex: 1.35 1 auto;
}
.profile-sidebar .error-text {
  margin: 0;
  font-size: 0.82rem;
  text-align: center;
}


/* Brand customization (settings tab) */
.brand-section-nav {
  display: none;
}
.brand-sections {
  display: grid;
  gap: 1rem;
}
.brand-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 2rem;
  align-items: start;
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 1.25rem;
}
.brand-pair-pane {
  min-width: 0;
}
.brand-pair .brand-section {
  padding: 0;
  border-top: 0;
}
.brand-pair .brand-section-head {
  margin-bottom: 0.75rem;
}
.brand-pair .brand-color-label {
  flex: 0 0 5.5rem;
  font-size: 0.78rem;
}
.brand-pair .brand-color-field {
  width: 100%;
}
.brand-pair .brand-color-field input[type="color"] {
  left: calc(5.5rem + 0.4rem);
}
.brand-pair .brand-color-field input[type="text"] {
  flex: 0 0 5.6rem;
  width: 5.6rem;
  font-size: 0.74rem;
  padding: 0.28rem 0.4rem;
}
.brand-pair .brand-color-alpha {
  flex: 1 1 auto;
  width: auto;
  min-width: 4.5rem;
  max-width: none;
}
.brand-section {
  padding: 1.1rem 0 1.35rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  scroll-margin-top: 1.25rem;
}
.brand-section + .brand-section {
  border-top: 1px solid var(--line);
  padding-top: 1.35rem;
}
.brand-pair + .brand-section {
  border-top: 1px solid var(--line);
  padding-top: 1.35rem;
}
.brand-section-head {
  margin-bottom: 1rem;
}
.brand-section-head h3 {
  margin: 0 0 0.25rem;
  font-size: 1.08rem;
}
.brand-section-head .muted {
  margin: 0;
  font-size: 0.9rem;
}
.brand-section-fields {
  margin-top: 1rem;
}
.brand-section-fields:first-child {
  margin-top: 0;
}
.brand-asset-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
  padding: 0.35rem 0 0.75rem;
  border-radius: 0;
  border: 0;
  background: transparent;
}
.brand-asset-preview {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent-2), #d4962f);
  color: #fff;
}
.brand-asset-preview--logo {
  width: 10.5rem;
  height: auto;
  aspect-ratio: 3 / 1;
  background: #fff;
  color: var(--accent);
  border: 1px solid rgba(16, 61, 52, 0.1);
}
.brand-asset-preview--logo img {
  object-fit: contain;
  padding: 0.25rem;
}
.brand-asset-preview--favicon {
  width: 4rem;
  height: 4rem;
  border-radius: 12px;
}
.brand-asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.brand-asset-preview--logo img {
  object-fit: contain;
}
.brand-asset-fallback .icon {
  width: 1.6rem;
  height: 1.6rem;
}
.brand-asset-meta strong {
  display: block;
  margin-bottom: 0.15rem;
}
.brand-asset-meta .muted {
  margin: 0 0 0.7rem;
  font-size: 0.88rem;
}
.brand-asset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.brand-asset-pick {
  margin: 0;
  cursor: pointer;
}
.brand-asset-clear {
  margin: 0;
}
.brand-colors strong {
  display: block;
  margin-bottom: 0.2rem;
}
.brand-colors-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}
.brand-colors-toolbar strong {
  margin: 0;
  flex: 1 1 auto;
  font-size: 0.98rem;
}
.brand-colors-toolbar .brand-use-defaults {
  padding: 0.4rem 0.85rem;
  font-size: 0.86rem;
  border-radius: 999px;
}
.brand-colors-hint {
  margin: 0 0 0.9rem;
  font-size: 0.86rem;
}
.brand-subtabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 0.95rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 55%, #fff);
  border: 1px solid var(--line);
}
.brand-subtab {
  appearance: none;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--ink) 65%, transparent);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.brand-subtab:hover {
  color: var(--ink);
}
.brand-subtab.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 61, 52, 0.08), 0 4px 12px rgba(16, 61, 52, 0.06);
}
.brand-subtab-panel[hidden] {
  display: none !important;
}
.brand-color-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
  margin-top: 0.25rem;
}
.brand-color-grid--rows {
  grid-template-columns: 1fr;
}
.brand-color-field {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transition: none;
}
.brand-color-field:focus-within {
  border-color: transparent;
  box-shadow: none;
}
.brand-color-label {
  flex: 0 0 7rem;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
}
.brand-color-swatch {
  position: relative;
  flex: 0 0 1.7rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(16, 61, 52, 0.14);
  box-shadow: 0 1px 2px rgba(16, 61, 52, 0.08);
  background:
    linear-gradient(45deg, #d8e2de 25%, transparent 25%) 0 0 / 8px 8px,
    linear-gradient(-45deg, #d8e2de 25%, transparent 25%) 0 4px / 8px 8px,
    linear-gradient(45deg, transparent 75%, #d8e2de 75%) 4px -4px / 8px 8px,
    linear-gradient(-45deg, transparent 75%, #d8e2de 75%) -4px 0 / 8px 8px,
    #fff;
}
.brand-color-swatch-fill {
  display: block;
  width: 100%;
  height: 100%;
}
.brand-color-field input[type="color"] {
  position: absolute;
  left: calc(7rem + 0.4rem);
  width: 1.7rem;
  height: 1.7rem;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.brand-color-field input[type="text"] {
  flex: 0 0 6.1rem;
  width: 6.1rem;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  padding: 0.32rem 0.45rem;
  color: var(--ink);
}
.brand-color-field input[type="text"]:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-bright) 50%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-bright) 14%, transparent);
}
.brand-color-alpha {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 9.5rem;
  width: 9.5rem;
  min-width: 0;
  padding-left: 0;
}
.brand-color-alpha-caption {
  /* Kept for a11y / screen readers; hidden to keep the row compact */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.brand-color-alpha input[type="range"] {
  appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  height: 0.38rem;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent, currentColor),
    linear-gradient(45deg, #d8e2de 25%, transparent 25%) 0 0 / 8px 8px,
    linear-gradient(-45deg, #d8e2de 25%, transparent 25%) 0 4px / 8px 8px,
    #fff;
  color: var(--accent-bright);
  outline: none;
  cursor: pointer;
}
.brand-color-alpha input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 3px rgba(16, 61, 52, 0.22);
  cursor: pointer;
}
.brand-color-alpha input[type="range"]::-moz-range-thumb {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 3px rgba(16, 61, 52, 0.22);
  cursor: pointer;
}
.brand-color-alpha-val {
  flex: 0 0 2.55rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: color-mix(in srgb, var(--line) 55%, #fff);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.18rem 0.2rem;
}
.brand-color-preview {
  display: flex;
  gap: 0.45rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
}
.brand-swatch {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(16, 61, 52, 0.14);
  background-image:
    linear-gradient(45deg, #d8e2de 25%, transparent 25%) 0 0 / 8px 8px,
    linear-gradient(-45deg, #d8e2de 25%, transparent 25%) 0 4px / 8px 8px;
}
@media (max-width: 960px) {
  .brand-pair {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .brand-pair .brand-section {
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
  }
  .brand-pair .brand-color-label {
    flex: 0 0 7rem;
    font-size: 0.82rem;
  }
  .brand-pair .brand-color-field input[type="color"] {
    left: calc(7rem + 0.4rem);
  }
  .brand-pair .brand-color-field input[type="text"] {
    flex: 0 0 6.1rem;
    width: 6.1rem;
  }
  .brand-pair .brand-color-alpha {
    flex: 1 1 auto;
    width: auto;
    min-width: 4.5rem;
    max-width: none;
  }
}
@media (max-width: 860px) {
  .brand-color-field {
    flex-wrap: wrap;
    row-gap: 0.45rem;
  }
  .brand-color-label {
    flex: 1 1 calc(100% - 2.2rem);
  }
  .brand-color-field input[type="color"] {
    left: auto;
    right: 0;
    top: 0.28rem;
  }
  .brand-color-field input[type="text"] {
    flex: 1 1 6rem;
  }
  .brand-color-alpha {
    flex: 1 1 100%;
    width: auto;
  }
  .brand-asset-card {
    grid-template-columns: 1fr;
  }
}
