:root {
  --bg-page: #f5f4fb;
  --bg-card: #ffffff;
  --border-card: #e5e7eb;
  --text-main: #111827;
  --text-muted: #6b7280;
  --primary: #4f46e5;
  --primary-soft: #eef2ff;
  --primary-dark: #4338ca;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #eab308;
  --warning-soft: #fef9c3;
  --radius-lg: 18px;
  --shadow-card: 0 18px 45px rgba(15, 23, 42, 0.08);
  --transition-fast: 0.18s ease-out;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--text-main);
  background: radial-gradient(circle at top, #eef2ff 0, #f5f4fb 45%, #f5f4fb 100%);
}

main.container {
  max-width: 900px;
  margin: 32px auto 48px;
  padding: 0 16px;
}

header.site-header {
  padding: 16px 18px;
  font-weight: 600;
  font-size: 1.1rem;
  color: #111827;
}

/* 通用文字 */

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

/* 卡片 */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  padding: 24px 24px 20px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}

.card-header h2 {
  font-size: 1.25rem;
}

.card-header small {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* 表单布局 */

.form,
.form-inline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
}

label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* 输入控件 */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
  background-color: #f9fafb;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary-soft);
  background-color: #ffffff;
}

textarea {
  resize: vertical;
  min-height: 70px;
}

/* 按钮 */

button {
  font-family: inherit;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast),
    color var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  box-shadow: 0 12px 25px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
  background: #111827;
  color: #f9fafb;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.3);
}

.btn-secondary:hover {
  background: #020617;
}

.btn-danger {
  background: var(--danger);
  color: #fff7f7;
  box-shadow: 0 12px 25px rgba(220, 38, 38, 0.35);
}

.btn-danger:hover {
  background: #b91c1c;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
  transform: none;
}

/* Cierre 区域的折叠标题行 */
.closure-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* 小号按钮，用在“Mostrar/Ocultar”上 */
.btn-small {
  padding: 6px 10px;
  font-size: 0.8rem;
}

/* 折叠内容容器 */
.closure-body.hidden {
  display: none;
}

/* 状态标签 */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-pending {
  background: var(--warning-soft);
  color: #854d0e;
}

.badge-confirmed {
  background: var(--success-soft);
  color: #166534;
}

.badge-cancelled {
  background: var(--danger-soft);
  color: #b91c1c;
}

/* 待确认预订区块的样式 */
.pending-wrapper {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}

