@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");

:root {
  --accent: #d62828;
  --accent-hover: #b91c1c;
  --accent-soft: #fef2f2;
  --ink: #1f2328;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --success: #15803d;
  --warning: #b45309;
  --info: #1d4ed8;
  --danger: #b91c1c;
  --radius: 8px;
  --shadow-hover: 0 2px 8px rgba(31, 35, 40, 0.06);
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1 0 auto;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: normal;
}

h1 {
  font-size: 40px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 18px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

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

button {
  cursor: pointer;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

svg {
  display: block;
  max-width: 100%;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1100px, calc(100% - 40px));
  margin-inline: auto;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.icon-red {
  color: var(--accent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: normal;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--accent);
  animation: logoPulse 1.1s ease-out 1;
  transform-origin: center;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 2px;
}

.brand-mark::before {
  top: 6.5px;
  left: 0;
  width: 20px;
  height: 7px;
}

.brand-mark::after {
  top: 0;
  left: 6.5px;
  width: 7px;
  height: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease,
    transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  color: inherit;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}

.btn-outline {
  background: #ffffff;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--bg-soft);
  border-color: #9ca3af;
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.btn-danger {
  background: #ffffff;
  border-color: #fecaca;
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--accent-soft);
  border-color: #fca5a5;
  color: var(--danger);
}

.btn-sm {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn.success {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.btn.is-loading::after {
  content: "";
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  background: currentColor;
  clip-path: polygon(
    35% 0,
    65% 0,
    65% 35%,
    100% 35%,
    100% 65%,
    65% 65%,
    65% 100%,
    35% 100%,
    35% 65%,
    0 65%,
    0 35%,
    35% 35%
  );
  animation: heartbeat 1.1s ease-in-out infinite;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  font-weight: 500;
}

.site-nav a {
  padding: 6px 0;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  padding: 9px;
  margin-left: auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  flex-direction: column;
  justify-content: space-between;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.header-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  overflow: hidden;
  background: var(--accent-soft);
  border: 1px solid #fecaca;
  border-radius: 50%;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.header-avatar:hover {
  background: #fee2e2;
  border-color: var(--accent);
  color: var(--accent);
}

.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero {
  padding: 52px 0 36px;
}

.page-hero h1 {
  font-size: 38px;
}

.page-hero p {
  max-width: 62ch;
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
}

.section {
  padding: 56px 0;
}

.section-soft {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: 24px;
}

.section-head p {
  max-width: 56ch;
  color: var(--muted);
  font-size: 14px;
}

.section-more {
  margin-top: 24px;
  font-size: 14px;
  font-weight: 500;
}

.hero {
  padding: 64px 0 72px;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: 64px;
}

.hero h1 {
  max-width: 18ch;
  font-size: clamp(32px, 3.6vw, 42px);
  line-height: 1.16;
}

.hero-copy > p {
  max-width: 52ch;
  margin-top: 16px;
  color: var(--muted);
  font-size: 16px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-illustration {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.ecg-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
  animation: ecgDraw 3s 0.35s ease-out forwards;
}

.clinic-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.search-field {
  flex: 1;
  max-width: 380px;
}

.search-field input {
  width: 100%;
}

.chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.chip {
  padding: 5px 0;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.chip:hover {
  color: var(--ink);
}

.chip.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

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

.clinic-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.clinic-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.clinic-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.clinic-icon {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 18px;
  color: var(--accent);
}

.clinic-icon svg {
  width: 24px;
  height: 24px;
}

.clinic-card h3 {
  font-size: 18px;
  font-weight: 600;
}

.clinic-specialty {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.clinic-desc {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.clinic-details {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.clinic-details div {
  display: grid;
  gap: 2px;
}

.clinic-details dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.clinic-details dd {
  margin: 0;
}

.clinic-footer {
  margin-top: auto;
  padding-top: 22px;
}

.plain-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  list-style: none;
}

.plain-steps li {
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.step-num {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.step-icon {
  color: var(--muted);
}

.step-icon svg {
  width: 20px;
  height: 20px;
}

.plain-steps h3 {
  font-size: 17px;
}

.plain-steps p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.faq-list {
  border-top: 1px solid var(--line);
}

.faq-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  position: relative;
  padding-right: 28px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.2;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item p {
  max-width: 76ch;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.service-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.service-item {
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.service-item h2 {
  font-size: 18px;
}

.service-item p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
  gap: 48px;
}

.contact-copy h2 {
  font-size: 28px;
}

.contact-copy p {
  max-width: 36ch;
  margin-top: 10px;
  color: var(--muted);
}

.contact-form {
  padding: 28px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.narrow {
  max-width: 660px;
  margin-inline: auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.field label span {
  color: var(--muted);
  font-weight: 400;
}

.field input,
.field select,
.field textarea,
.toolbar input,
.toolbar select {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  font-size: 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder,
.toolbar input::placeholder {
  color: #9ca3af;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.toolbar input:focus,
.toolbar select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(214, 40, 40, 0.1);
}

.field .hint,
.hint,
.field-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field.full {
  grid-column: 1 / -1;
}

.form-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.form-status {
  min-height: 1.3em;
  font-size: 13px;
}

.form-status.ok {
  color: var(--success);
}

.form-status.err {
  color: var(--danger);
}

.empty,
.empty-state {
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}

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

.loading-state {
  display: flex;
  align-items: center;
  gap: 9px;
}

.loading-state::before {
  content: "";
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  background: var(--accent);
  clip-path: polygon(
    35% 0,
    65% 0,
    65% 35%,
    100% 35%,
    100% 65%,
    65% 65%,
    65% 100%,
    35% 100%,
    35% 65%,
    0 65%,
    0 35%,
    35% 35%
  );
  animation: heartbeat 1.1s ease-in-out infinite;
}

.auth-main {
  padding: 56px 0 72px;
  background: var(--bg-soft);
}

.auth-panel {
  width: min(440px, 100%);
  margin-inline: auto;
  padding: 32px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.auth-panel > .brand {
  margin-bottom: 26px;
}

.auth-heading h1 {
  font-size: 28px;
}

.auth-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.auth-form .btn {
  width: 100%;
}

.auth-panel .form-grid {
  gap: 12px;
}

.password-row {
  position: relative;
}

.password-row input {
  padding-right: 62px;
}

.password-row button {
  position: absolute;
  top: 50%;
  right: 10px;
  padding: 2px 4px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transform: translateY(-50%);
}

.password-row button:hover {
  color: var(--ink);
}

.auth-error {
  display: none;
  color: var(--danger);
  font-size: 13px;
}

.auth-error.show {
  display: block;
}

.auth-alt {
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

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

.link-btn {
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

.link-btn:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.code-sent {
  color: var(--muted);
  font-size: 13px;
}

.code-input {
  font-size: 18px;
  letter-spacing: 4px;
}

.dev-note {
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  color: #92400e;
  font-size: 12px;
  line-height: 1.5;
}

.site-footer {
  flex: 0 0 auto;
  padding: 36px 0;
  background: #ffffff;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}

.footer-brand p {
  max-width: 34ch;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 24px;
  font-size: 13px;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--ink);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.app-page {
  background: var(--bg-soft);
}

.app-main {
  padding: 32px 0 56px;
}

.app-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.app-hero h1 {
  font-size: 28px;
}

.app-hero p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 18px 20px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.stat-value {
  margin-top: 4px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
}

.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 20px;
}

.card {
  min-width: 0;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.card-head h2 {
  font-size: 18px;
}

.card-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.booking-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.booking-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.booking-form .btn {
  width: 100%;
}

.status-select {
  min-height: 34px;
  padding: 5px 9px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 13px;
}

.status-select:focus {
  outline: none;
  border-color: var(--accent);
}

.status-select.status-pending {
  color: var(--warning);
}

.status-select.status-confirmed {
  color: var(--success);
}

.status-select.status-completed {
  color: var(--info);
}

.status-select.status-cancelled {
  color: var(--muted);
}

.appointment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.appt-item {
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.appt-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.appt-title {
  font-size: 15px;
  font-weight: 600;
}

.appt-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.appt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.appt-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.status-badge,
.pill,
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.status-badge::before,
.pill::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.pending,
.pill.pending,
.status-badge.new,
.pill.new {
  color: var(--warning);
}

.status-badge.confirmed,
.pill.confirmed,
.status-badge.replied,
.pill.replied {
  color: var(--success);
}

.status-badge.completed,
.pill.completed {
  color: var(--info);
}

.status-badge.cancelled,
.pill.cancelled {
  color: var(--muted);
}

.pill.active {
  color: var(--success);
}

.pill.banned {
  color: var(--danger);
}

.user-name-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.user-name-button:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.user-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.table-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.table-action:hover {
  color: var(--ink);
}

.table-action.danger {
  color: var(--danger);
}

.table-action.danger:hover {
  color: #991b1b;
}

tbody tr.is-banned {
  background: #fffafa;
}

.role-badge {
  color: var(--muted);
}

.role-badge.admin {
  color: var(--accent);
}

.admin-page {
  background: var(--bg-soft);
}

.admin-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 16px;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.admin-side > .brand {
  margin-bottom: 28px;
  padding: 0 12px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.admin-nav button:hover {
  color: var(--ink);
  background: var(--bg-soft);
}

.admin-nav button.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: transparent;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
}

.admin-side-footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.admin-side-footer a,
.admin-side-footer button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.admin-side-footer a:hover,
.admin-side-footer button:hover {
  color: var(--ink);
}

.admin-main {
  min-width: 0;
  padding: 32px 40px 56px;
}

.admin-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.admin-topbar h1 {
  font-size: 24px;
}

.admin-topbar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.admin-user {
  color: var(--muted);
  font-size: 13px;
}

.admin-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: start;
  gap: 20px;
}

.admin-view > .card + .card {
  margin-top: 20px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar input {
  max-width: 360px;
}

.toolbar select {
  width: auto;
  min-width: 150px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

th {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #f9fafb;
}

.cell-strong {
  font-weight: 500;
}

.cell-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.message-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}

.message-head strong {
  font-size: 14px;
  font-weight: 600;
}

.message-head-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.message-subject {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
}

.message > p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  white-space: pre-wrap;
}

.reply-thread {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.reply {
  padding: 10px 12px;
  background: var(--bg-soft);
  border-left: 2px solid var(--line-strong);
  border-radius: 0 6px 6px 0;
}

.reply-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.reply p {
  margin-top: 4px;
  font-size: 13px;
}

.reply-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.reply-form textarea {
  width: 100%;
  min-height: 74px;
  padding: 9px 12px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  font-size: 13px;
  resize: vertical;
}

.reply-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(214, 40, 40, 0.1);
}

.reply-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.patient-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(18px, 5vh, 56px) 20px;
  overflow-y: auto;
  background: rgba(31, 35, 40, 0.54);
}

.patient-modal-card {
  position: relative;
  width: min(780px, 100%);
  margin: auto;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(31, 35, 40, 0.18);
}

.patient-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
}

.patient-modal-close:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.patient-modal-close svg {
  width: 18px;
  height: 18px;
}

.patient-profile-head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding-right: 44px;
}

.patient-profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  flex: none;
  overflow: hidden;
  border: 1px solid #f0b4b4;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
}

.patient-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.patient-profile-identity {
  min-width: 0;
}

.patient-profile-identity .page-eyebrow {
  margin-bottom: 4px;
}

.patient-profile-identity h2 {
  font-size: 27px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.patient-profile-identity > p {
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 14px;
}

.patient-profile-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.patient-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.patient-profile-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}

.patient-profile-panel h3 {
  font-size: 14px;
  font-weight: 600;
}

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

.patient-profile-list dt {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.patient-profile-list dd {
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.patient-profile-long {
  white-space: pre-line;
}

.patient-profile-empty {
  color: var(--muted);
}

.patient-appointments-panel {
  margin-top: 14px;
}

.patient-profile-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.patient-profile-panel-head span {
  color: var(--muted);
  font-size: 12px;
}

.patient-appointment-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.patient-appointment {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.patient-appointment-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.patient-appointment-title strong {
  font-size: 13.5px;
  font-weight: 600;
}

.patient-appointment-main > p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
}

.patient-appointment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.patient-appointment-meta span + span::before {
  content: "·";
  margin-right: 14px;
  color: #b8bcc2;
}

.patient-profile-empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.patient-profile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.patient-protected-note {
  margin-right: auto;
  color: var(--muted);
  font-size: 12.5px;
}

.patient-profile-loading {
  display: grid;
  gap: 18px;
  padding-top: 8px;
}

.patient-profile-loading-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.patient-profile-loading-avatar {
  width: 72px;
  height: 72px;
  flex: none;
  border-radius: 14px;
}

.patient-profile-loading-head .skeleton-stack {
  flex: 1;
}

.patient-profile-error {
  padding: 38px 10px;
  text-align: center;
}

.patient-profile-error h2 {
  font-size: 22px;
}

.patient-profile-error p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

body.modal-open {
  overflow: hidden;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  max-width: 360px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(31, 35, 40, 0.1);
  font-size: 13px;
}

.toast.ok {
  border-left-color: var(--success);
}

.toast.warn {
  border-left-color: var(--warning);
}

@keyframes logoPulse {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.72);
    opacity: 0.55;
  }
}

@keyframes ecgDraw {
  to {
    stroke-dashoffset: 0;
  }
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(31, 35, 40, 0.54);
  animation: onboardingFade 0.25s ease both;
}

.onboarding-card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 28px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(31, 35, 40, 0.24);
  animation: onboardingPop 0.42s cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
}

.onboarding-orbit {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.onboarding-orbit span {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid #fecaca;
  border-radius: 50%;
  animation: orbitFloat 5s var(--ease-out) 1 both;
}

.onboarding-orbit span:nth-child(1) {
  top: 34px;
  right: 46px;
}

.onboarding-orbit span:nth-child(2) {
  top: 96px;
  left: 34px;
  width: 7px;
  height: 7px;
  animation-delay: -2.3s;
}

.onboarding-orbit span:nth-child(3) {
  right: 88px;
  bottom: 58px;
  width: 6px;
  height: 6px;
  border-color: #fca5a5;
  animation-delay: -4.1s;
}

.onboarding-head {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
}

.onboarding-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  background: var(--accent-soft);
  border: 1px solid #fecaca;
  border-radius: 15px;
  animation: logoPulse 0.5s var(--ease-out) 1 both;
}

.onboarding-heart {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.onboarding-heart .pulse-line {
  stroke-dasharray: 90;
  stroke-dashoffset: 90;
  animation: ecgDraw 0.9s 0.16s var(--ease-out) 1 both;
}

.onboarding-progress-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  background: var(--accent-soft);
  border-radius: 99px;
}

.onboarding-progress-track span {
  display: block;
  width: 33.33%;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.35s var(--ease-out);
}

.onboarding-step-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.onboarding-step {
  animation: onboardingSlide 0.32s ease both;
}

.onboarding-step h2 {
  font-size: 25px;
  letter-spacing: -0.02em;
}

.onboarding-copy {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.onboarding-field {
  margin-top: 20px;
}

.onboarding-field textarea {
  min-height: 112px;
}

.onboarding-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.onboarding-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.onboarding-chip {
  padding: 7px 12px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.onboarding-chip:hover {
  border-color: #fca5a5;
  color: var(--accent);
  transform: translateY(-2px);
}

.onboarding-chip.is-active {
  background: var(--accent-soft);
  border-color: #fca5a5;
  color: var(--accent);
  animation: chipPop 0.28s ease;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.onboarding-error {
  margin-top: 12px;
}

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

.onboarding-actions .btn {
  min-width: 122px;
}

.onboarding-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 0 4px;
  animation: onboardingSlide 0.34s ease both;
}

.onboarding-success h2 {
  margin-top: 16px;
  font-size: 25px;
}

.onboarding-success p {
  max-width: 36ch;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.onboarding-success .btn {
  margin-top: 22px;
  min-width: 170px;
}

.success-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 50%;
}

.success-ring svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: var(--success);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-ring path {
  stroke-dasharray: 46;
  stroke-dashoffset: 46;
  animation: successCheck 0.55s 0.1s ease forwards;
}

.success-ping {
  position: absolute;
  inset: -1px;
  border: 2px solid #86efac;
  border-radius: 50%;
  animation: successPing 0.9s 0.12s var(--ease-out) 1 both;
}

@keyframes onboardingFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes onboardingPop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes onboardingSlide {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes orbitFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-12px) rotate(180deg);
    opacity: 1;
  }
}

@keyframes chipPop {
  0% {
    transform: scale(0.94);
  }
  70% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes successCheck {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes successPing {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-overlay,
  .onboarding-card,
  .onboarding-step,
  .onboarding-mark,
  .onboarding-heart .pulse-line,
  .onboarding-orbit span,
  .success-ring path,
  .success-ping,
  .onboarding-chip.is-active {
    animation: none !important;
  }
}

@media (max-width: 980px) {
  .hero-grid {
    gap: 40px;
  }

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

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

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

@media (max-width: 860px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 0;
  }

  .header-inner .brand {
    order: 1;
  }

  .nav-toggle {
    display: flex;
    order: 2;
  }

  .site-nav,
  .header-actions {
    display: none;
    flex-basis: 100%;
    order: 3;
  }

  .site-nav.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    margin-top: 10px;
  }

  .site-nav.open a {
    padding: 11px 0;
    border-bottom: 0;
  }

  .site-nav.open a.active {
    color: var(--accent);
  }

  .header-actions.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 4px 0 16px;
  }

  .header-actions.open .btn {
    width: 100%;
  }

  .header-inner {
    position: relative;
  }

  .header-actions.has-avatar:not(.open) {
    display: flex;
    position: absolute;
    top: 13px;
    right: 58px;
    margin: 0;
    flex-basis: auto;
    order: 0;
  }

  .header-actions.has-avatar:not(.open) > :not(.header-avatar) {
    display: none;
  }

  .header-actions.has-avatar:not(.open) .header-avatar {
    margin: 0;
  }

  .hero-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 44px 0 52px;
  }

  .hero h1 {
    max-width: 15ch;
  }

  .hero-illustration {
    max-width: 520px;
  }

  .section-head {
    display: block;
  }

  .section-head p {
    margin-top: 8px;
  }

  .plain-steps,
  .portal-grid,
  .service-list {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .admin-shell {
    display: block;
  }

  .admin-side {
    position: static;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-side > .brand {
    margin-bottom: 14px;
    padding: 0;
  }

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

  .admin-nav button {
    width: 100%;
    padding: 9px 12px;
  }

  .admin-nav button.active {
    border-left-color: var(--accent);
  }

  .admin-side-footer {
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
  }

  .admin-side-footer a,
  .admin-side-footer button {
    width: auto;
    padding: 8px 10px;
  }

  .admin-main {
    padding: 24px 16px 40px;
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 32px);
  }

  h1 {
    font-size: 32px;
  }

  .page-hero {
    padding: 38px 0 28px;
  }

  .page-hero h1 {
    font-size: 32px;
  }

  .section,
  .hero {
    padding-block: 40px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .clinic-grid,
  .form-grid,
  .booking-row,
  .stat-row {
    grid-template-columns: 1fr;
  }

  .clinic-tools {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .search-field {
    max-width: none;
  }

  .contact-form,
  .card,
  .auth-panel {
    padding: 20px;
  }

  .auth-main {
    padding: 36px 0 48px;
  }

  .app-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .app-hero .btn {
    width: 100%;
  }

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

  .admin-topbar {
    flex-direction: column;
    gap: 8px;
  }

  .toolbar {
    flex-direction: column;
  }

  .toolbar input,
  .toolbar select {
    max-width: none;
    width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 6px;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }

  .patient-modal-overlay {
    padding: 12px;
  }

  .patient-modal-card {
    padding: 22px 18px;
    border-radius: 12px;
  }

  .patient-modal-close {
    top: 12px;
    right: 12px;
  }

  .patient-profile-head {
    flex-direction: column;
    gap: 14px;
    padding-right: 36px;
  }

  .patient-profile-avatar {
    width: 62px;
    height: 62px;
  }

  .patient-profile-identity h2 {
    font-size: 23px;
  }

  .patient-profile-grid {
    grid-template-columns: 1fr;
  }

  .patient-profile-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .patient-profile-actions .btn {
    width: 100%;
  }

  .patient-protected-note {
    margin-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

textarea:disabled {
  background: var(--bg-soft);
  color: var(--muted);
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .onboarding-overlay {
    padding: 12px;
  }

  .onboarding-card {
    max-height: calc(100dvh - 24px);
    padding: 22px 18px;
    border-radius: 14px;
  }

  .onboarding-step h2,
  .onboarding-success h2 {
    font-size: 22px;
  }

  .onboarding-actions {
    flex-direction: column-reverse;
  }

  .onboarding-actions .btn {
    width: 100%;
  }
}

.care-profile {
  margin-bottom: 24px;
}

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

.care-profile-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.care-profile-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .care-profile-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Dashboard charts */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.charts-grid > .card {
  min-width: 0;
}

.cp-chart {
  width: 100%;
  min-height: 200px;
}

.cp-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.cp-chart-donut {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}

.cp-donut {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  width: 100%;
}

.cp-donut-svg {
  flex: 0 0 auto;
}

.cp-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 130px;
}

.cp-donut-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.cp-donut-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
}

.cp-donut-label {
  flex: 1;
  color: var(--muted);
}

.cp-donut-legend-row strong {
  color: var(--ink);
  font-weight: 600;
}

/* Online visit indicators */
.appt-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--info);
  font-weight: 500;
}

.appt-online::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--info);
}

.appt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Meetings page */
.meeting-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meeting-card {
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.meeting-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.meeting-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.meeting-zoom-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.meeting-zoom-badge.is-ready {
  color: var(--success);
  background: #ecfdf3;
}

.meeting-zoom-badge.is-pending {
  color: var(--warning);
  background: #fffbeb;
}

.meeting-zoom-badge.is-failed {
  color: var(--danger);
  background: var(--accent-soft);
}

.meeting-zoom-badge.is-cancelled {
  color: var(--muted);
  background: var(--bg-soft);
}

.meeting-id {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.meeting-id strong {
  color: var(--ink);
  font-weight: 600;
}

.meeting-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.meeting-notice {
  margin-bottom: 20px;
  padding: 16px 18px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 3px solid var(--warning);
  border-radius: var(--radius);
}

.meeting-notice strong {
  display: block;
  font-size: 14px;
}

.meeting-notice p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.site-nav a.is-active {
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 860px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .meeting-card-head {
    flex-direction: column;
    gap: 10px;
  }

  .meeting-badges {
    justify-content: flex-start;
  }
}

/* Zoom visit type */
.app-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.zoom-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.zoom-hero-btn svg {
  width: 16px;
  height: 16px;
}

.field .field-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.visit-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.visit-type-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.visit-type-option svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.visit-type-option:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.visit-type-option.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(214, 40, 40, 0.08);
}

@media (max-width: 640px) {
  .app-hero-actions {
    width: 100%;
    flex-direction: column;
  }

  .app-hero-actions .btn {
    width: 100%;
  }

  .visit-type-toggle {
    grid-template-columns: 1fr;
  }
}
