:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --panel: rgba(255, 255, 255, 0.94);
  --line: #d7e1f0;
  --text: #182230;
  --muted: #6b7788;
  --primary: #2f6bff;
  --primary-soft: #eaf1ff;
  --green: #1f9d66;
  --green-soft: #e7f7ef;
  --orange: #ed8a19;
  --orange-soft: #fff2e5;
  --red: #d94f4f;
  --red-soft: #ffecec;
  --shadow: 0 14px 30px rgba(24, 34, 48, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #eef4ff 0%, var(--bg) 45%, #f8fafc 100%);
  color: var(--text);
}
button, input { font: inherit; }
.hidden { display: none !important; }
.shell {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 20px 16px 40px;
}
.mobile-shell { padding-bottom: 56px; }
.shell-center {
  min-height: 100vh;
  display: grid;
  align-items: center;
}
.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(14px);
}
.panel + .panel { margin-top: 16px; }
.hero-panel {
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.95), rgba(98, 130, 255, 0.9));
  color: #fff;
}
.compact-panel { padding: 16px 18px; }
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.82;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; margin-top: 10px; line-height: 1.2; }
.h1-sm { font-size: 24px; }
.muted { color: rgba(255,255,255,0.86); margin-top: 10px; line-height: 1.6; }
.page-patient .panel:not(.hero-panel) .muted,
.page-staff .panel:not(.hero-panel) .muted,
body:not(.page-patient):not(.page-staff) .panel:not(.hero-panel) .muted { color: var(--muted); }
.section-title { font-weight: 700; font-size: 18px; }
.info-row,
.space-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.align-start { align-items: flex-start; }
.stack { display: flex; flex-direction: column; }
.gap-12 { gap: 12px; }
.top-gap-12 { margin-top: 12px; }
.top-gap-16 { margin-top: 16px; }
.top-gap-20 { margin-top: 20px; }
.field { display: block; }
.field span {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
  outline: none;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.12); }