.pending-header {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pending-header h3 {
  font-size: 1rem;
  margin: 0;
}

.pending-header small {
  font-size: 0.8rem;
  color: var(--text-muted);
}


/* 后台/客户的预订条目 */

.res-card {
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 14px 16px 12px;
  margin-top: 10px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.res-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}

.res-card-main {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.res-card-actions {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 模态框（查看/取消订台） */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: 100%;
  max-width: 430px;
  background: #ffffff;
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: var(--shadow-card);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-header h2 {
  font-size: 1.1rem;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
}

/* 提示文字 */

.status-msg {
  margin-top: 8px;
  font-size: 0.85rem;
}

.status-msg.ok {
  color: var(--success);
}

.status-msg.error {
  color: var(--danger);
}

/* 登录卡片隐藏 */

.hidden {
  display: none !important;
}

.divider {
  border: none;
  border-top: 1px dashed #e5e7eb;
  margin: 16px 0;
}

/* 响应式 */

@media (max-width: 600px) {
  .card {
    padding: 18px 16px 16px;
  }

  .res-card-header {
    flex-direction: column;
  }

  main.container {
    margin-top: 20px;
  }
}

/* 顶部工具条（后台） */
.top-bar {
  padding: 12px 18px;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #f9fafb;
  font-size: 0.95rem;
  font-weight: 500;
}
.top-bar .brand {
  max-width: 980px;
  margin: 0 auto;
}

/* 通用浅色文字 */
.muted {
  color: var(--text-muted);
}

/* 后台内部小分块 */
.card-subsection {
  margin-top: 16px;
}

/* 过滤行布局 */
.filter-row {
  align-items: flex-end;
  gap: 12px;
}
.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

/* 待确认预订区块 */
.pending-wrapper {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}
.pending-header {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.pending-header h3 {
  margin: 0;
  font-size: 1rem;
}
.pending-header small {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.res-card-pending {
  border-color: #c7d2fe;
  background: #eef2ff;
}

/* Cierre 区域折叠标题行 + 小按钮 */
.closure-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}
.closure-body.hidden {
  display: none;
}

/* Modal 操作按钮布局 */
.modal-actions {
  justify-content: flex-end;
  gap: 8px;
}

/* 后台移动端优化 */
@media (max-width: 640px) {
  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .res-card-actions {
    justify-content: flex-start;
  }

  .pending-wrapper {
    padding: 12px 12px;
  }
}

/* ============ 通用按钮/颜色 ============ */

:root {
  --color-bg: #f5f3ff;
  --color-card: #ffffff;
  --color-primary: #4f46e5;
  --color-primary-soft: #eef2ff;
  --color-danger: #ef4444;
  --color-danger-soft: #fee2e2;
  --color-dark: #111827;
  --color-border: #e5e7eb;
  --color-muted: #6b7280;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.12);
  --radius-lg: 18px;
}

.admin-body {
  background: radial-gradient(circle at top, #eef2ff 0, #f9fafb 60%);
  min-height: 100vh;
}

/* 顶部栏 */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.6);
}

.brand {
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-logo {
  font-size: 18px;
}

.btn-ghost {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  color: var(--color-dark);
}
.btn-ghost.small {
  font-size: 12px;
  padding: 4px 10px;
}

/* 容器 */

.admin-container {
  max-width: 1024px;
  margin: 24px auto;
}

.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 22px 20px;
  margin-bottom: 20px;
}

.card h2 {
  margin-top: 0;
}

/* 表单/字段 */

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.field span {
  color: var(--color-muted);
}

.field input,
.field select,
.field textarea {
  border-radius: 999px;
  border: 1px solid var(--color-border);
  padding: 8px 14px;
  font-size: 14px;
  outline: none;
}

.field textarea {
  border-radius: 12px;
  min-height: 72px;
}

/* 通用按钮 */

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-dark {
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 8px 16px;
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.1s;
}

.btn-primary {
  background: linear-gradient(90deg, #4f46e5, #6366f1);
  color: #fff;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-secondary {
  background: #111827;
  color: #fff;
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.btn-dark {
  background: #111827;
  color: #f9fafb;
}

.btn-full {
  width: 100%;
  margin-top: 10px;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 文本/状态 */

.helper-text {
  font-size: 13px;
  color: var(--color-muted);
  margin-bottom: 10px;
}

.section-block + .section-block {
  margin-top: 16px;
}

.section-header h2,
.section-header h3 {
  margin: 0;
}

.section-subtitle {
  margin: 2px 0 0 0;
  font-size: 13px;
  color: var(--color-muted);
}

.status-msg {
  font-size: 13px;
  margin-top: 6px;
  color: var(--color-muted);
}

.status-msg.ok {
  color: #16a34a;
}
.status-msg.error {
  color: var(--color-danger);
}

/* 过滤行 */

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-top: 10px;
  margin-bottom: 10px;
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-muted);
}

/* 预订卡片 */

.lookup-results {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.res-card {
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  padding: 12px 14px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.res-card-pending {
  border-color: #f97316;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.18);
}

.res-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.res-main-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.res-sub-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-muted);
}

.res-icon {
  font-size: 14px;
}

.res-card-main {
  font-size: 13px;
  color: var(--color-dark);
}

.res-detail-line {
  display: flex;
  gap: 6px;
}

.res-detail-label {
  width: 70px;
  color: var(--color-muted);
}

.res-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* 状态标签 */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.badge-confirmed {
  background: #dcfce7;
  color: #15803d;
}

.badge-cancelled {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-pending {
  background: #fef3c7;
  color: #b45309;
}

/* 待确认 Banner */

.pending-wrapper {
  background: #eef2ff;
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px dashed rgba(79, 70, 229, 0.4);
}

.pending-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.pending-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pending-title h3 {
  margin: 0;
}

.pending-title small {
  font-size: 12px;
  color: var(--color-muted);
}

.pending-icon {
  font-size: 20px;
}

.pending-count-badge {
  background: #f97316;
  color: #fff;
  border-radius: 999px;
  min-width: 30px;
  text-align: center;
  padding: 4px 8px;
  font-size: 12px;
}

.pending-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 折叠关闭区块 */

.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.closure-panel {
  margin-top: 10px;
  overflow: hidden;
  max-height: 8000px;
  transition: max-height 0.5s ease;
}

.closure-panel.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.closure-block + .closure-block {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px dashed #e5e7eb;
}

/* Modal 编辑框 */

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal-content {
  position: relative;
  z-index: 41;
  background: #ffffff;
  padding: 18px 18px 16px;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.3);
  width: 100%;
  max-width: 420px;
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 2px;
}

.modal-subtitle {
  margin-top: 0;
  font-size: 13px;
  color: var(--color-muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

/* 响应式 */

@media (max-width: 768px) {
  .admin-container {
    margin: 16px 10px 32px;
  }

  .card {
    padding: 16px 14px;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .res-card-actions {
    justify-content: flex-start;
  }

  .top-bar {
    padding-inline: 12px;
  }
}

/* =========================
   Backoffice 左侧导航 + 布局
   ========================= */

.admin-body {
  background: #f3f4f6;
}

/* 顶部条微调，使其适合后台布局 */
.top-bar {
  padding: 10px 16px;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #f9fafb;
}
.top-bar-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.95rem;
}
.brand-logo {
  font-size: 1.1rem;
}

/* 整体布局：左侧导航 + 右侧内容 */

.admin-shell {
  max-width: 1160px;
  margin: 16px auto 32px;
  display: flex;
  gap: 16px;
  padding: 0 12px;
}

/* 左侧导航栏 */

.admin-sidebar {
  width: 210px;
  min-width: 210px;
  border-radius: 18px;
  background: #020617;
  color: #e5e7eb;
  padding: 14px 12px 10px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;       /* 顶部对齐 */
  align-self: flex-start;            /* 不拉伸到整列高度 */
  position: sticky;                  /* 粘在视口 */
  top: 80px;                         /* 顶部栏下面一点点，可根据视觉再调 */
  max-height: calc(100vh - 96px);    /* 不超过视口 */
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.sidebar-logo {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #facc15, #ea580c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #111827;
}
.sidebar-title {
  font-size: 0.95rem;
  font-weight: 600;
}

/* 导航按钮 */

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 0 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  text-decoration: none;
  color: #e5e7eb;
  font-size: 0.9rem;
  opacity: 0.9;
  transition: background 0.15s ease, transform 0.06s ease, opacity 0.15s ease;
}
.nav-item:hover {
  background: rgba(148, 163, 184, 0.2);
  transform: translateY(-1px);
  opacity: 1;
}
.nav-icon {
  font-size: 1.05rem;
}
.nav-label {
  white-space: nowrap;
}

/* 底部小字 */

.sidebar-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.5);
  padding-top: 6px;
  margin-top: 4px;
}
.sidebar-footnote {
  font-size: 0.7rem;
  color: #9ca3af;
}

/* 右侧主内容 */

.admin-main {
  flex: 1;
  margin: 0;
}

/* 统一后台卡片间距 */

.panel-section + .panel-section {
  margin-top: 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

/* 让后台卡片更适合桌面 */

.admin-main .card {
  margin-bottom: 0;
}

/* closure panel 样式（配合你现有 admin.js） */

.closure-panel {
  margin-top: 10px;
  overflow: hidden;
  max-height: 8000px;
  transition: max-height 0.5s ease;
}
.closure-panel.collapsed {
  max-height: 0;
}
.closure-block + .closure-block {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed #e5e7eb;
}

/* 待确认区的计数角标（配合 admin.js 的 pendingCountBadge） */

.pending-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pending-icon {
  font-size: 1.3rem;
}
.pending-count-badge {
  min-width: 30px;
  text-align: center;
  padding: 4px 8px;
  font-size: 0.8rem;
  border-radius: 999px;
  background: #f97316;
  color: #ffffff;
  font-weight: 600;
}

/* 小屏优化：手机 & 小平板 */

@media (max-width: 768px) {
  .admin-shell {
    flex-direction: column;
    padding: 0 10px;
  }

  .admin-sidebar {
  width: 210px;
  min-width: 210px;
  border-radius: 18px;
  background: #020617;
  color: #e5e7eb;
  padding: 14px 12px 10px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;       /* 顶部对齐 */
  align-self: flex-start;            /* 不拉伸到整列高度 */
  position: sticky;                  /* 粘在视口 */
  top: 80px;                         /* 顶部栏下面一点点，可根据视觉再调 */
  max-height: calc(100vh - 96px);    /* 不超过视口 */
}

  .sidebar-header {
    margin-bottom: 0;
  }

  .sidebar-title {
    font-size: 0.85rem;
  }

  .sidebar-nav {
    flex-direction: row;
    justify-content: center;
    gap: 6px;
    margin: 0 6px;
    flex: 1;
  }

  .nav-item {
    padding: 6px 8px;
    font-size: 0.8rem;
  }

  .nav-label {
    display: none; /* 手机上只保留图标，节省空间 */
  }

  .sidebar-footer {
    display: none; /* 手机上隐藏这行小字，避免拥挤 */
  }

  .admin-main .card {
    margin-top: 4px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .res-card-actions {
    justify-content: flex-start;
  }
}

/* 更窄的屏幕，再收紧一点内边距 */

@media (max-width: 480px) {
  .admin-shell {
    padding: 0 6px;
  }

  .admin-sidebar {
    padding-inline: 8px;
  }

  .card {
    padding-inline: 14px;
  }

  .pending-wrapper {
    padding-inline: 12px;
  }
}
