/* =========================================================
   牛总店 · 预订管理后台样式 —— 参照站深红主题（design-handoff 锁定）
   纯 CSS，无框架
   ========================================================= */
:root {
  --primary: #8b1a1a;          /* 深红主色（参照站深红主题） */
  --primary-dark: #6e1414;
  --primary-light: #a92c2c;
  --primary-soft: #fdf3f3;
  --gold: #c99a2e;
  --ink: #2b2320;
  --muted: #8a7f7a;
  --line: #eee4e2;
  --bg: #f7f2f1;
  --card: #ffffff;
  --danger: #d64545;
  --green: #3d9a6c;
  --blue: #3f7fbf;
  --amber: #d69a3f;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(80, 20, 20, .07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}
[hidden] { display: none !important; }
a { color: var(--primary); text-decoration: none; }
.link:hover { text-decoration: underline; }

svg.ico { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
svg.ico-lg { width: 34px; height: 34px; color: #c9b6b2; }

/* ================= 通用控件 ================= */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink); font-size: 14px; cursor: pointer;
  transition: all .15s; white-space: nowrap; user-select: none;
}
.btn:hover { border-color: var(--primary-light); color: var(--primary); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b93a3a; color: #fff; }
.btn-danger-ghost { color: var(--danger); border-color: #f2d5d5; }
.btn-danger-ghost:hover { background: var(--primary-soft); color: var(--danger); border-color: var(--danger); }
.btn-mini { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }

.spin {
  width: 13px; height: 13px; border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; display: inline-block; animation: nzd-spin .7s linear infinite;
}
@keyframes nzd-spin { to { transform: rotate(360deg); } }

.input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 14px; color: var(--ink); background: #fff; outline: none; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139, 26, 26, .09); }
.input::placeholder { color: #b9aca8; }
textarea.input { resize: vertical; line-height: 1.6; }
select.input { appearance: auto; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: #6d635f; }
.field > span em { color: var(--danger); font-style: normal; margin-left: 2px; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.field-full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; border-top: 1px dashed var(--line); margin-top: 6px; }
.mono { font-family: Consolas, Menlo, monospace; font-size: 12.5px; }
.muted { color: var(--muted); font-size: 12px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.6; }
.spacer { flex: 1; }

/* ================= 登录页 ================= */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1000px 460px at 82% -10%, rgba(139, 26, 26, .12), transparent 62%),
    radial-gradient(760px 380px at 8% 108%, rgba(201, 154, 46, .1), transparent 60%),
    var(--bg);
  padding: 24px;
}
.login-card {
  width: 420px; max-width: 94vw; background: var(--card); border-radius: 16px;
  box-shadow: 0 18px 60px rgba(80, 20, 20, .16), 0 2px 8px rgba(80, 20, 20, .06),
    inset 0 3px 0 var(--primary);
  padding: 38px 36px 28px;
  animation: loginIn .38s cubic-bezier(.2, .8, .3, 1);
}
@keyframes loginIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.login-logo {
  width: 54px; height: 54px; border-radius: 12px; background: var(--primary);
  color: #fff; font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); flex: none;
}
.login-brand h1 { font-size: 18px; color: var(--ink); font-weight: 700; letter-spacing: .4px; }
.login-brand p { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.7; }
.login-card form { display: flex; flex-direction: column; gap: 15px; }
.login-card .field { gap: 7px; }
.login-card .field > span { font-size: 13px; color: #6d635f; font-weight: 500; letter-spacing: .3px; }
.login-card .input-wrap input.input {
  width: 100%; height: 46px; padding: 0 14px 0 40px; font-size: 15px;
  background: #fbf9f8; border: 1px solid #e6dbd8; border-radius: 10px;
}
.login-card .input-wrap input.input:focus { background: #fff; border-color: var(--primary); }
.login-card .input-wrap .ico { left: 13px; color: #b9aca8; }
.login-card .input-wrap input.input:focus + .ico,
.login-card .input-wrap input.input:focus ~ .ico { color: var(--primary); }
.login-card .btn-block { margin: 0; height: 46px; border-radius: 10px; font-size: 16px; letter-spacing: 6px; text-indent: 6px; }
.login-card .btn-block:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(139, 26, 26, .3); }
.login-card .btn-block:active { transform: translateY(0); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .ico { position: absolute; left: 12px; color: #b9aca8; }
.input-wrap input { padding-left: 36px; }
.login-error {
  background: var(--primary-soft); color: var(--danger); font-size: 13px;
  padding: 10px 13px; border-radius: 10px; border: 1px solid #f2d5d5; line-height: 1.6;
}
.login-foot {
  margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line);
  text-align: center; color: #b3a8a4; font-size: 11.5px; line-height: 1.8;
}

/* ================= 主布局 ================= */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: var(--primary); color: #fff; display: flex;
  align-items: center; justify-content: space-between; padding: 0 20px;
  position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 8px rgba(80, 20, 20, .25);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, .16);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px;
}
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: .5px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-user { display: flex; align-items: center; gap: 6px; font-size: 13px; opacity: .92; }
.user-wrap { position: relative; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 14px; cursor: pointer;
}
.avatar:hover { background: rgba(255, 255, 255, .26); }
.user-menu {
  position: absolute; right: 0; top: 44px; background: #fff; border-radius: 10px;
  box-shadow: 0 8px 28px rgba(40, 10, 10, .18); padding: 6px; min-width: 168px; z-index: 60;
}
.user-menu-name { padding: 8px 12px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 9px 12px; background: none; border: none; border-radius: 7px;
  font-size: 13.5px; color: var(--ink); cursor: pointer;
}
.user-menu-item:hover { background: var(--primary-soft); color: var(--danger); }

.layout { flex: 1; display: flex; min-height: 0; }
.sidebar {
  width: 216px; background: var(--card); border-right: 1px solid var(--line);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; flex: none;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  background: none; border: none; border-radius: 9px; font-size: 14.5px;
  color: #5c534f; cursor: pointer; text-align: left; transition: all .15s;
}
.nav-item:hover { background: var(--primary-soft); color: var(--primary); }
.nav-item.on { background: var(--primary); color: #fff; font-weight: 600; }
.sidebar-foot { margin-top: auto; font-size: 11px; color: #b9aca8; line-height: 1.8; }

.main { flex: 1; padding: 18px 22px 34px; min-width: 0; }
.page-head { margin-bottom: 14px; }
.page-head h2 { font-size: 19px; font-weight: 600; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ================= 卡片 / 过滤条 ================= */
.card { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title { font-size: 15px; font-weight: 600; }
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-bar .input[type="search"] { width: 240px; }
.filter-bar select.input { width: 150px; }
.date-f { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #6d635f; }
.date-f .input { width: 148px; }

/* ================= 表格 ================= */
.table-card { padding: 0; overflow: hidden; }
.table-card .card-h { padding: 14px 18px 0; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 12px 14px; color: #8a7f7a; font-weight: 600; font-size: 12.5px;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: #fbf7f6;
}
.table td { padding: 11px 14px; border-bottom: 1px solid #f5edeb; vertical-align: middle; }
.table tbody tr:hover { background: #fdf8f7; }
.table tbody tr:last-child td { border-bottom: none; }
.c-id { color: var(--muted); font-family: Consolas, Menlo, monospace; font-size: 12.5px; }
.strong { font-weight: 600; }
.sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.num { text-align: center; }
td.ops, .ops-th { text-align: center; white-space: nowrap; }
td.ops .btn { margin: 0 2px; }
.empty-cell { padding: 34px 10px !important; text-align: center; }
.err { color: var(--danger); font-size: 13px; }
.loading { color: var(--muted); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); }
.empty .btn { margin-top: 6px; }

/* ================= 徽章 ================= */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge-sm { padding: 1px 8px; font-size: 11px; }
.b-amber { background: #fdf3e2; color: #b57a17; }
.b-green { background: #e7f5ee; color: #2e7d54; }
.b-blue  { background: #e8f1fa; color: #33618f; }
.b-red   { background: #fdeaea; color: #b93a3a; }
.b-gray  { background: #f0ebea; color: #857a76; }

/* ================= 分页 ================= */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; flex-wrap: wrap; }
.pager-info { font-size: 12.5px; color: var(--muted); }
.pager-btns { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pg {
  min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--line);
  border-radius: 7px; background: #fff; font-size: 13px; color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.pg:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pg.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pg:disabled { opacity: .45; cursor: not-allowed; }
.pg-gap { color: var(--muted); padding: 0 2px; }

/* ================= 弹窗 ================= */
.modal {
  position: fixed; inset: 0; background: rgba(43, 20, 20, .45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: nzd-fade .16s ease;
}
@keyframes nzd-fade { from { opacity: 0; } }
.modal-box {
  background: #fff; border-radius: 14px; width: 620px; max-width: 100%;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 18px 50px rgba(40, 10, 10, .28); animation: nzd-pop .18s ease;
}
.modal-lg { width: 760px; }
.modal-sm { width: 400px; }
@keyframes nzd-pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px; border-bottom: 1px solid var(--line); flex: none;
}
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-x { background: none; border: none; cursor: pointer; color: #a0938f; padding: 4px; border-radius: 6px; display: flex; }
.modal-x:hover { color: var(--danger); background: var(--primary-soft); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot {
  padding: 13px 20px; border-top: 1px solid var(--line); display: flex;
  justify-content: flex-end; gap: 10px; flex: none;
}
.confirm-msg { font-size: 14px; line-height: 1.7; }

/* 预订详情 */
.detail-dl { display: grid; grid-template-columns: 130px 1fr; row-gap: 9px; column-gap: 12px; font-size: 13.5px; }
.detail-dl dt { color: var(--muted); }
.detail-dl dd { color: var(--ink); word-break: break-all; }
.detail-actions { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; align-items: center; gap: 10px; }
.detail-actions label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #6d635f; }
.detail-actions select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }

/* 邀请函链接块 */
.invite-box { margin-top: 14px; padding: 12px 14px; background: var(--primary-soft); border: 1px solid #f0dbdb; border-radius: 10px; }
.invite-label { font-size: 12.5px; color: var(--primary-dark); font-weight: 600; margin-bottom: 6px; }
.invite-url { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; word-break: break-all; color: #5c534f; }
.invite-ops { margin-top: 8px; display: flex; gap: 8px; }
.invite-preview {
  background: #fbf7f6; border: 1px dashed var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: 12.5px; color: #6d635f; line-height: 1.7;
}

/* ================= toast ================= */
.toast-wrap { position: fixed; top: 68px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 200px; max-width: 340px; padding: 11px 16px; border-radius: 10px;
  background: #fff; color: var(--ink); font-size: 13.5px; box-shadow: 0 6px 24px rgba(40, 10, 10, .18);
  border-left: 4px solid var(--primary); opacity: 0; transform: translateX(18px);
  transition: all .28s ease;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.out { opacity: 0; transform: translateX(18px); }
.toast.t-success { border-left-color: var(--green); }
.toast.t-error { border-left-color: var(--danger); }
.toast.t-warning { border-left-color: var(--amber); }

/* ================= 响应式 ================= */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px; }
  .nav { flex-direction: row; }
  .nav-item { padding: 9px 13px; white-space: nowrap; }
  .sidebar-foot { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .filter-bar .input[type="search"], .filter-bar select.input, .date-f .input { width: 100%; }
  .date-f { width: 100%; }
  .filter-bar { align-items: stretch; }
  .filter-bar .btn { justify-content: center; }
}

@media (max-width: 560px) {
  .topbar { padding: 0 12px; }
  .brand-name { display: none; }
  .main { padding: 12px; }
  .card { padding: 12px; }
  .card-h { flex-wrap: wrap; }
  .detail-dl { grid-template-columns: 96px 1fr; }
  .btn-mini { padding: 4px 8px; }
}

/* ====== 图片直传控件 ====== */
.upbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #faf7f5;
  border: 1px dashed #d9c9c5;
  border-radius: 10px;
  min-height: 64px;
}
.up-add {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  color: #6a1e1e;
  cursor: pointer;
  font-size: 13px;
}
.up-add .ico { width: 16px; height: 16px; }
.up-add em { font-style: normal; }
.up-add-sq {
  width: 84px; height: 84px;
  flex-direction: column;
  justify-content: center;
  padding: 8px 4px;
  gap: 4px;
  color: #a08a86;
  border: 1px dashed #d9c9c5;
  border-radius: 8px;
  background: #fff;
}
.up-add-sq:hover { color: #6a1e1e; border-color: #6a1e1e; }
.up-add-sq .ico { width: 20px; height: 20px; }
.up-add-sq em { font-size: 11px; }
.up-thumb {
  width: 100%; max-width: 320px;
  max-height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e0dc);
  background: #fff;
}
.up-grid { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.up-cell { position: relative; width: 84px; height: 84px; }
.up-cell img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--border, #e5e0dc); }
.up-cell .up-x {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px;
  border: none; border-radius: 50%;
  background: #6a1e1e; color: #fff;
  font-size: 12px; line-height: 20px;
  cursor: pointer; padding: 0;
}
.upcell-path { display: none; }


/* ====== 视图切换(多页面单页显示): 缺此规则曾致 4 页堆叠、点导航内容不变 ====== */
.view { display: none; }
.view.active { display: block; }