.btn {
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--primary-soft); color: var(--primary); }
.btn-ghost { background: rgba(255,255,255,0.18); color: #fff; }
.btn-small { padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.tip { color: var(--muted); font-size: 14px; line-height: 1.6; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.metric-card {
  padding: 14px;
  border-radius: 18px;
  background: #f7f9fc;
  border: 1px solid var(--line);
}
.metric-label { font-size: 13px; color: var(--muted); }
.metric-value { font-size: 24px; font-weight: 800; margin-top: 8px; }
.metric-value.small { font-size: 18px; }
.soft-card {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
.status-banner {
  margin-top: 16px;
  border-radius: 18px;
  padding: 16px;
  background: var(--primary-soft);
  color: var(--primary);
}
.status-banner.is-warning { background: var(--orange-soft); color: var(--orange); }
.status-banner.is-success { background: var(--green-soft); color: var(--green); }
.status-banner.is-danger { background: var(--red-soft); color: var(--red); }
.status-title { font-size: 18px; font-weight: 800; }
.status-desc { margin-top: 8px; line-height: 1.6; }
.empty-state {
  text-align: center;
  padding: 12px 8px;
}
.empty-emoji { font-size: 34px; margin-bottom: 10px; }
.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}
.tabs {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tab-btn {
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
  border-radius: 14px;
  font-weight: 700;
  color: var(--muted);
}
.tab-btn.active {
  background: var(--primary-soft);
  border-color: rgba(47, 107, 255, 0.18);
  color: var(--primary);
}
.list-wrap { display: flex; flex-direction: column; gap: 12px; }
.list-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 18px;
  padding: 14px;
}
.list-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.list-title { font-size: 18px; font-weight: 800; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
}
.badge.warn { background: var(--orange-soft); color: var(--orange); }
.badge.success { background: var(--green-soft); color: var(--green); }
.badge.danger { background: var(--red-soft); color: var(--red); }
.list-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}
.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.card-actions .btn {
  flex: 1;
  padding: 12px 10px;
  border-radius: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.chart-wrap {
  margin-top: 16px;
  padding: 12px;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid var(--line);
}
.trend-chart { width: 100%; height: auto; display: block; }
.chart-legend { margin-top: 10px; color: var(--muted); font-size: 13px; }
.accent-blue { background: #eef4ff; }
.accent-green { background: #eaf8f0; }
.accent-orange { background: #fff4e8; }
.accent-red { background: #fff0f0; }
.notice { color: var(--muted); text-align: center; padding: 12px; }
a { text-decoration: none; }
@media (max-width: 420px) {
  .shell { padding-left: 12px; padding-right: 12px; }
  .form-grid,
  .metric-grid,
  .list-meta { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
}

.btn-ghost-dark {
  background: #eef2f7;
  color: var(--text);
}
.align-center { align-items: center; }
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dashboard-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
}
.dashboard-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.page-staff-dashboard {
  overflow: hidden;
}
.staff-dashboard-shell {
  min-height: 100dvh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 10px;
  padding-top: 12px;
  padding-bottom: 12px;
  overflow: hidden;
}
.staff-dashboard-shell .panel {
  margin-top: 0;
}
.compact-header-panel,
.compact-summary-panel,
.compact-chart-panel,
.compact-query-panel,
.compact-list-panel {
  padding: 12px;
}
.section-title-sm {
  font-size: 15px;
}
.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.summary-item {
  text-align: center;
  padding: 6px 4px;
  border-right: 1px solid var(--line);
}
.summary-item:last-child {
  border-right: 0;
}
.summary-label {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}
.summary-value {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}
.compact-chart-wrap {
  margin-top: 8px;
  padding: 8px 8px 4px;
}
.compact-query-panel .query-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.query-result-card {
  margin-top: 8px;
  padding: 10px 12px;
}
.query-result-top,
.query-result-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.muted-dark {
  color: var(--muted);
  font-size: 13px;
}
.tabs-compact {
  margin-top: 0;
}
.tab-lists {
  min-height: 0;
  height: 100%;
}
.compact-list-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.compact-list-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}
.compact-list-card {
  padding: 10px 12px;
  border-radius: 16px;
}
.list-row-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.list-row-left {
  min-width: 0;
}
.list-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.list-inline-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
.btn-mini {
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
}
.card-actions-compact {
  margin-top: 10px;
}
.card-actions-compact .btn {
  flex: none;
}
@media (max-width: 420px) {
  .staff-dashboard-shell {
    padding-left: 10px;
    padding-right: 10px;
    gap: 8px;
  }
  .dashboard-title {
    font-size: 24px;
  }
  .summary-strip {
    gap: 4px;
  }
  .summary-value {
    font-size: 20px;
  }
  .compact-query-panel .query-row {
    grid-template-columns: 1fr auto;
  }
  .query-result-top,
  .list-row-main {
    align-items: flex-start;
  }
  .list-row-right {
    flex-direction: column;
    align-items: stretch;
  }
}

.page-patient-compact {
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
}
.patient-compact-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
  padding-top: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  overflow: visible;
}
.patient-compact-shell .panel {
  margin-top: 0;
}
.patient-compact-header {
  padding: 14px 16px;
}
.patient-page-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}
.patient-page-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}
.patient-activate-panel,
.patient-progress-panel {
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
}
.patient-progress-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.patient-card-label {
  font-size: 14px;
  color: var(--text);
  font-weight: 700;
}
.patient-card-no {
  margin-top: 8px;
  font-size: 48px;
  line-height: 1;
  font-weight: 800;
  color: #2f8adf;
}
.patient-progress-lines {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.patient-progress-line {
  font-size: 17px;
  line-height: 1.45;
}
.patient-progress-line strong {
  font-size: 18px;
}
.patient-activate-meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.patient-message-card,
.patient-refresh-card {
  padding: 14px 16px;
  border-radius: 20px;
}
.patient-message-card .status-desc {
  margin-top: 0;
  font-size: 16px;
  line-height: 1.45;
  color: inherit;
}
.patient-refresh-top {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.patient-bottom-action {
  padding-bottom: env(safe-area-inset-bottom);
}
.btn-outline-primary {
  background: #fff;
  color: #31a6b7;
  border: 1.5px solid #7bc9d2;
}
.btn-bottom-wide {
  width: 100%;
  border-radius: 999px;
  padding: 15px 18px;
  font-size: 16px;
}
@media (max-width: 420px) {
  .patient-compact-shell {
    padding-left: 10px;
    padding-right: 10px;
    gap: 8px;
  }
  .patient-page-title {
    font-size: 20px;
  }
  .patient-card-no {
    font-size: 42px;
  }
  .patient-progress-line {
    font-size: 15px;
  }
  .patient-progress-line strong {
    font-size: 16px;
  }
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
  outline: none;
  font: inherit;
}
textarea {
  min-height: 88px;
  resize: vertical;
}
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.12);
}
.desktop-shell {
  width: min(100%, 1180px);
  padding-bottom: 56px;
}
.resource-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.resource-grid .panel + .panel {
  margin-top: 0;
}
.resource-card {
  min-width: 0;
}
.form-grid.one-col {
  grid-template-columns: 1fr;
}
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}
.resource-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.resource-item-title {
  font-weight: 800;
  font-size: 16px;
}
.resource-item-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.resource-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.checkbox-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
}
.checkbox-pill input {
  width: auto;
  margin: 0;
}
@media (max-width: 860px) {
  .resource-summary-grid,
  .resource-grid {
    grid-template-columns: 1fr;
  }
  .resource-item {
    align-items: flex-start;
    flex-direction: column;
  }
  .resource-item-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}

.patient-service-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.patient-service-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
  font-weight: 800;
}
.patient-service-option em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.patient-selected-services {
  margin-top: 14px;
}
.patient-selected-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 8px;
}
.patient-selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.patient-selected-tags span {
  border-radius: 999px;
  background: rgba(47, 107, 255, 0.1);
  color: var(--primary);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}
