@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700;800&display=swap');

:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #e8ecf4;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
}

* {
  box-sizing: border-box;
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #0f172a;
  color: #e5e7eb;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sidebar .menu {
  flex: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
}

.menu {
  display: grid;
  gap: 8px;
}

.menu a {
  text-decoration: none;
  color: #cbd5e1;
  padding: 11px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.menu a.active,
.menu a:hover {
  background: rgba(59, 130, 246, 0.18);
  color: #fff;
}

.main {
  display: grid;
  grid-template-rows: 70px 1fr;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
}

.title {
  font-size: 20px;
  font-weight: 700;
}

.content {
  padding: 18px 22px 22px;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

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

.kpi {
  font-size: 30px;
  font-weight: 800;
  margin-top: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.chip.success { background: #dcfce7; color: #166534; }
.chip.warn { background: #fef3c7; color: #92400e; }
.chip.danger { background: #fee2e2; color: #991b1b; }
.chip.info { background: #dbeafe; color: #1d4ed8; }

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  font-size: 14px;
}

.table th {
  color: #475569;
  background: #f8fafc;
  font-weight: 700;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.ghost {
  background: #eef2ff;
  color: #1e40af;
}

.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.input,
.select {
  height: 38px;
  border: 1px solid #dbe2ef;
  background: #fff;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
}

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

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

.slot {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

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

.counter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.counter button {
  width: 24px;
  height: 24px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

.frame-note {
  font-size: 12px;
  color: #64748b;
}

/* 时段列表（参考小程序式排班编辑，沿用后台变量色） */
.slot-settings-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  padding: 12px 14px;
  background: #f1f5f9;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 13px;
}

.slot-settings-bar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text);
}

.slot-day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.slot-day-head strong {
  font-size: 15px;
}

.slot-day-head .quota-hint {
  font-size: 13px;
  color: var(--muted);
}

.slot-row-grid {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) minmax(88px, 1fr) minmax(72px, 0.7fr) 36px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f7;
}

.slot-row-grid:last-of-type {
  border-bottom: none;
}

.slot-time-input {
  width: 100%;
  height: 38px;
  border: 1px solid #dbe2ef;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

.slot-time-input:read-only {
  background: #f8fafc;
  color: #475569;
}

.slot-cap-input {
  width: 100%;
  height: 38px;
  border: 1px solid #dbe2ef;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.slot-remove-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: #f1f5f9;
  color: #94a3b8;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.slot-remove-btn:hover {
  background: #fee2e2;
  color: var(--danger);
}

.slot-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.slot-actions-row button.linkish {
  border: none;
  background: none;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.slot-footer-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.slot-footer-actions .btn {
  flex: 1;
  padding: 12px 16px;
  font-size: 15px;
}

.btn.secondary-muted {
  background: #e2e8f0;
  color: #475569;
}

/* 诊所信息页等：纵向表单，避免 label/input inline 挤成一行 */
.clinic-form {
  max-width: 720px;
}

.clinic-form .form-intro {
  margin-bottom: 20px;
  line-height: 1.65;
}

.clinic-form .field-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-bottom: 18px;
}

.clinic-form .field-row:last-of-type {
  margin-bottom: 0;
}

.clinic-form .field-row label.field-label {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}

.clinic-form .field-row .field-desc {
  font-size: 12px;
  font-weight: 400;
  color: #94a3b8;
  line-height: 1.45;
  margin-top: -2px;
}

.clinic-form .field-row input.input,
.clinic-form .field-row textarea.input {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.clinic-form .field-row textarea.input {
  min-height: 96px;
  height: auto;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}

.clinic-form .form-actions {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.clinic-form .form-actions .btn.primary {
  min-width: 120px;
}

/* 后台通用弹层（预约详情等） */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 16px;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  background: #fff;
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 22px 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
}

.modal-card h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.modal-kv {
  display: grid;
  gap: 0;
  font-size: 14px;
}

.modal-kv .kv-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.modal-kv .kv-k {
  color: var(--muted);
  flex-shrink: 0;
}

.modal-kv .kv-v {
  text-align: right;
  word-break: break-all;
}

.modal-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
