:root {
  color-scheme: light;
  --bg: #f3eee7;
  --paper: #fffdfb;
  --ink: #1f1a16;
  --muted: #7b7268;
  --line: #e7ddd2;
  --gold: #a97945;
  --gold-soft: #f4e7d4;
  --green: #246246;
  --red: #9c3b32;
  --blue: #2f5274;
  --shadow: 0 14px 36px rgba(48, 36, 24, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); letter-spacing: .12em; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, .9fr) 1.1fr; }
.login-brand {
  background: #1c1917;
  color: #f6efe4;
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
}
.login-brand h1 {
  font-family: Palatino, "Palatino Linotype", "Songti SC", "STSong", serif;
  font-size: 64px;
  font-weight: 500;
  letter-spacing: .08em;
  margin-top: 12px;
}
.branch { margin-top: 8px; color: #d9c7ae; letter-spacing: .12em; }
.login-brand ul { margin: 48px 0 0; padding: 0; list-style: none; }
.login-brand li { padding: 12px 0; border-top: 1px solid rgba(255,255,255,.08); color: #efe4d4; }
.brand-foot { margin-top: auto; color: #cbbba6; line-height: 1.7; }
.login-panel { display: grid; place-items: center; padding: 32px 20px; }
.login-panel form { width: min(420px, 100%); }
.login-panel h2 { font-size: 32px; font-weight: 600; margin: 8px 0 22px; }
.eyebrow { letter-spacing: .22em; color: var(--gold); font-size: 12px; }
.login-brand .eyebrow { color: #d7b07a; }
label { display: block; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
input, select, textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #c4a574; box-shadow: 0 0 0 3px rgba(169, 121, 69, .15); }
.pw-row { display: flex; gap: 8px; align-items: center; }
.pw-row input { flex: 1; }
.pw-row button, .btn-ghost, .btn, .btn-primary, .btn-danger, .btn-gold {
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 9px 14px;
}
.pw-row button, .btn-ghost { background: #fff; border-color: var(--line); }
.btn-primary { background: #1f1a16; color: #f8f1e7; }
.btn-gold { background: var(--gold-soft); color: #6d4b24; }
.btn-danger { background: #f8ecea; color: var(--red); }
.btn-block { width: 100%; margin-top: 8px; }
.hint, .back-link { color: var(--muted); }
.hint { line-height: 1.6; margin: 4px 0 16px; }
.back-link { display: inline-block; margin-top: 16px; color: var(--muted); }

.app { min-height: 100vh; display: flex; }
.sidebar {
  width: 220px;
  flex: none;
  background: #1c1917;
  color: #f4ecdf;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 6px 8px 18px; }
.mark {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid #c4a574; color: #e6d3b0;
  font-family: Palatino, "Songti SC", serif;
}
.brand strong { display: block; font-weight: 600; }
.brand em { font-style: normal; color: #b7aa9c; font-size: 12px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav button {
  display: flex; gap: 10px; align-items: center;
  width: 100%; text-align: left;
  background: transparent; border: 0; color: rgba(244,236,223,.78);
  border-radius: 10px; padding: 10px 12px;
}
.sidebar nav button i { font-style: normal; color: #c4a574; width: 22px; font-size: 12px; }
.sidebar nav button.active, .sidebar nav button:hover { background: rgba(255,255,255,.06); color: white; }
.side-user { margin-top: auto; padding: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.side-user strong, .side-user span { display: block; }
.side-user span { color: #b7aa9c; font-size: 12px; }
.side-user button { background: transparent; color: #e6d3b0; border: 1px solid rgba(230,211,176,.35); border-radius: 999px; padding: 6px 10px; }
.workspace { flex: 1; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; padding: 22px 28px 0; }
.topbar h1 { font-size: 28px; font-weight: 600; }
.top-meta { color: var(--muted); display: flex; gap: 16px; }
.view { padding: 18px 28px 32px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat, .panel, .ticket, .catalog, .staff-card, .shop-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.stat { padding: 16px 18px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { display: block; margin-top: 8px; font-size: 28px; font-variant-numeric: tabular-nums; font-weight: 620; }
.stat em { font-style: normal; color: var(--muted); font-size: 12px; }
.panel { padding: 16px 18px; }
.panel-hd, .toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.panel-hd h2, .toolbar h2 { font-size: 16px; }
.split { display: grid; grid-template-columns: 1.3fr .7fr; gap: 14px; margin-top: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #f0e7de; vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
.tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 8px; font-size: 12px; background: #eeeae4; }
.lv-silver { background: #e7eef5; color: var(--blue); }
.lv-gold { background: var(--gold-soft); color: #7a5730; }
.lv-black { background: #1f1a16; color: #e6d3b0; }
.st-booked { background: #f4e7d4; color: #7a5730; }
.st-arrived { background: #e5eef6; color: var(--blue); }
.st-doing { background: #e5f2ea; color: var(--green); }
.st-done { background: #eeeae4; color: #6e675f; }
.st-cancelled { background: #f8ecea; color: var(--red); }
.low { color: var(--red); font-weight: 650; }
.toolbar .search { width: 240px; margin: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; }
.chip.on { background: #1f1a16; color: #f8f1e7; border-color: #1f1a16; }
.mini-list { display: flex; flex-direction: column; }
.mini-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f3ebe3; }
.mini-row button { background: transparent; border: 0; padding: 0; text-align: left; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }
.linkish { background: transparent; border: 0; color: var(--gold); padding: 0; }

.board-tools { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.date-nav { display: flex; gap: 8px; align-items: center; }
.date-nav input { width: 168px; margin: 0; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; }
.legend i { font-style: normal; border-radius: 999px; padding: 3px 8px; font-size: 12px; }
.board-scroll { overflow: auto; max-height: calc(100vh - 210px); border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.board-head, .board-body { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(148px, 1fr)); min-width: 980px; }
.board-head { position: sticky; top: 0; background: #fffdfb; z-index: 4; border-bottom: 1px solid var(--line); }
.col-head { padding: 10px 12px; }
.col-head strong, .col-head em, .col-head small { display: block; }
.col-head em, .col-head small { font-style: normal; color: var(--muted); font-size: 12px; }
.col-head.is-rest { background: #faf7f3; }
.time-col, .day-col { position: relative; height: 864px; }
.hour { position: absolute; left: 0; right: 0; border-top: 1px solid #f3ebe3; }
.time-col .hour span { position: absolute; top: -9px; right: 8px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.appt {
  position: absolute; left: 6px; right: 6px; z-index: 1;
  border: 0; border-radius: 10px; text-align: left; padding: 5px 7px; overflow: hidden;
}
.appt strong, .appt em { display: block; font-style: normal; }
.appt em { font-size: 12px; opacity: .85; }
.now-line { position: absolute; left: 0; right: 0; border-top: 2px solid var(--red); z-index: 2; pointer-events: none; }
.now-line span { position: absolute; top: -9px; left: 6px; background: #fff; color: var(--red); font-size: 11px; }

.cashier { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr); gap: 14px; align-items: start; }
.catalog, .ticket { padding: 16px; }
.ticket { position: sticky; top: 16px; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.item-card { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.item-card:hover { border-color: #c4a574; }
.item-card strong, .item-card em, .item-card b { display: block; }
.item-card em { font-style: normal; color: var(--muted); font-size: 12px; margin: 4px 0; }
.member-banner, .from-appt { background: var(--gold-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.ticket-line { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f3ebe3; }
.ticket-line select { margin: 4px 0 0; padding: 6px; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.pay-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0; }
.pay-grid button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 0; }
.pay-grid button.on { background: #1f1a16; color: #f8f1e7; }
.sum-row { display: flex; justify-content: space-between; margin: 4px 0; color: var(--muted); }
.sum-row.total { color: var(--ink); font-size: 18px; font-weight: 650; margin-top: 8px; }
.card-picks { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fields .full { grid-column: 1 / -1; }
.mask, .drawer-mask { position: fixed; inset: 0; background: rgba(36, 28, 22, .35); z-index: 40; display: grid; place-items: center; padding: 24px; }
.drawer-mask { justify-content: end; }
.modal, .drawer { background: #fffdfb; border-radius: 18px; width: min(560px, 100%); max-height: min(86vh, 820px); overflow: auto; box-shadow: var(--shadow); }
.drawer { width: min(440px, 100%); height: 100%; max-height: none; border-radius: 18px 0 0 18px; }
.modal header, .drawer header, .modal footer, .drawer .drawer-actions { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 16px 18px; }
.modal footer, .drawer .drawer-actions { border-top: 1px solid var(--line); }
.modal-body, .drawer-body { padding: 0 18px 18px; }
.icon-x { border: 0; background: transparent; font-size: 22px; line-height: 1; }
.receipt-line { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.receipt-total { font-size: 22px; margin-top: 12px; }
.member-hero { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #1f1a16; color: #f4e7d4; font-family: Palatino, "Songti SC", serif; font-size: 20px; }
.hero-main { display: flex; gap: 10px; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.staff-card { padding: 16px; }
.who { display: flex; gap: 10px; align-items: center; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 12px 0; }
.week i { font-style: normal; text-align: center; background: #f6f1ea; border-radius: 8px; padding: 6px 0; font-size: 11px; }
.week i b { display: block; font-weight: 600; }
.week i.today { outline: 1px solid #c4a574; }
.week i.rest { color: var(--muted); }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.bar { height: 8px; background: #f3ebe3; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #1f1a16; border-radius: 99px; }
.shop-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
.shop-card { padding: 18px 20px; }
.shop-card h2 { font-family: Palatino, "Songti SC", serif; font-size: 36px; font-weight: 500; }
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-8px);
  background: #1f1a16; color: #f8f1e7; padding: 10px 16px; border-radius: 999px;
  z-index: 80; opacity: 0; pointer-events: none; transition: .2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 980px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { padding: 32px 24px; }
  .login-brand h1 { font-size: 46px; }
  .login-brand ul { margin-top: 20px; }
  .stats, .split, .cashier, .shop-grid { grid-template-columns: 1fr; }
}