.resource-nav {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  overflow-x: auto;
}
.resource-nav-link {
  flex: 1;
  min-width: 96px;
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-weight: 800;
  border-radius: 14px;
  padding: 12px 14px;
  white-space: nowrap;
}
.resource-nav-link.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 24px rgba(47, 107, 255, 0.22);
}
.resource-summary-link {
  color: inherit;
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.resource-summary-link:hover,
.resource-summary-link.active {
  transform: translateY(-1px);
  border-color: rgba(47, 107, 255, 0.32);
}
.resource-page-section {
  display: none;
}
#resourceApp[data-resource-page="beds"] .resource-page-section[data-section="beds"],
#resourceApp[data-resource-page="service-items"] .resource-page-section[data-section="service-items"],
#resourceApp[data-resource-page="groups"] .resource-page-section[data-section="groups"],
#resourceApp[data-resource-page="rooms"] .resource-page-section[data-section="rooms"] {
  display: block;
}
.resource-page-panel {
  max-width: 860px;
  margin: 0 auto;
}
.resource-page-list {
  max-height: none;
}
@media (max-width: 860px) {
  .resource-nav-link {
    flex: 0 0 auto;
  }
  .resource-page-panel {
    max-width: none;
  }
}
.resource-aligned-block {
  width: 100%;
}
.resource-table-panel {
  width: 100%;
  overflow: hidden;
}
.resource-table-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.resource-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}
.resource-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}
.resource-table th,
.resource-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.resource-table th {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  background: rgba(245, 248, 255, 0.78);
}
.resource-table tr:last-child td {
  border-bottom: 0;
}
.resource-table .editing-row td {
  background: rgba(47, 107, 255, 0.045);
  vertical-align: top;
}
.table-input {
  width: 100%;
  min-width: 120px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
  font: inherit;
}
.table-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.10);
}
.resource-actions-cell {
  width: 190px;
  white-space: nowrap;
}
.resource-actions-cell .btn + .btn {
  margin-left: 6px;
}
.resource-inline-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 220px;
}
.resource-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  white-space: nowrap;
}
.resource-inline-check input {
  width: auto;
  margin: 0;
}
.resource-empty-inline {
  color: var(--muted);
  font-size: 13px;
}
.resource-empty-table {
  padding: 28px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}
@media (max-width: 860px) {
  .resource-table-header {
    align-items: stretch;
    flex-direction: column;
  }
  .resource-table {
    min-width: 760px;
  }
}
.schedule-template-table {
  min-width: 980px;
}
.schedule-template-table th:nth-child(1),
.schedule-template-table td:nth-child(1) {
  min-width: 150px;
}
.schedule-template-table th:nth-child(8),
.schedule-template-table td:nth-child(8) {
  min-width: 180px;
}
.schedule-color-input {
  min-width: 72px;
  width: 72px;
  padding: 6px;
}
.schedule-month-actions {
  align-items: center;
}
.schedule-year-select {
  min-width: 120px;
  width: 120px;
}
.schedule-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.schedule-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}
.schedule-legend-item i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.schedule-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(112px, 1fr));
  gap: 10px;
  overflow-x: auto;
}
.schedule-calendar-weekday {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}
.schedule-calendar-day {
  min-height: 94px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 10px;
}
.schedule-calendar-day.muted {
  border-style: dashed;
  background: rgba(245, 248, 255, 0.62);
}
.schedule-calendar-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text);
}
.schedule-calendar-date span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}
.schedule-day-select {
  min-width: 0;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
}
@media (max-width: 860px) {
  .schedule-calendar {
    grid-template-columns: repeat(7, 112px);
  }
  .schedule-month-actions {
    align-items: stretch;
  }
}
.page-schedule-gantt {
  min-width: 1280px;
  background: #eef3fb;
  overflow: hidden;
}
.gantt-app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  color: var(--text);
}
.gantt-topbar,
.gantt-statusbar,
.gantt-main-panel,
.gantt-side-panel > section,
.gantt-suspended-dock {
  border: 1px solid rgba(150, 166, 195, 0.32);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(32, 54, 96, 0.08);
}
.gantt-topbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, 720px) auto;
  align-items: center;
  gap: 20px;
  padding: 18px 22px;
}
.gantt-eyebrow {
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.gantt-topbar h1 {
  margin: 4px 0 0;
  font-size: 30px;
  line-height: 1.1;
}
.gantt-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.gantt-toolbar input,
.gantt-toolbar select {
  width: auto;
  min-width: 132px;
  height: 42px;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
}
.gantt-statusbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 360px) repeat(3, minmax(120px, 160px)) minmax(280px, 1fr);
  gap: 10px;
  padding: 12px 16px;
}
.gantt-statusbar > div {
  min-height: 52px;
  border-radius: 18px;
  padding: 8px 12px;
  background: #f7f9ff;
}
.gantt-statusbar span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.gantt-statusbar strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.1;
}
.gantt-message {
  display: flex;
  align-items: center;
  color: var(--primary);
  font-weight: 900;
}
.gantt-message.error {
  color: var(--danger);
}
.gantt-workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: 14px;
  align-items: stretch;
}
.gantt-main-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.gantt-scroll {
  width: 100%;
  height: 100%;
  overflow: auto;
}
.gantt-canvas {
  display: grid;
  grid-template-columns: 190px var(--timeline-width, 1188px);
  grid-template-rows: 58px auto;
  min-width: calc(190px + var(--timeline-width, 1188px));
}
.gantt-left-head {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}
.gantt-time-head {
  position: sticky;
  top: 0;
  z-index: 8;
  height: 58px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}
