/* ============================================================
   黄金枝口腔 · PC 管理后台样式
   设计令牌遵循 docs/DESIGN.md：森林绿 + 奶油白 + 暖金
   纯静态、零依赖、手写图表由 JS 生成 SVG
   ============================================================ */

:root {
  --primary: #0E8C7F;
  --primary-dark: #0A6E64;
  --primary-deep: #0B2E2A;
  --primary-soft: #E7F5F2;
  --primary-softer: #F1F9F7;
  --accent: #E9A23B;
  --accent-soft: #FDF3E3;
  --blue: #4A90D9;
  --blue-soft: #EDF4FC;
  --coral: #E8785A;
  --coral-soft: #FCEDE8;
  --ink: #17322C;
  --text: #3D4F4B;
  --muted: #84938F;
  --line: #EBF0EE;
  --line-strong: #DDE7E3;
  --bg: #F5F8F7;
  --white: #FFFFFF;
  --danger: #D9534F;
  --danger-soft: #FCECEB;

  --radius-card: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow-card: 0 12px 32px rgba(18, 60, 52, 0.06), 0 2px 6px rgba(18, 60, 52, 0.03);
  --shadow-hover: 0 18px 44px rgba(18, 60, 52, 0.10), 0 2px 8px rgba(18, 60, 52, 0.04);
  --shadow-pop: 0 24px 64px rgba(11, 46, 42, 0.18);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-num: "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --sidebar-w: 236px;
  --topbar-h: 68px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }
a { color: var(--primary); text-decoration: none; }
svg { display: block; }
::selection { background: rgba(14, 140, 127, 0.18); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #CBD9D4;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #A9BEB7; background-clip: content-box; }

.hidden { display: none !important; }
.nums { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ============================ 启动遮罩 ============================ */
.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(160deg, #0B2E2A 0%, #0E3B34 55%, #0A2924 100%);
  color: #fff;
  transition: opacity 0.28s ease;
}
.boot.is-out { opacity: 0; pointer-events: none; }
.boot-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  margin-bottom: 14px;
  background:
    radial-gradient(circle at 68% 26%, #F6C15A 0 3px, transparent 4px),
    linear-gradient(135deg, #18A596, #087468);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  position: relative;
  animation: bootPulse 1.8s ease-in-out infinite;
}
.boot-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M32 14c-5 0-8 3-8 8 0 3 1 5 2 7 1 2 1 4 1 6 0 4-2 8-2 12 0 4 2 6 5 6 3 0 4-2 6-6 1-2 2-4 3-5 1 1 2 3 3 5 2 4 3 6 6 6 3 0 5-2 5-6 0-4-2-8-2-12 0-2 0-4 1-6 1-2 2-4 2-7 0-5-3-8-8-8-2 0-4 1-6 1-2 0-4-1-6-1z' fill='%23FFFFFF'/%3E%3C/svg%3E") center / 62% no-repeat;
}
.boot-name { font-size: 18px; font-weight: 700; letter-spacing: 0.08em; }
.boot-sub { font-size: 12px; color: rgba(255, 255, 255, 0.55); letter-spacing: 0.1em; }
@keyframes bootPulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28); }
  50% { transform: translateY(-5px); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.34); }
}

/* ============================ 应用骨架 ============================ */
.app { min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  color: rgba(255, 255, 255, 0.82);
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(23, 162, 147, 0.18), transparent 60%),
    radial-gradient(100% 50% at 100% 100%, rgba(233, 162, 59, 0.10), transparent 62%),
    linear-gradient(180deg, #0B2E2A 0%, #0A2824 58%, #08211E 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  transition: width 0.22s ease;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 70%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 18px;
  min-height: 78px;
}
.brand-mark {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: linear-gradient(135deg, #19A798, #0A756A);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M32 14c-5 0-8 3-8 8 0 3 1 5 2 7 1 2 1 4 1 6 0 4-2 8-2 12 0 4 2 6 5 6 3 0 4-2 6-6 1-2 2-4 3-5 1 1 2 3 3 5 2 4 3 6 6 6 3 0 5-2 5-6 0-4-2-8-2-12 0-2 0-4 1-6 1-2 2-4 2-7 0-5-3-8-8-8-2 0-4 1-6 1-2 0-4-1-6-1z' fill='%23FFFFFF'/%3E%3C/svg%3E") center / 64% no-repeat;
}
.brand-mark::before {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  top: 7px;
  right: 7px;
  box-shadow: 0 0 0 2px rgba(233, 162, 59, 0.22);
}
.brand-text { min-width: 0; }
.brand-name {
  color: #fff;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.brand-sub {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.46);
  letter-spacing: 0.16em;
  white-space: nowrap;
  margin-top: 1px;
}

.nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 12px 20px;
}
.nav::-webkit-scrollbar { width: 5px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); background-clip: content-box; }

