/* ============================================================
   Osphere · 医美管理系统样式
   设计语言：高端、清爽、医美机构感
   主色：深青绿 #1e6b6b（专业 + 安抚）
   辅色：玫瑰金 #b87333（高级感）
   ============================================================ */

:root {
  --ink: #1f2a37;
  --ink-soft: #4a5663;
  --soft: #8693a3;
  --line: #e3e7ec;
  --bg: #f7f5f0;
  --bg-card: #ffffff;
  --primary: #1e6b6b;
  --primary-dark: #144848;
  --primary-light: #e6f1f0;
  --accent: #b87333;
  --accent-soft: #f5ebe0;
  --success: #2d8659;
  --warn: #b87333;
  --danger: #b54040;
  --shadow: 0 2px 8px rgba(20,30,40,0.06);
  --shadow-lg: 0 6px 24px rgba(20,30,40,0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }

/* ===== Header ===== */
.osphere-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.osphere-brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1;
}
.osphere-brand .brand-mark {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--primary);
}
.osphere-brand .brand-sub {
  font-size: 11px;
  color: var(--soft);
  letter-spacing: 0.2em;
  margin-top: 4px;
}
.page-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  margin-left: 8px;
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 12px;
  letter-spacing: 0.1em;
}
.btn-text {
  background: transparent;
  border: none;
  color: var(--soft);
  padding: 6px 10px;
  font-size: 14px;
}
.btn-text:hover { color: var(--primary); }

/* ===== 容器 ===== */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}
.page-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
}

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card h2, .card h3 {
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--ink);
  font-weight: 500;
}
.card h2 { font-size: 18px; }
.card h3 { font-size: 16px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
  text-align: center;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:disabled { background: var(--soft); cursor: not-allowed; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: #95591f; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8e2929; }
.btn-ghost {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: #ebe9e3; }
.btn-block { display: block; width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 17px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ===== 表单 ===== */
label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-weight: 500;
}
input[type=text], input[type=number], input[type=tel],
input[type=date], input[type=datetime-local], input[type=password],
select, textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.form-group { margin-bottom: 14px; }

/* ===== 表格 ===== */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th {
  background: var(--bg);
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
}
tr:hover td { background: #fafaf7; }
.tbl-empty { text-align: center; color: var(--soft); padding: 32px; }

/* ===== 状态 chip ===== */
.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.chip-scheduled { background: #eef3f8; color: #2c5878; }
.chip-checked_in { background: #fff4d9; color: #a06d00; }
.chip-in_service { background: var(--primary-light); color: var(--primary-dark); }
.chip-completed { background: #e3f1ea; color: var(--success); }
.chip-paid { background: #d9efe0; color: #1f6b3f; }
.chip-cancelled { background: #f1e3e3; color: var(--danger); }
.chip-waiting { background: #f3eada; color: #8a5a00; }

/* ===== 统计卡片 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.stat-card .label { font-size: 13px; color: var(--soft); margin-bottom: 6px; }
.stat-card .value { font-size: 26px; font-weight: 600; color: var(--ink); }
.stat-card .sub { font-size: 12px; color: var(--soft); margin-top: 4px; }
.stat-card.accent { border-left-color: var(--accent); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.warn { border-left-color: var(--warn); }

/* ===== 登录页 ===== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-box {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo .name {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--primary);
}
.auth-logo .sub {
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--soft);
  margin-top: 6px;
}
.big-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  margin-bottom: 10px;
  letter-spacing: 0.05em;
  transition: all 0.15s;
}
.big-btn:hover { background: var(--primary-dark); text-decoration: none; }
.big-btn.alt { background: var(--accent); }
.big-btn.alt:hover { background: #95591f; }
.big-btn.ghost {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.big-btn.ghost:hover { background: var(--primary-light); }

/* ===== Modal ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 40, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-box {
  background: var(--bg-card);
  border-radius: 12px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.modal-box.wide { max-width: 800px; }
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 500; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--soft); padding: 4px 8px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* ===== Tab ===== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab {
  padding: 12px 22px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  color: var(--ink-soft);
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
}
.tab:hover:not(.active) { color: var(--ink); }

/* ===== List items ===== */
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  gap: 14px;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #fafaf7; }
.list-item .li-main { flex: 1; }
.list-item .li-title { font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.list-item .li-sub { font-size: 13px; color: var(--soft); }
.list-item .li-action { flex-shrink: 0; }

/* ===== Grid for service buttons ===== */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.service-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.service-btn:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.service-btn.selected { background: var(--primary-light); border-color: var(--primary); }
.service-btn .sb-name { font-size: 14px; color: var(--ink); margin-bottom: 4px; }
.service-btn .sb-price { font-size: 13px; color: var(--accent); font-weight: 500; }

/* ===== Helper ===== */
.muted { color: var(--soft); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mt-2 { margin-top: 16px; }
.flex { display: flex; gap: 12px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.gap-2 { gap: 16px; }

/* ===== 响应式（iPad/手机） ===== */
@media (max-width: 760px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .osphere-header { padding: 10px 14px; gap: 10px; }
  .osphere-brand .brand-mark { font-size: 18px; }
  .osphere-brand .brand-sub { display: none; }
  .page-title { font-size: 15px; }
  .page, .page-narrow { padding: 14px; }
  .card { padding: 16px; }
  .stat-card .value { font-size: 22px; }
}

/* ===== Print-friendly ===== */
@media print {
  .osphere-header, .header-right, .modal-mask { display: none !important; }
}