.gantt-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(128, 147, 180, 0.2);
}
.gantt-tick.major {
  border-left-color: rgba(47, 105, 255, 0.42);
}
.gantt-tick span {
  position: absolute;
  top: 12px;
  left: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.gantt-bed-list {
  position: sticky;
  left: 0;
  z-index: 6;
  grid-column: 1;
  grid-row: 2;
  background: #ffffff;
  border-right: 1px solid var(--line);
}
.gantt-bed-row-label {
  height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}
.gantt-bed-row-label strong {
  font-size: 18px;
}
.gantt-bed-row-label span,
.gantt-bed-row-label small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-grid {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  background-image: linear-gradient(to right, rgba(128,147,180,0.16) 1px, transparent 1px);
  background-size: calc(30 * var(--px-per-minute, 2.2px)) 100%;
}
.gantt-bed-lane {
  position: relative;
  height: 76px;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(to right, rgba(128,147,180,0.14) 1px, transparent 1px);
  background-size: 66px 100%;
}
.gantt-bed-lane:nth-child(even) {
  background-color: rgba(247, 249, 255, 0.72);
}
.gantt-dead-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  background: repeating-linear-gradient(135deg, rgba(110, 124, 148, 0.18), rgba(110, 124, 148, 0.18) 8px, rgba(110, 124, 148, 0.08) 8px, rgba(110, 124, 148, 0.08) 16px);
  border-left: 1px solid rgba(110, 124, 148, 0.24);
  border-right: 1px solid rgba(110, 124, 148, 0.24);
  pointer-events: none;
}
.gantt-dead-zone span {
  position: sticky;
  left: 12px;
  top: 8px;
  color: rgba(71, 85, 105, 0.62);
  font-size: 12px;
  font-weight: 900;
}
.gantt-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 5;
  width: 0;
  border-left: 3px solid #ef4444;
  pointer-events: none;
}
.gantt-now-line span {
  position: absolute;
  top: 6px;
  left: 7px;
  border-radius: 999px;
  padding: 3px 7px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}
