:root {
  --ink: #14231d;
  --ink-2: #41544b;
  --green: #1e4a3c;
  --green-2: #2c6b57;
  --green-3: #e8f0ec;
  --paper: #f6f4ed;
  --card: #ffffff;
  --line: #e4e0d4;
  --gold: #c08b3e;
  --red: #b0473b;
  --amber: #b98228;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 35, 29, .04), 0 12px 28px -18px rgba(20, 35, 29, .35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green-2); }

/* ── 登录 ── */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1100px 520px at 12% -10%, #2f6b56 0%, transparent 60%),
    linear-gradient(160deg, #16352b 0%, #0e241d 100%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fbfaf5;
  border-radius: 20px;
  padding: 34px 30px 30px;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .7);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--green);
}
.login-brand .dot {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #2c6b57, #1e4a3c);
  display: grid; place-items: center; color: #f4efe0; font-size: 13px;
}
.login-card h1 { font-size: 22px; margin: 18px 0 6px; letter-spacing: .01em; }
.login-card p.sub { margin: 0 0 22px; color: var(--ink-2); font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; letter-spacing: .06em; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(44, 107, 87, .12);
}
.login-hint { margin-top: 14px; font-size: 12px; color: var(--ink-2); }
.login-error { color: var(--red); font-size: 12.5px; min-height: 18px; margin-top: 8px; }

/* ── 布局 ── */
.app { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }

.side {
  background: linear-gradient(180deg, #1b4437 0%, #16362c 100%);
  color: #dfe8e2;
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 6px;
  color: #f3efe2;
  font-weight: 700;
  letter-spacing: .02em;
}
.side .brand small { display: block; font-weight: 400; font-size: 11px; color: #9fb8ac; letter-spacing: .1em; }
.side .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
  display: grid; place-items: center; font-size: 15px;
}
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nav button {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: none; border: 0;
  color: #c6d6cd;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-size: 13.5px;
  letter-spacing: .02em;
}
.nav button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav button.on { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 600; }
.nav button.on::before {
  content: ""; width: 3px; height: 16px; border-radius: 2px; background: #d8c48b; margin-left: -12px;
}
.nav .ico { font-size: 15px; width: 18px; text-align: center; opacity: .85; }
.side-foot {
  margin-top: auto;
  font-size: 11.5px;
  color: #90a89c;
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-top: 14px;
  line-height: 1.7;
}
.side-foot b { color: #cfe0d6; font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 30px;
  background: rgba(246, 244, 237, .86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar h2 { font-size: 17px; margin: 0; letter-spacing: .01em; }
.topbar .meta { color: var(--ink-2); font-size: 12.5px; }
.topbar .spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-3); color: var(--green);
  border-radius: 999px; padding: 5px 11px; font-size: 12px;
}
.pill.warn { background: #fbf1dd; color: #8a5f14; }
.pill.bad { background: #fbeae7; color: #8f3a2f; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: #37a06f; box-shadow: 0 0 0 3px rgba(55, 160, 111, .18); }

.content { padding: 24px 30px 56px; display: flex; flex-direction: column; gap: 20px; max-width: 1280px; }

/* ── 卡片 ── */
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { margin: 0; font-size: 14.5px; letter-spacing: .01em; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px 20px 20px; }

.stat { padding: 18px 20px; }
.stat .k { font-size: 12px; color: var(--ink-2); letter-spacing: .06em; }
.stat .v { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-left: 4px; }
.stat .d { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.stat.accent { background: linear-gradient(150deg, #1f5140, #17392e); border-color: #1c4739; color: #f2efe3; }
.stat.accent .k, .stat.accent .d { color: #b9cec4; }
.stat.accent .v small { color: #b9cec4; }

/* ── 表格 ── */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 14px; white-space: nowrap; }
th {
  font-size: 11.5px; letter-spacing: .08em; color: var(--ink-2); font-weight: 600;
  background: #faf9f4; border-bottom: 1px solid var(--line); text-transform: uppercase;
}
tbody tr { border-bottom: 1px solid #efecdf; }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: #fbfaf4; }
td.mono, .mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.t-right { text-align: right; }
.empty { padding: 34px 10px; text-align: center; color: var(--ink-2); font-size: 13px; }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; background: var(--green-3); color: var(--green);
}
.tag.gray { background: #efece2; color: #6b6455; }
.tag.red { background: #fbeae7; color: #94382c; }
.tag.amber { background: #fbf1dd; color: #8a5f14; }
.tag.blue { background: #e8effa; color: #2a4f86; }

/* ── 按钮 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 9px 15px; cursor: pointer;
  transition: transform .08s, background .15s, border-color .15s;
  font-size: 13px;
}
.btn:hover { border-color: #cfc9b8; background: #fbfaf5; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--green); border-color: var(--green); color: #f6f1e2; }
.btn.primary:hover { background: #245744; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: #e7cfca; background: #fdf7f6; }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row .field { margin: 0; }
.row .field.grow { flex: 1; min-width: 150px; }

/* ── 琴房格 ── */
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.room {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fdfcf8;
}
.room .code { font-weight: 700; letter-spacing: .03em; }
.room .t { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
.room .s { margin-top: 9px; font-size: 11.5px; }
.room.busy { border-color: #cfe0d6; background: #f3f8f5; }
.room.book { border-color: #e8dcc0; background: #fbf7ec; }

/* ── 模态 ── */
.modal-mask {
  position: fixed; inset: 0; background: rgba(12, 24, 19, .5);
  display: grid; place-items: center; padding: 20px; z-index: 40;
}
.modal {
  width: 100%; max-width: 440px; background: #fbfaf5; border-radius: 16px;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .6); overflow: hidden;
}
.modal h3 { margin: 0; padding: 18px 20px; font-size: 15px; border-bottom: 1px solid var(--line); }
.modal .body { padding: 18px 20px; max-height: 66vh; overflow: auto; }
.modal .foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #f7f5ee; }

/* ── 提示 ── */
.toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  background: #16362c; color: #f1eee2; padding: 11px 16px; border-radius: 10px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .6); font-size: 13px;
  opacity: 0; transform: translateY(8px); transition: all .22s;
}
.toast.show { opacity: 1; transform: none; }
.toast.err { background: #7d2f26; }

.loading { padding: 28px; text-align: center; color: var(--ink-2); font-size: 13px; }

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: column; }
  .side .nav { flex-direction: row; overflow-x: auto; gap: 6px; }
  .nav button { white-space: nowrap; width: auto; }
  .nav button.on::before { display: none; }
  .side-foot { display: none; }
  .topbar { padding: 14px 16px; }
  .content { padding: 16px; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
