:root {
  color-scheme: light;
  --brand: #812a30;
  --brand-dark: #682027;
  --brand-soft: #f3e5e3;
  --ink: #332422;
  --muted: #665753;
  --line: #eadfd7;
  --page: #f8f5f0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); background: var(--page); }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
[hidden] { display: none !important; }
.sidebar { display: flex; flex-direction: column; padding: 28px 18px; background: #74262c; color: #fff; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px; }
.brand-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px; background: #fff; color: var(--brand); font-size: 27px; line-height: 1; }
.brand-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; }
.brand small, .sidebar-foot { color: #efdad5; font-size: 13px; }
nav { display: grid; gap: 6px; margin-top: 47px; }
nav a { display: block; border-radius: 8px; padding: 11px 13px; color: #fff8ec; font-weight: 600; }
nav a:hover, nav a[aria-current="page"] { color: #fff; background: #ffffff26; }
.sidebar-foot { margin-top: auto; padding: 30px 10px 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 66px; padding: 0 32px; background: #fff; border-bottom: 1px solid var(--line); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.workspace { max-width: 1440px; margin: auto; padding: 32px; }
.page-heading, .card-heading, .dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-heading { margin-bottom: 24px; }
h1 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -.025em; }
h2 { font-size: 19px; }
.page-heading p, .hint { color: var(--muted); margin-top: 4px; }
.pill { display: inline-block; border-radius: 20px; padding: 4px 10px; color: var(--brand-dark); background: var(--brand-soft); font-size: 13px; white-space: nowrap; }
.pill.neutral { color: #625853; background: #f0ebe6; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric, .card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 19px; }
.metric span { color: var(--muted); }
.metric strong { display: block; color: var(--brand-dark); font-size: 31px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(230px, 1fr); gap: 18px; align-items: start; }
.card-heading { margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 13px; font-weight: 600; background: #f7f1ec; }
tbody tr:last-child td { border-bottom: 0; }
.person { display: flex; align-items: center; gap: 10px; }
.avatar { display: inline-grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); object-fit: cover; }
.team-list { list-style: none; padding: 0; margin: 0; }
.team-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.team-list li:last-child { border-bottom: 0; }
.person small { display: block; color: var(--muted); }
.button { display: inline-block; border: 1px solid transparent; border-radius: 8px; padding: 7px 12px; min-height: 36px; font-weight: 600; white-space: nowrap; }
.primary { background: var(--brand); color: #fff; }
.primary:hover { background: var(--brand-dark); }
.secondary { background: #fff; border-color: var(--line); color: var(--brand-dark); }
.secondary:hover { background: var(--brand-soft); }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar input { flex: 1 1 200px; }
input:not([type="checkbox"]), select, textarea { padding: 8px 10px; border: 1px solid #dccec4; border-radius: 7px; color: var(--ink); background: #fff; }
input[type="checkbox"] { accent-color: var(--brand); }
.empty { padding: 28px 0; color: var(--muted); text-align: center; }
.notice { padding: 10px 12px; margin-bottom: 14px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-dark); }
.notice.error { background: #fbece8; color: #812519; }
dialog { width: min(550px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 14px; padding: 22px; color: var(--ink); box-shadow: 0 12px 40px #34211c24; }
dialog::backdrop { background: #301b1a61; }
dialog label { display: grid; gap: 5px; min-width: 0; margin-top: 13px; font-weight: 600; }
dialog input, dialog textarea { width: 100%; min-width: 0; font-weight: 400; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.checkboxes { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.checkboxes label { display: flex; align-items: center; }
.checkboxes input { width: auto; }
.schedule-days { border: 1px solid var(--line); border-radius: 8px; margin: 16px 0; padding: 10px 12px; }
.schedule-days legend { padding: 0 5px; font-weight: 600; }
.schedule-days .hint { margin: 0 0 5px; }
.schedule-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 8px 0; }
.schedule-row + .schedule-row { border-top: 1px solid var(--line); }
.schedule-row label { display: flex; align-items: center; margin: 0; }
.schedule-row input { width: auto; }
.dialog-actions { text-align: right; }
.contact-number { margin-top: 17px; font-size: 26px; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.patient-details { margin: 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.brand-settings label { display: grid; gap: 5px; margin-bottom: 14px; font-weight: 600; min-width: 0; }
.brand-settings .fields { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }
.brand-assets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(225px, 100%), 1fr)); gap: 20px; margin: 15px 0; }
.brand-assets h2 { margin-bottom: 10px; }
.brand-preview { display: block; object-fit: contain; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; }
.brand-preview.logo { width: 85px; height: 85px; }
.brand-preview.banner { max-width: 100%; max-height: 140px; }
.brand-settings .asset-reset { display: flex; align-items: center; }
.brand-settings .dialog-actions { margin-top: 16px; }
@media (max-width: 860px) {
  body { grid-template-columns: 165px minmax(0, 1fr); }
  .workspace, .topbar { padding-inline: 19px; }
  .overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 590px) {
  body { display: block; }
  .sidebar { padding: 13px 12px; }
  nav { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 10px; }
  nav a { padding: 7px 9px; }
  .sidebar-foot, .topbar { display: none; }
  .workspace { padding: 20px 12px; }
  .metrics { gap: 7px; }
  .metric, .card { padding: 12px; }
}