.gantt-block {
  position: absolute;
  top: 10px;
  z-index: 3;
  height: 64px;
  border: 0;
  border-radius: 16px;
  padding: 8px 12px;
  color: #fff;
  text-align: left;
  box-shadow: 0 10px 24px rgba(27, 46, 87, 0.18);
  cursor: pointer;
  overflow: hidden;
}
.gantt-block strong,
.gantt-block span,
.gantt-block small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-block-card-no {
  font-size: 16px;
  line-height: 1.05;
  font-weight: 1000;
}
.gantt-block-patient-name {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.15;
  font-weight: 900;
  opacity: 0.96;
}
.gantt-block-meta {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 800;
  opacity: 0.9;
}
.gantt-block.selected {
  outline: 4px solid rgba(250, 204, 21, 0.78);
  transform: translateY(-2px);
}
.service-acupuncture {
  background: linear-gradient(135deg, #2f69ff, #1d4ed8);
}
.service-moxa {
  background: linear-gradient(135deg, #f97316, #ea580c);
}
.service-small {
  background: linear-gradient(135deg, #10b981, #059669);
}
.status-serving {
  animation: ganttPulse 1.4s ease-in-out infinite;
}
.status-completed {
  filter: grayscale(0.5);
  opacity: 0.58;
}
.status-missed {
  outline: 3px solid rgba(245, 158, 11, 0.9);
  outline-offset: -3px;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14), 0 10px 24px rgba(27, 46, 87, 0.18);
}
@keyframes ganttPulse {
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.16), 0 10px 24px rgba(27, 46, 87, 0.18); }
}
.gantt-side-panel {
  min-height: 0;
  display: block;
}
.gantt-side-panel > section {
  height: 100%;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
}
.gantt-panel-title {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
}
.gantt-detail-panel,
.gantt-detail-panel-expanded {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gantt-detail-panel-expanded {
  min-height: 100%;
}
.gantt-minimap {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  background: #f5f8ff;
}
.gantt-mini-row {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: #e5ebf6;
  overflow: hidden;
}
.gantt-mini-row i {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 999px;
}
.gantt-detail-empty,
.gantt-empty {
  border: 2px dashed var(--line);
  border-radius: 18px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}
.gantt-detail-content {
  display: grid;
  gap: 14px;
}
.gantt-detail-card-card {
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(135deg, #eef4ff, #ffffff);
}
.gantt-detail-card-no {
  color: var(--primary);
  font-size: 34px;
  font-weight: 1000;
}
.gantt-detail-patient-name {
  margin-top: 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.3;
}
.gantt-detail-content dl {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
}
.gantt-detail-content dt {
  color: var(--muted);
  font-weight: 900;
}
.gantt-detail-content dd {
  margin: 0;
  color: var(--text);
  font-weight: 900;
}
.gantt-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.gantt-detail-actions.single {
  grid-template-columns: 1fr;
}
.gantt-detail-content p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}
.gantt-suspended-dock {
  flex: 0 0 166px;
  padding: 16px;
  overflow: hidden;
}
.gantt-dock-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.gantt-dock-head strong {
  display: block;
  font-size: 18px;
}
.gantt-dock-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.gantt-suspended-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
  gap: 8px;
  max-height: 104px;
  overflow-y: auto;
  padding-right: 4px;
  align-content: start;
}
.gantt-suspended-block {
  min-width: 0;
  min-height: 72px;
  border-radius: 16px;
  padding: 10px 12px;
  color: #fff;
  box-shadow: 0 8px 18px rgba(27, 46, 87, 0.12);
  cursor: pointer;
}
.gantt-suspended-block.selected {
  outline: 4px solid rgba(250, 204, 21, 0.78);
  transform: translateY(-1px);
}
.gantt-suspended-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.gantt-suspended-topline strong,
.gantt-suspended-patient-name,
.gantt-suspended-service-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-suspended-topline strong {
  font-size: 16px;
  line-height: 1;
}
.gantt-suspended-topline em {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
  opacity: 0.9;
}
.gantt-suspended-patient-name {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
}
.gantt-suspended-service-name {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 800;
  opacity: 0.94;
}
.gantt-create-dialog {
  width: min(760px, calc(100vw - 48px));
  max-width: 760px;
  border: 0;
  border-radius: 28px;
  padding: 0;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}
.gantt-create-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}
.gantt-create-form {
  display: grid;
  gap: 18px;
  padding: 28px;
}
.gantt-create-header h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}
.gantt-create-header p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}
.gantt-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.gantt-create-field {
  display: grid;
  gap: 8px;
}
.gantt-create-field > span {
  color: #475569;
  font-size: 14px;
  font-weight: 900;
}
.gantt-create-field input {
  width: 100%;
  min-width: 0;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  background: #fff;
}
.gantt-create-field input:focus {
  outline: none;
  border-color: rgba(47, 107, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.12);
}
.gantt-create-service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.gantt-create-service-option {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}
.gantt-create-service-option strong {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
}
.gantt-create-service-option span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.gantt-create-service-option.is-active {
  border-color: rgba(47, 107, 255, 0.42);
  background: rgba(47, 107, 255, 0.08);
  box-shadow: 0 8px 22px rgba(47, 107, 255, 0.12);
}
.gantt-create-actions {
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
@media (max-width: 1320px) {
  .gantt-topbar {
    grid-template-columns: 1fr;
  }
  .gantt-workspace {
    grid-template-columns: minmax(0, 1fr) 420px;
  }
  .gantt-statusbar {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }
  .gantt-message {
    grid-column: 1 / -1;
  }
}
@media (max-width: 860px) {
  .gantt-create-dialog {
    width: calc(100vw - 20px);
  }
  .gantt-create-form {
    padding: 18px;
    gap: 14px;
  }
  .gantt-create-grid,
  .gantt-create-service-grid {
    grid-template-columns: 1fr;
  }
  .gantt-create-actions {
    justify-content: stretch;
  }
  .gantt-create-actions .btn {
    flex: 1 1 0;
  }
}

.page-schedule-debug {
  background: #eef3fb;
}
.schedule-debug-shell {
  min-height: 100vh;
  padding: 18px;
}
.schedule-debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px 22px;
}
.schedule-debug-header h1 {
  margin: 4px 0 0;
  font-size: 30px;
}
.schedule-debug-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.schedule-debug-actions span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}
.schedule-debug-panel {
  padding: 0;
  overflow: hidden;
}
.schedule-debug-output {
  min-height: calc(100vh - 170px);
  margin: 0;
  padding: 18px 20px;
  overflow: auto;
  background: #0f172a;
  color: #dbeafe;
  font-size: 14px;
  line-height: 1.65;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, monospace;
}