.nav-label {
  padding: 16px 12px 8px;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.34);
  white-space: nowrap;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 42px;
  padding: 0 12px;
  margin-bottom: 3px;
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
  transition: background 0.16s ease, color 0.16s ease;
  white-space: nowrap;
}
.nav-item svg { flex: none; opacity: 0.88; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(23, 162, 147, 0.30), rgba(23, 162, 147, 0.13));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(94, 225, 208, 0.14);
}
.nav-item.active svg { color: #6EE7D8; opacity: 1; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #5EE0D1, #0E8C7F);
}
.nav-item .nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(233, 162, 59, 0.18);
  color: #F3C57C;
  font-size: 10.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-item .nav-badge:empty { display: none; }

.sidebar-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 14px 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.side-avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #4A2E05;
  background: linear-gradient(135deg, #F7C979, #E9A23B);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.side-user { min-width: 0; flex: 1; }
.side-user-name {
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-user-role { font-size: 10.5px; color: rgba(255, 255, 255, 0.42); }
.side-logout {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.side-logout:hover { background: rgba(232, 120, 90, 0.22); color: #FFC9BC; }

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.22s ease;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 30px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumb-root { font-size: 12.5px; color: var(--muted); }
.crumb-sep { color: #C6D3CE; font-size: 12px; }
.crumb-current { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.env-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.env-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #21B39F;
  box-shadow: 0 0 0 3px rgba(33, 179, 159, 0.16);
}
.topbar-date {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.topbar-icon {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #5E736D;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.topbar-icon:hover { border-color: #CFE3DD; color: var(--primary); box-shadow: 0 4px 12px rgba(18, 60, 52, 0.06); }
.topbar-icon .dot-red {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 2px #fff;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}
.topbar-user .side-avatar { width: 28px; height: 28px; font-size: 11px; }
.topbar-user-name { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.topbar-user-role { font-size: 10.5px; color: var(--muted); margin-top: -1px; }

.content {
  flex: 1;
  min-width: 0;
  padding: 24px 30px 48px;
}
.page { animation: pageIn 0.3s cubic-bezier(0.22, 0.61, 0.36, 1); }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================ 页面标题 ============================ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.page-sub { margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #9A6416;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid #F6E3C4;
}
.head-chip .val { font-family: var(--font-num); font-size: 14px; font-weight: 700; color: #8A5710; }

/* ============================ 卡片与网格 ============================ */
.card {
  background: var(--white);
  border: 1px solid rgba(235, 240, 238, 0.95);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  min-width: 0;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 0;
}
.card-title { font-size: 14.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.card-title .mark {
  width: 6px;
  height: 16px;
  border-radius: 3px;
  background: linear-gradient(180deg, #21B39F, #0E8C7F);
}
.card-sub { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.card-body { padding: 16px 20px 20px; }
.card-body.tight { padding: 12px 16px 16px; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.card-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: 0;
  padding: 0;
}
.card-link:hover { color: var(--primary-dark); }

.grid { display: grid; gap: 18px; }
.grid + .grid { margin-top: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-dash-main { grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr); }
.grid-dash-bottom { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ============================ 指标卡 ============================ */
.metric {
  position: relative;
  overflow: hidden;
  padding: 18px 19px 16px;
  background: #fff;
  border: 1px solid rgba(235, 240, 238, 0.95);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.metric::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -46px;
  top: -52px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.045;
}
.metric-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.metric-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.metric-ico {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.metric.tone-teal { color: var(--primary); }
.metric.tone-teal .metric-ico { background: var(--primary-soft); color: var(--primary); }
.metric.tone-blue { color: var(--blue); }
.metric.tone-blue .metric-ico { background: var(--blue-soft); color: var(--blue); }
.metric.tone-gold { color: var(--accent); }
.metric.tone-gold .metric-ico { background: var(--accent-soft); color: #C98622; }
.metric.tone-coral { color: var(--coral); }
.metric.tone-coral .metric-ico { background: var(--coral-soft); color: var(--coral); }
.metric-value {
  margin-top: 12px;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 29px;
  line-height: 1.12;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.metric-value .unit { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.metric-foot {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}
.metric-foot .trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 19px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--primary-softer);
  color: var(--primary-dark);
}
.metric-foot .trend.down { background: var(--coral-soft); color: #B4553B; }
.metric-spark { margin-top: 8px; height: 26px; }
.metric-spark svg { width: 100%; height: 26px; }

/* ============================ 手写 SVG 图表 ============================ */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart-grid-line { stroke: #EEF3F1; stroke-width: 1; }
.chart-axis-text { fill: #96A5A0; font-size: 10.5px; font-family: var(--font-sans); }
.chart-area { fill: url(#areaGrad); }
.chart-line {
  fill: none;
  stroke: url(#lineGrad);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: drawLine 1.1s ease forwards 0.1s;
}
@keyframes drawLine { to { stroke-dashoffset: 0; } }
.chart-dot { fill: #fff; stroke: var(--primary); stroke-width: 2.2; }
.chart-dot-halo { fill: rgba(14, 140, 127, 0.10); }
.chart-point-label {
  fill: #0A6E64;
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font-num);
  opacity: 0;
  animation: fadeIn 0.5s ease forwards 0.9s;
}
.chart-point-label.is-today { fill: #fff; }
.chart-today-pill { fill: #0E8C7F; }
@keyframes fadeIn { to { opacity: 1; } }
.chart-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.chart-legend .li { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.chart-legend .swatch { width: 8px; height: 8px; border-radius: 3px; background: var(--primary); }
.chart-kpi { display: flex; gap: 22px; }
.chart-kpi .item .k { font-size: 11px; color: var(--muted); }
.chart-kpi .item .v { font-family: var(--font-num); font-size: 18px; font-weight: 700; color: var(--ink); margin-top: 1px; }
.chart-kpi .item .v small { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 2px; }

.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { width: 150px; height: 150px; flex: none; position: relative; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-seg { fill: none; stroke-width: 15; stroke-linecap: round; transition: stroke-dasharray 0.6s ease; }
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.donut-center .num { font-family: var(--font-num); font-size: 23px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.donut-center .lbl { font-size: 10.5px; color: var(--muted); margin-top: 2px; letter-spacing: 0.04em; }
.donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-row .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.legend-row .name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-row .val { margin-left: auto; font-family: var(--font-num); font-weight: 600; color: var(--ink); font-size: 12px; }
.legend-row .ratio { width: 34px; text-align: right; color: var(--muted); font-size: 11px; font-family: var(--font-num); }

.bar-list { display: flex; flex-direction: column; gap: 15px; }
.bar-row .bar-top { display: flex; align-items: baseline; gap: 8px; }
.bar-row .rank {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #F2F7F5;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.bar-row:nth-child(1) .rank { background: #FDF3E3; color: #B4791B; }
.bar-row:nth-child(2) .rank { background: #EDF4FC; color: #3A78BA; }
.bar-row:nth-child(3) .rank { background: var(--primary-soft); color: var(--primary-dark); }
.bar-row .bar-name { font-size: 12.5px; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bar-amount { margin-left: auto; font-family: var(--font-num); font-size: 12px; font-weight: 700; color: var(--ink); }
.bar-track { margin-top: 7px; height: 7px; border-radius: 999px; background: #F1F6F4; overflow: hidden; }
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #17A293, #0E8C7F);
  width: 0;
  animation: barGrow 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.bar-row:nth-child(2) .bar-fill { background: linear-gradient(90deg, #6BA9E4, #4A90D9); }
.bar-row:nth-child(3) .bar-fill { background: linear-gradient(90deg, #F3BE6B, #E9A23B); }
.bar-row:nth-child(4) .bar-fill { background: linear-gradient(90deg, #F09C83, #E8785A); }
@keyframes barGrow { to { width: var(--w); } }
.bar-meta { margin-top: 4px; font-size: 10.5px; color: var(--muted); display: flex; justify-content: space-between; }

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: transform 0.12s ease, box-shadow 0.16s ease, background 0.16s ease,
    border-color 0.16s ease, color 0.16s ease;
  background: #fff;
  color: var(--text);
}
.btn:active { transform: scale(0.977); }
.btn:focus-visible { outline: 2px solid rgba(14, 140, 127, 0.35); outline-offset: 2px; }
.btn svg { flex: none; }
.btn[disabled], .btn.is-disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.btn.is-busy { pointer-events: none; opacity: 0.82; }

.btn-primary {
  background: linear-gradient(135deg, #17A293, #0A756A);
  color: #fff;
  box-shadow: 0 8px 18px rgba(14, 140, 127, 0.24);
}
.btn-primary:hover { box-shadow: 0 10px 24px rgba(14, 140, 127, 0.32); filter: brightness(1.02); }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); border-color: transparent; }
.btn-soft:hover { background: #DBF1ED; }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: #C8DCD6; color: var(--primary-dark); background: #FBFDFC; }
.btn-danger-soft { background: var(--danger-soft); color: #B4433F; }
.btn-danger-soft:hover { background: #F9E0DE; }
.btn-danger { background: linear-gradient(135deg, #E8785A, #D9534F); color: #fff; box-shadow: 0 8px 18px rgba(217, 83, 79, 0.22); }
.btn-link {
  height: auto;
  padding: 0;
  background: none;
  border: 0;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
}
.btn-link:hover { color: var(--primary-dark); }
.btn-link.danger { color: #C0564F; }
.btn-link.muted { color: var(--muted); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 8px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-block { width: 100%; }
.btn-lg { height: 44px; font-size: 14px; border-radius: 12px; }

.spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  flex: none;
}
.spinner.dark { border-color: rgba(14, 140, 127, 0.22); border-top-color: var(--primary); }
.btn-ghost .spinner, .btn-soft .spinner, .btn-link .spinner { border-color: rgba(10, 110, 100, 0.2); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-group { display: inline-flex; align-items: center; gap: 4px; }
.btn-group .btn { height: 28px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; }

/* ============================ 表格 ============================ */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
table.data thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #8A9A95;
  background: #FAFCFB;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data thead th:first-child { padding-left: 20px; }
table.data thead th:last-child { padding-right: 20px; text-align: right; }
table.data tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #F1F5F3;
  color: var(--text);
  vertical-align: middle;
}
table.data tbody td:first-child { padding-left: 20px; }
table.data tbody td:last-child { padding-right: 20px; text-align: right; }
table.data tbody tr { transition: background 0.14s ease; }
table.data tbody tr:hover { background: #FAFDFC; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .cell-strong { font-weight: 600; color: var(--ink); }
table.data .cell-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
table.data .cell-num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
table.data .cell-money { font-family: var(--font-num); font-weight: 700; color: var(--ink); }
table.data .cell-money.accent { color: #A66A13; }
table.data .row-actions { display: inline-flex; align-items: center; gap: 10px; justify-content: flex-end; }
table.data .row-actions .btn-link { white-space: nowrap; }
.mono { font-family: var(--font-num); font-size: 11.5px; color: #62766F; letter-spacing: 0.01em; }

.patient-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.mini-avatar {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark);
  background: linear-gradient(135deg, #E7F5F2, #D6EDE8);
}
.mini-avatar.gold { color: #8A5710; background: linear-gradient(135deg, #FDF3E3, #F8E5C6); }
.mini-avatar.blue { color: #31618F; background: linear-gradient(135deg, #EDF4FC, #DCEAF9); }
.mini-avatar.coral { color: #A24A34; background: linear-gradient(135deg, #FCEDE8, #F8DCD4); }

/* ============================ 徽标 / 状态 ============================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  background: #F2F6F4;
  color: #6B7D77;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.badge.pending { background: var(--accent-soft); color: #A9761B; }
.badge.confirmed { background: #FBF0D8; color: #916614; }
.badge.arrived { background: var(--blue-soft); color: #356FA8; }
.badge.finished { background: var(--primary-soft); color: var(--primary-dark); }
.badge.cancelled { background: #F1F4F3; color: #84938F; }
.badge.noshow { background: var(--coral-soft); color: #B4553B; }
.badge.teal { background: var(--primary-soft); color: var(--primary-dark); }
.badge.gold { background: var(--accent-soft); color: #A9761B; }
.badge.blue { background: var(--blue-soft); color: #356FA8; }
.badge.gray { background: #F1F4F3; color: #84938F; }
.badge.red { background: var(--coral-soft); color: #B4553B; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  background: #F4F8F6;
  color: #6F837C;
  font-size: 10.5px;
  white-space: nowrap;
}

/* ============================ Tabs ============================ */
.tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  background: #F4F8F6;
  border-radius: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #6C807A;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab:hover { color: var(--primary-dark); }
.tab.active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 3px 10px rgba(18, 60, 52, 0.08);
}
.tab .tab-count {
  min-width: 18px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(14, 140, 127, 0.1);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tab.active .tab-count { background: var(--primary); color: #fff; }

.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: #F4F8F6; gap: 2px; }
.segmented button {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6C807A;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.segmented button.active { background: #fff; color: var(--primary-dark); box-shadow: 0 2px 8px rgba(18, 60, 52, 0.08); }

/* ============================ 表单 ============================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar .spacer { flex: 1; }
.input-wrap { position: relative; display: inline-flex; align-items: center; }
.input-wrap > svg {
  position: absolute;
  left: 11px;
  color: #97A6A1;
  pointer-events: none;
}
.input-wrap input { padding-left: 33px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label {
  font-size: 11.5px;
  font-weight: 600;
  color: #70837C;
  display: flex;
  align-items: center;
  gap: 4px;
}
.field > label .req { color: var(--coral); font-weight: 700; }
.field-hint { font-size: 10.5px; color: var(--muted); }
.field-error { font-size: 10.5px; color: #C0564F; }

input[type="text"],
input[type="search"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #FCFEFD;
  color: var(--ink);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  min-width: 0;
}
textarea { height: auto; padding: 9px 11px; line-height: 1.6; resize: vertical; }
input::placeholder, textarea::placeholder { color: #AEBDB8; }
input:hover, select:hover, textarea:hover { border-color: #C9DDD7; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(14, 140, 127, 0.1);
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2384938F' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
input[type="date"] { padding-right: 8px; color: var(--ink); }
input[type="number"] { font-family: var(--font-num); }
input[type="number"]::-webkit-inner-spin-button { opacity: 0.4; }
.input-sm { height: 32px; font-size: 12px; }
.w-160 { width: 160px; }
.w-200 { width: 200px; }
.w-220 { width: 220px; }
.w-260 { width: 260px; }
.w-full { width: 100%; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #DCE6E2;
  position: relative;
  transition: background 0.18s ease;
  flex: none;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(18, 60, 52, 0.24);
  transition: transform 0.18s ease;
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(14, 140, 127, 0.16); }
.switch .switch-label { font-size: 12px; color: var(--text); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-section-title {
  grid-column: span 2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #9AA9A4;
  padding-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ============================ 弹窗 ============================ */
.modal-root { position: fixed; inset: 0; z-index: 120; pointer-events: none; }
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 33, 29, 0.46);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 7vh 20px 40px;
  overflow-y: auto;
}
.modal-overlay.is-open { opacity: 1; }
.modal {
  width: 100%;
  max-width: 580px;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-pop);
  transform: translateY(14px) scale(0.985);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.2s ease;
  margin: auto 0;
}
.modal-overlay.is-open .modal { transform: translateY(0) scale(1); opacity: 1; }
.modal.is-wide { max-width: 720px; }
.modal.is-narrow { max-width: 420px; }
.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 14px;
}
.modal-head .modal-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.modal-head .modal-sub { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.modal-close {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: #F5F8F7;
  color: #7C8F88;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal-close:hover { background: #ECF2F0; color: var(--ink); }
.modal-body { padding: 4px 22px 6px; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px 20px;
}
.modal-foot .left { margin-right: auto; }
.modal-msg { font-size: 13.5px; color: var(--text); line-height: 1.7; }
.modal-msg b { color: var(--ink); }
.modal-warn {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: #8A5710;
  font-size: 11.5px;
  line-height: 1.6;
}

/* ============================ Toast ============================ */
.toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 32px));
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 220px;
  max-width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(11, 46, 42, 0.16);
  font-size: 12.5px;
  color: var(--ink);
  animation: toastIn 0.24s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.toast.is-out { animation: toastOut 0.22s ease forwards; }
.toast .toast-ico { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.toast.success { border-left: 3px solid var(--primary); }
.toast.success .toast-ico { color: var(--primary); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.error .toast-ico { color: var(--danger); }
.toast.info { border-left: 3px solid var(--blue); }
.toast.info .toast-ico { color: var(--blue); }
.toast.warn { border-left: 3px solid var(--accent); }
.toast.warn .toast-ico { color: #C98622; }
@keyframes toastIn { from { opacity: 0; transform: translateX(18px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(14px); } }

/* ============================ 空态 / 加载 / 错误 ============================ */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 42px 20px;
  gap: 4px;
}
.empty-ico {
  width: 66px;
  height: 66px;
  border-radius: 22px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.9), transparent 45%),
    linear-gradient(145deg, #EAF7F4, #DDF0EC);
  box-shadow: inset 0 1px 0 #fff, 0 8px 18px rgba(14, 140, 127, 0.08);
}
.empty-ico svg { width: 30px; height: 30px; }
.empty-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.empty-desc { font-size: 12px; color: var(--muted); max-width: 320px; }
.empty .btn { margin-top: 12px; }
.empty.is-error .empty-ico {
  color: var(--coral);
  background: linear-gradient(145deg, #FDEDE9, #FBE1DA);
  box-shadow: inset 0 1px 0 #fff, 0 8px 18px rgba(232, 120, 90, 0.1);
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #EEF4F2;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-line { height: 12px; margin: 7px 0; }
.sk-line.w60 { width: 60%; }
.sk-line.w40 { width: 40%; }
.sk-line.w80 { width: 80%; }
.sk-card { height: 108px; border-radius: var(--radius-card); }
.sk-row { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid #F1F5F3; }
.sk-row .av { width: 32px; height: 32px; border-radius: 10px; flex: none; }
.sk-row .grow { flex: 1; min-width: 0; }
.sk-chart { height: 236px; border-radius: 12px; }
.sk-donut { width: 150px; height: 150px; border-radius: 50%; flex: none; }

.inline-error {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #C0564F;
}

/* ============================ 登录页 ============================ */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  background: #fff;
}
.login-brand {
  position: relative;
  overflow: hidden;
  padding: 54px 58px;
  color: #fff;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(80% 60% at 12% 8%, rgba(23, 162, 147, 0.30), transparent 60%),
    radial-gradient(70% 50% at 92% 96%, rgba(233, 162, 59, 0.14), transparent 58%),
    linear-gradient(155deg, #0B2E2A 0%, #0C3630 48%, #082421 100%);
}
.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(90% 80% at 30% 20%, #000, transparent 78%);
}
.login-lockup { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.login-lockup .brand-mark { width: 46px; height: 46px; border-radius: 15px; }
.login-lockup .name { font-size: 17px; font-weight: 700; letter-spacing: 0.06em; }
.login-lockup .sub { font-size: 10.5px; letter-spacing: 0.2em; color: rgba(255, 255, 255, 0.5); margin-top: 2px; }
.login-hero { margin-top: auto; margin-bottom: auto; position: relative; z-index: 1; padding: 40px 0; }
.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #8FE6DA;
  margin-bottom: 20px;
}
.login-hero h1 {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
}
.login-hero h1 em { font-style: normal; color: #F3C57C; }
.login-hero p {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.58);
  max-width: 380px;
}
.login-features { margin-top: 30px; display: flex; flex-direction: column; gap: 13px; }
.login-feature { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: rgba(255, 255, 255, 0.74); }
.login-feature .ico {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: #7EE4D6;
}
.login-stats {
  display: flex;
  gap: 34px;
  margin-top: 38px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
}
.login-stat .v { font-family: var(--font-num); font-size: 22px; font-weight: 700; color: #fff; }
.login-stat .v small { font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, 0.45); margin-left: 2px; }
.login-stat .k { font-size: 10.5px; color: rgba(255, 255, 255, 0.42); margin-top: 2px; letter-spacing: 0.06em; }
.login-tooth {
  position: absolute;
  right: -40px;
  top: 50%;
  width: 340px;
  height: 420px;
  transform: translateY(-50%);
  opacity: 0.06;
  pointer-events: none;
}
.login-legal {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.32);
  line-height: 1.7;
}
.login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background:
    radial-gradient(70% 50% at 100% 0%, #F0F8F6, transparent 60%),
    #fff;
}
.login-card { width: 100%; max-width: 372px; }
.login-card .hello { font-size: 11.5px; letter-spacing: 0.16em; color: var(--primary); font-weight: 700; }
.login-card h2 { margin-top: 8px; font-size: 25px; font-weight: 700; color: var(--ink); letter-spacing: 0.01em; }
.login-card .tip { margin-top: 7px; font-size: 12.5px; color: var(--muted); }
.login-form { margin-top: 28px; display: flex; flex-direction: column; gap: 15px; }
.login-field label { display: block; font-size: 11.5px; font-weight: 600; color: #70837C; margin-bottom: 6px; }
.login-field .input-shell { position: relative; }
.login-field .input-shell svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #97A6A1; }
.login-field input {
  width: 100%;
  height: 44px;
  padding: 0 13px 0 40px;
  border-radius: 11px;
  font-size: 13.5px;
  background: #FBFDFC;
}
.login-field input:focus { background: #fff; }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: -2px; }
.checkbox { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.checkbox input { width: 15px; height: 15px; accent-color: var(--primary); margin: 0; }
.login-name { color: var(--primary); font-weight: 600; cursor: pointer; background: none; border: 0; padding: 0; font-size: 12px; }
.login-error {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: #B4433F;
  font-size: 11.5px;
  line-height: 1.5;
}
.login-error.show { display: flex; }
.login-submit { height: 46px; border-radius: 12px; font-size: 14px; letter-spacing: 0.04em; }
.login-hint {
  margin-top: 18px;
  padding: 13px 15px;
  border-radius: 12px;
  background: #F7FBF9;
  border: 1px dashed #D9E8E3;
  font-size: 11.5px;
  color: #70837C;
  line-height: 1.8;
}
.login-hint b { color: var(--primary-dark); font-family: var(--font-num); }
.login-hint .demo-btn { margin-left: 6px; }
.login-foot { margin-top: 26px; font-size: 10.5px; color: #AEBDB8; text-align: center; line-height: 1.8; }

/* 登录状态下页面内联 loading */
.login-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  color: var(--muted);
  font-size: 12px;
}

/* ============================ 医生卡片 ============================ */
.doctor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.doctor-card {
  position: relative;
  background: #fff;
  border: 1px solid rgba(235, 240, 238, 0.95);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.doctor-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.doctor-card.is-off { background: #FCFDFD; }
.doctor-card.is-off .doctor-name { color: #7C8F88; }
.doctor-top { display: flex; align-items: flex-start; gap: 12px; }
.doctor-avatar {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #17A293, #0A756A);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 14px rgba(14, 140, 127, 0.18);
  position: relative;
}
.doctor-avatar.tone-gold { background: linear-gradient(135deg, #F3BE6B, #D98B22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 14px rgba(217, 139, 34, 0.2); }
.doctor-avatar.tone-blue { background: linear-gradient(135deg, #6BA9E4, #3D7FC0); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 14px rgba(74, 144, 217, 0.2); }
.doctor-avatar.tone-coral { background: linear-gradient(135deg, #F09C83, #DC6C4B); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 14px rgba(232, 120, 90, 0.2); }
.doctor-avatar .online-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #21B39F;
  border: 2px solid #fff;
}
.doctor-avatar .online-dot.off { background: #B9C6C1; }
.doctor-info { min-width: 0; flex: 1; }
.doctor-name { font-size: 15px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.doctor-title { margin-top: 2px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doctor-dept { margin-top: 6px; }
.doctor-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; min-height: 20px; }
.doctor-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.doctor-stat { flex: 1; text-align: center; min-width: 0; }
.doctor-stat + .doctor-stat { border-left: 1px solid var(--line); }
.doctor-stat .v { font-family: var(--font-num); font-size: 14px; font-weight: 700; color: var(--ink); }
.doctor-stat .v small { font-size: 10px; color: var(--muted); font-weight: 500; }
.doctor-stat .k { font-size: 10px; color: var(--muted); margin-top: 1px; }
.doctor-intro {
  margin-top: 11px;
  font-size: 11.5px;
  color: #7C8F88;
  line-height: 1.62;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 35px;
}
.doctor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.doctor-actions .btn-link.ml-auto { margin-left: auto; }
.doctor-card .status-corner { margin-left: auto; flex: none; }

/* ============================ 排班周视图 ============================ */
.schedule-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.week-nav { display: inline-flex; align-items: center; gap: 4px; }
.week-range {
  min-width: 178px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  align-items: start;
}
.day-col {
  background: #fff;
  border: 1px solid rgba(235, 240, 238, 0.95);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.day-col.is-today { border-color: rgba(14, 140, 127, 0.45); box-shadow: 0 0 0 1px rgba(14, 140, 127, 0.16), var(--shadow-card); }
.day-col.is-stopped { background: #FBFCFC; }
.day-head {
  padding: 9px 12px 7px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #FBFDFC, #fff);
}
.day-head-row { display: flex; align-items: center; gap: 6px; }
.day-week { font-size: 11px; color: var(--muted); font-weight: 600; }
.day-date { font-family: var(--font-num); font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.day-today-pill {
  margin-left: auto;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}
.day-meta { margin-top: 3px; font-size: 10.5px; color: var(--muted); display: flex; gap: 8px; }
.day-meta b { color: var(--primary-dark); font-family: var(--font-num); font-weight: 700; }
.day-stop-row { margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.day-stop-row .switch .track { width: 30px; height: 17px; }
.day-stop-row .switch .track::after { width: 13px; height: 13px; }
.day-stop-row .switch input:checked + .track::after { transform: translateX(13px); }
.day-stop-row .switch-label { font-size: 10.5px; color: var(--muted); }
.day-slots { padding: 7px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.slot {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 7px;
  background: #FCFEFD;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.slot:hover { border-color: #D3E6E0; background: #fff; }
.slot-top { display: flex; align-items: center; gap: 4px; min-width: 0; }
.slot-time {
  width: 100%;
  min-width: 0;
  flex: 1;
  height: 21px;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.slot-time:hover { border-color: var(--line-strong); background: #fff; }
.slot-time:focus { border-color: var(--primary); background: #fff; box-shadow: none; }
.slot-remove {
  flex: none;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #B2C1BC;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.slot-remove:hover { background: var(--danger-soft); color: #C0564F; }
.slot-bottom {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  min-width: 0;
  white-space: nowrap;
}
.slot-period {
  flex: none;
  font-size: 9px;
  color: var(--muted);
  padding: 0 4px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  background: #F3F7F5;
}
.slot-remain { flex: none; font-size: 9px; color: #7C8F88; }
.slot-remain b { color: var(--primary-dark); font-family: var(--font-num); }
.slot-total {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  flex: none;
}
.slot-total input {
  width: 32px;
  height: 19px;
  padding: 0 3px;
  text-align: center;
  font-family: var(--font-num);
  font-size: 10.5px;
  border-radius: 6px;
  background: #fff;
}
.day-empty { padding: 14px 8px; text-align: center; font-size: 10.5px; color: #A9B8B3; }
.day-foot {
  padding: 6px 8px 8px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.day-add {
  height: 25px;
  border: 1px dashed #D5E4DF;
  border-radius: 8px;
  background: #FBFDFC;
  color: #7E938C;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.day-add:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-softer); }
.day-add[disabled] { opacity: 0.45; pointer-events: none; }
.day-actions { display: flex; gap: 6px; }
.day-actions .btn { flex: 1; height: 27px; font-size: 11px; padding: 0 8px; border-radius: 8px; }
.day-dirty-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); display: inline-block; }
.schedule-loading { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.schedule-loading .day-col { height: 360px; }

/* ============================ 响应式 ============================ */
@media (max-width: 1360px) {
  .content { padding: 22px 24px 44px; }
  .topbar { padding: 0 24px; }
  .doctor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .donut { width: 132px; height: 132px; }
}
@media (max-width: 1180px) {
  :root { --sidebar-w: 76px; }
  .brand { justify-content: center; padding: 18px 0 14px; }
  .brand-text, .nav-label, .nav-item span.nav-text, .nav-item .nav-badge, .side-user, .side-logout { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item.active::before { left: -12px; }
  .sidebar-foot { justify-content: center; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-dash-main, .grid-dash-bottom { grid-template-columns: minmax(0, 1fr); }
  .week-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .schedule-loading { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .login { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .login-brand { padding: 40px; }
}
@media (max-width: 960px) {
  .login-brand { display: none; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doctor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: span 1; }
  .form-section-title { grid-column: span 1; }
  .topbar-date { display: none; }
}
@media (max-width: 720px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  .content { padding: 16px 14px 40px; }
  .topbar { padding: 0 14px; }
  .grid-4, .doctor-grid, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .week-grid, .schedule-loading { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-title { font-size: 19px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ============================ 打印 ============================ */
@media print {
  .sidebar, .topbar, .page-actions, .toast-root { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ============================ 补充：外壳与登录细节 ============================ */
.app-shell { min-height: 100vh; }
body.is-login { background: #fff; }
.only-mobile { display: none !important; }

.login-field input { padding-right: 44px; }
.pw-toggle {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #97A6A1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.pw-toggle:hover { background: #EEF6F3; color: var(--primary); }
.login-field .input-shell .pw-toggle svg {
  position: static;
  transform: none;
  top: auto;
  left: auto;
}

@media (max-width: 720px) {
  .only-mobile { display: inline-flex !important; }
  .app.sidebar-open .sidebar {
    transform: none;
    width: 236px;
    box-shadow: 0 0 60px rgba(3, 20, 17, 0.5);
  }
  .app.sidebar-open .brand { justify-content: flex-start; padding: 20px 18px 18px; }
  .app.sidebar-open .brand-text,
  .app.sidebar-open .nav-label,
  .app.sidebar-open .nav-item span.nav-text,
  .app.sidebar-open .nav-item .nav-badge,
  .app.sidebar-open .side-user,
  .app.sidebar-open .side-logout { display: block; }
  .app.sidebar-open .nav-item { justify-content: flex-start; padding: 0 12px; }
  .app.sidebar-open .sidebar-foot { justify-content: flex-start; }
  .app.sidebar-open .side-logout { display: flex; }
}
