:root {
  --bg: #f2f4f5; --card: #ffffff; --ink: #2c2f31; --muted: #8b9094;
  --accent: #ec174c; --accent-soft: #fde8ee; --line: #e7e9ea;
  --green: #3f9c62; --green-soft: #e8f3ec; --amber: #c07f1f; --amber-soft: #faf1e0;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font: 15px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--ink); min-height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 14px 20px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .5px; }
.brand em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 13px; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #ec174c, #ff6a4d); color: #fff; font-size: 12px; font-weight: 800; }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav a.active, .nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.btn-link { border: 0; background: none; color: var(--muted); font-size: 14px; cursor: pointer; }
.btn-link:hover { color: var(--accent); }
.view { max-width: 920px; margin: 0 auto; padding: 20px 16px 60px; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.muted { color: var(--muted); font-size: 13px; }
h2 { font-size: 18px; margin-bottom: 4px; }

/* 登录 */
.login-wrap { max-width: 360px; margin: 12vh auto 0; }
.login-wrap h2 { text-align: center; }
.login-wrap p { text-align: center; margin-bottom: 18px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
input, select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; background: #fff; color: var(--ink); outline: none; }
input:focus, select:focus { border-color: var(--accent); }
input[type="date"] { width: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border: 0; border-radius: 10px; font-size: 15px; cursor: pointer; background: var(--accent); color: #fff; }
.btn:hover { filter: brightness(1.05); }
.btn-outline { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-green { background: var(--green); }

/* 汇总卡 */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.summary .card { padding: 12px 16px; }
.summary .num { font-size: 22px; font-weight: 700; }
.summary .num.upcoming { color: var(--accent); }
.summary .num.completed { color: var(--green); }
.summary .num.revenue { color: var(--amber); }

/* 表格（窄屏转卡片） */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .5px; }
tr:last-child td { border-bottom: 0; }
@media (max-width: 680px) {
  table, thead, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  td { border: 0; padding: 3px 0; }
  td .cell-label { display: inline-block; color: var(--muted); font-size: 12px; margin-right: 8px; }
}
.cell-label { display: none; }
.order-id { font-size: 12px; color: var(--muted); font-family: monospace; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.pill-upcoming { background: var(--accent-soft); color: var(--accent); }
.pill-completed { background: var(--green-soft); color: var(--green); }
.pill-cancelled { background: #eef0f1; color: var(--muted); }
.pill-rest { background: var(--amber-soft); color: var(--amber); }

.note-text { color: var(--muted); font-size: 13px; max-width: 220px; }
.error-tip { color: var(--accent); font-size: 13px; min-height: 20px; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: rgba(30,32,34,.92); color: #fff; padding: 10px 22px; border-radius: 999px; font-size: 14px; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; }

.stylist-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stylist-row .who { min-width: 120px; }
.stylist-row select { width: auto; min-width: 110px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.switch i { position: absolute; inset: 0; background: #cfd3d6; border-radius: 999px; transition: background .2s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .2s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { left: 21px; }