.schedule-debug-shell-advanced {
  gap: 20px;
}

.schedule-debug-subtitle {
  margin: 8px 0 0;
  color: #64748b;
}

.schedule-debug-grid {
  display: grid;
  grid-template-columns: minmax(360px, 420px) minmax(320px, 1fr);
  gap: 20px;
  align-items: start;
}

.schedule-control-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.schedule-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.schedule-panel-heading h2 {
  margin: 0;
  font-size: 24px;
}

.schedule-control-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.schedule-control-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: #64748b;
}

.schedule-control-toggle {
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
  padding: 12px 14px;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: #fff;
  color: #0f172a !important;
  font-weight: 700;
}

.schedule-control-toggle input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.schedule-control-form input,
.schedule-control-form select {
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  color: #0f172a;
  background: #fff;
}

.schedule-control-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.schedule-debug-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.schedule-debug-badge[data-variant='running'] {
  background: #dbeafe;
  color: #2563eb;
}

.schedule-debug-meta,
.schedule-debug-hint {
  color: #64748b;
  font-size: 14px;
}

.schedule-runner-panel {
  min-height: 320px;
}

.schedule-debug-output-runner {
  min-height: 280px;
}

@media (max-width: 1200px) {
  .schedule-debug-grid {
    grid-template-columns: 1fr;
  }
}

.patient-name-candidates {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.patient-name-candidate {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  border: 1px solid rgba(47, 107, 255, 0.18);
  border-radius: 14px;
  background: rgba(47, 107, 255, 0.06);
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

.patient-name-candidate strong {
  font-size: 15px;
  font-weight: 900;
}

.patient-name-candidate span,
.patient-name-candidate em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.patient-name-candidate em {
  justify-self: end;
  color: var(--primary);
  font-weight: 800;
}

.patient-input-tip {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.patient-input-tip.is-error {
  color: #d92d20;
}



.page-patient-v3 {
  min-height: 100dvh;
  overflow: hidden;
}
.patient-v3-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  padding-top: 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
.patient-v3-header {
  margin-top: 0;
  padding: 12px 14px;
  text-align: center;
}
.patient-v3-hide-header .patient-v3-header {
  display: none;
}
.patient-v3-step {
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}
.patient-v3-title {
  margin-top: 4px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 900;
}
.patient-v3-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.patient-v3-card-chip {
  width: fit-content;
  margin: 10px auto 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(47, 107, 255, 0.1);
  color: var(--primary);
  font-weight: 900;
  font-size: 13px;
}
.patient-v3-panel {
  margin-top: 0;
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.patient-v3-hide-header .patient-v3-panel {
  min-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
}
.patient-v3-section-title {
  font-size: 21px;
  font-weight: 900;
  line-height: 1.2;
}
.patient-v3-section-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.patient-v3-field {
  margin-top: 0;
}
.patient-v3-service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}
.patient-v3-service-option {
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  color: var(--text);
}
.patient-v3-service-option strong {
  font-size: 16px;
  font-weight: 900;
}
.patient-v3-service-option span {
  color: var(--muted);
  font-size: 12px;
}
.patient-v3-service-option.is-active {
  border-color: rgba(47, 107, 255, 0.42);
  background: rgba(47, 107, 255, 0.08);
  box-shadow: 0 8px 22px rgba(47, 107, 255, 0.12);
}
.patient-v3-time-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  overflow: hidden;
}
.patient-v3-time-field {
  min-width: 0;
}
.patient-v3-time-field input {
  min-width: 0;
  max-width: 100%;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 12px 10px;
}
.patient-v3-time-clear {
  width: 100%;
  margin-top: 2px;
}
.btn-ghost {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text);
}
.patient-v3-result-grid {
  display: grid;
  gap: 10px;
  align-content: start;
}
.patient-v3-highlight-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.patient-v3-highlight-block {
  border-radius: 18px;
  background: linear-gradient(180deg, #f7faff 0%, #eef4ff 100%);
  border: 1px solid rgba(47, 107, 255, 0.15);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.patient-v3-highlight-block span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.patient-v3-highlight-block strong {
  font-size: 22px;
  line-height: 1.05;
  font-weight: 900;
  color: #123e79;
}
.patient-v3-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.patient-v3-info-item {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 11px;
  display: grid;
  gap: 4px;
}
.patient-v3-info-item span {
  color: var(--muted);
  font-size: 12px;
}
.patient-v3-info-item strong {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.3;
}
.patient-v3-message-card {
  padding: 14px 16px;
  border-radius: 18px;
}
.patient-v3-message-card.is-warning {
  background: rgba(255, 184, 0, 0.1);
  border: 1px solid rgba(255, 184, 0, 0.28);
}
.patient-v3-message-title {
  font-size: 13px;
  color: var(--muted);
  font-weight: 900;
}
.patient-v3-message-text {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.5;
}
.patient-v3-footer-actions {
  align-self: end;
  display: grid;
  gap: 10px;
  margin-top: auto;
  position: sticky;
  bottom: 0;
  z-index: 4;
  padding-top: 10px;
  padding-bottom: calc(2px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(243, 246, 251, 0) 0%, rgba(243, 246, 251, 0.92) 22%, rgba(243, 246, 251, 1) 100%);
}
.patient-v3-footer-actions.single {
  grid-template-columns: 1fr;
}
.patient-v3-footer-actions.double {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.patient-v3-footer-actions.stacked {
  grid-template-columns: 1fr;
}
.patient-v3-footer-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.btn-danger {
  background: #d92d20;
  color: #fff;
}
.patient-v3-empty-state {
  min-height: 280px;
  display: grid;
  place-items: center;
}
@media (max-width: 420px) {
  .patient-v3-shell {
    gap: 8px;
    padding-top: 10px;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
  .patient-v3-header,
  .patient-v3-panel {
    padding: 12px;
  }
  .patient-v3-title {
    font-size: 22px;
  }
  .patient-v3-section-title {
    font-size: 19px;
  }
  .patient-v3-highlight-card,
  .patient-v3-info-grid,
  .patient-v3-service-grid {
    gap: 8px;
  }
  .patient-v3-highlight-block strong {
    font-size: 20px;
  }
  .patient-v3-service-option {
    min-height: 62px;
    padding: 10px 9px;
  }
}

.page-schedule-report {
  background: linear-gradient(180deg, #eef4ff 0%, #f7f9fe 100%);
}
.schedule-report-shell {
  display: grid;
  gap: 18px;
  padding: 22px;
}
.schedule-report-header,
.schedule-report-summary,
.schedule-report-message,
.schedule-report-table-wrap {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 24px;
  box-shadow: 0 14px 34px rgba(30, 41, 59, 0.08);
}
.schedule-report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 24px 26px;
}
.schedule-report-header h1 {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 1.2;
}
.schedule-report-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}
.schedule-report-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.schedule-report-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  padding: 16px 18px;
}
.schedule-report-summary div {
  border-radius: 18px;
  background: #f6f8fd;
  padding: 14px 16px;
}
.schedule-report-summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.schedule-report-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 1000;
}
.schedule-report-message {
  padding: 14px 18px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 900;
}
.schedule-report-message.is-error {
  color: #b91c1c;
}
.schedule-report-table-wrap {
  overflow: auto;
  padding: 0;
}
.schedule-report-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
}
.schedule-report-table th,
.schedule-report-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}
.schedule-report-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f6fc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}
.schedule-report-table tbody tr:hover {
  background: #f8fbff;
}
.report-empty {
  padding: 28px 16px !important;
  text-align: center !important;
  color: var(--muted);
  font-weight: 900;
}
.report-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.report-status-scheduled,
.report-status-missed {
  background: #fff7ed;
  color: #c2410c;
}
.report-status-serving {
  background: #ecfdf5;
  color: #047857;
}
.report-status-completed {
  background: #eff6ff;
  color: #1d4ed8;
}
.report-status-suspended {
  background: #fef3c7;
  color: #a16207;
}
.report-status-cancelled {
  background: #f3f4f6;
  color: #4b5563;
}
@media (max-width: 1320px) {
  .schedule-report-summary {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}
@media (max-width: 900px) {
  .schedule-report-header {
    flex-direction: column;
  }
  .schedule-report-toolbar {
    width: 100%;
    justify-content: flex-start;
  }
  .schedule-report-summary {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}


.page-schedule-screen {
  margin: 0;
  min-height: 100vh;
  background: #000;
  color: #fff;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.screen-app {
  min-height: 100vh;
  padding: 18px 20px;
  box-sizing: border-box;
  background: #000;
}

.screen-board {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  height: calc(100vh - 36px);
}

.screen-time-rail,
.screen-columns {
  position: relative;
  height: 100%;
  z-index: 2;
}

.screen-time-tick {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(255,255,255,0.18);
}

.screen-time-tick span {
  position: absolute;
  left: 0;
  top: -12px;
  display: inline-block;
  padding-top: 2px;
  font-size: 18px;
  line-height: 1;
  color: rgba(255,255,255,0.92);
  background: #000;
}

.screen-columns {
  display: grid;
  grid-template-columns: repeat(var(--screen-column-count, 1), minmax(0, 1fr));
  gap: 12px;
}

.screen-bed-column {
  position: relative;
  min-width: 0;
  height: 100%;
}

.screen-bed-column-empty {
  display: block;
}

.screen-bed-head {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(26px, 2vw, 38px);
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}

.screen-bed-lane {
  position: relative;
  height: calc(100% - 88px);
  margin-top: 8px;
  border-left: 1px solid rgba(255,255,255,0.12);
  border-right: 1px solid rgba(255,255,255,0.12);
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.03), rgba(255,255,255,0.01)),
    rgba(255,255,255,0.015);
}

.screen-bed-lane-empty {
  opacity: 0.2;
}

.screen-event {
  position: absolute;
  left: 8px;
  right: 8px;
  color: #fff;
  box-sizing: border-box;
  overflow: visible;
  z-index: 3;
}

.screen-event-bg {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.2);
  background: #bfc3c8;
}

.screen-event-label {
  position: absolute;
  left: 8px;
  right: 8px;
  z-index: 1;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.28);
  pointer-events: none;
}

.screen-event-label-inline {
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.screen-event-label-overlay {
  top: -2px;
  bottom: -2px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.screen-event-label-floating {
  top: 50%;
  transform: translateY(-50%);
  min-height: 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.screen-event-name-normal,
.screen-event-name-compact,
.screen-event-name-tiny,
.screen-event-meta span,
.screen-event-meta small {
  display: block;
  overflow: visible;
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
  line-height: 1.06;
}

.screen-event-name-normal {
  font-size: clamp(18px, 1.18vw, 24px);
  font-weight: 800;
}

.screen-event-name-compact {
  font-size: clamp(13px, 0.9vw, 17px);
  font-weight: 800;
}

.screen-event-name-tiny {
  font-size: clamp(11px, 0.78vw, 14px);
  font-weight: 800;
}

.screen-event-meta {
  display: flex;
  flex-direction: column;
}

.screen-event-meta-normal {
  gap: 3px;
}

.screen-event-meta-compact {
  gap: 1px;
}

.screen-event-meta-tiny {
  gap: 0;
}

.screen-event-meta-normal span {
  font-size: clamp(17px, 1.06vw, 21px);
}

.screen-event-meta-normal small {
  font-size: clamp(15px, 0.96vw, 18px);
}

.screen-event-meta-compact span {
  font-size: clamp(12px, 0.82vw, 15px);
}

.screen-event-meta-compact small {
  display: none;
}

.screen-event-meta-tiny span {
  font-size: clamp(10px, 0.72vw, 13px);
}

.screen-event-meta-tiny small {
  display: none;
}

.screen-event-normal .screen-event-bg {
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
}

.screen-event-compact .screen-event-bg,
.screen-event-tiny .screen-event-bg {
  background: #c6c9ce;
}

.screen-status-serving {
  outline: 2px solid rgba(255,255,255,0.9);
  outline-offset: -2px;
}

.screen-status-completed {
  opacity: 0.52;
}

.screen-now-line {
  position: absolute;
  left: 90px;
  right: 0;
  height: 3px;
  background: #ff2d2d;
  box-shadow: 0 0 12px rgba(255,45,45,0.66);
  z-index: 5;
  pointer-events: none;
}

.screen-lunch-band {
  position: absolute;
  left: 90px;
  right: 0;
  background: rgba(120,120,120,0.72);
  border-radius: 999px;
  z-index: 1;
  pointer-events: none;
}

.screen-call-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  box-sizing: border-box;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.screen-call-overlay.visible {
  opacity: 1;
}

.screen-call-card {
  min-width: min(820px, 72vw);
  max-width: min(980px, 82vw);
  padding: 34px 42px;
  border-radius: 28px;
  background: rgba(255,255,255,0.82);
  color: #111;
  box-shadow: 0 22px 60px rgba(0,0,0,0.34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
}

.screen-call-name {
  font-size: clamp(42px, 4.6vw, 76px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: 1px;
}

.screen-call-cardno {
  margin-top: 10px;
  font-size: clamp(34px, 3.4vw, 54px);
  line-height: 1.08;
  font-weight: 700;
}

.screen-call-destination {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: clamp(28px, 2.6vw, 42px);
  line-height: 1.18;
  font-weight: 700;
}

.screen-call-room,
.screen-call-bed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1400px) {
  .screen-board {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .screen-time-tick span {
    font-size: 15px;
  }

  .screen-now-line,
  .screen-lunch-band {
    left: 78px;
  }

  .screen-call-card {
    min-width: min(680px, 84vw);
    max-width: min(860px, 90vw);
    padding: 28px 32px;
  }
}
