/* ============================================================
   羽毛球馆预约系统 · 管理后台样式
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f4f7fb;
  color: #1f2d3d;
  font-size: 14px;
}

/* ---------- 登录页 ---------- */
.login-page {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f1e33 0%, #1e3a5f 55%, #2d5aa0 100%);
}
.login-box {
  background: #fff; border-radius: 16px; padding: 40px 44px;
  width: 380px; box-shadow: 0 12px 40px rgba(0,0,0,.3);
  text-align: center;
}
.login-box h1 { font-size: 20px; color: #0f1e33; margin-bottom: 4px; }
.login-sub { color: #5b6b80; font-size: 13px; margin-bottom: 24px; }
.login-form input {
  width: 100%; padding: 11px 14px; margin-bottom: 14px;
  border: 1px solid #dbe4ef; border-radius: 8px; font-size: 14px; outline: none;
}
.login-form input:focus { border-color: #3b82f6; }
.login-error { color: #C62828; font-size: 13px; margin-top: 10px; }

/* ---------- 布局 ---------- */
#appLayout { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; background: #0f1e33; color: #c9d6f3;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
}
.sidebar-logo {
  padding: 20px 18px; font-size: 16px; font-weight: 700; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.menu { flex: 1; padding: 12px 0; overflow-y: auto; }
.menu-item {
  display: block; padding: 11px 20px; color: #c9d6f3; text-decoration: none;
  font-size: 14px; border-left: 3px solid transparent; transition: all .15s;
}
.menu-item:hover { background: rgba(59,130,246,.15); color: #fff; }
.menu-item.active { background: rgba(59,130,246,.22); color: #fff; border-left-color: #3b82f6; font-weight: 600; }
.sidebar-foot {
  padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; justify-content: space-between; font-size: 13px;
}
.sidebar-foot a { color: #93b4e8; text-decoration: none; }
.sidebar-foot a:hover { color: #fff; }

.main { flex: 1; margin-left: 210px; padding: 20px 24px; min-width: 0; }
.view-container { max-width: 1200px; }

/* ---------- 通用组件 ---------- */
.page-title { font-size: 20px; font-weight: 700; color: #0f1e33; margin-bottom: 18px; }
.card {
  background: #fff; border-radius: 12px; padding: 20px 22px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05); margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 700; color: #0f1e33; margin-bottom: 14px; }
.card-title .sub { font-size: 12px; color: #5b6b80; font-weight: 400; margin-left: 8px; }

.btn-primary {
  display: inline-block; padding: 9px 20px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, #1e3a5f, #3b82f6); color: #fff;
  font-size: 14px; cursor: pointer;
}
.btn-primary:hover { opacity: .92; }
.btn-plain {
  display: inline-block; padding: 7px 14px; border: 1px solid #dbe4ef; border-radius: 6px;
  background: #fff; color: #334155; font-size: 13px; cursor: pointer;
}
.btn-plain:hover { border-color: #3b82f6; color: #3b82f6; }
.btn-danger {
  display: inline-block; padding: 7px 14px; border: none; border-radius: 6px;
  background: #FCE4EC; color: #C62828; font-size: 13px; cursor: pointer;
}
.btn-danger:hover { background: #F8BBD0; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-ok { display: inline-block; padding: 7px 14px; border: none; border-radius: 6px; background: #E8F5E9; color: #2E7D32; font-size: 13px; cursor: pointer; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
table.data th {
  background: #c9d6f3; color: #0f1e33; font-weight: 700; text-align: left;
  padding: 10px 12px; border-bottom: 2px solid #dbe4ef; white-space: nowrap;
}
table.data td {
  padding: 10px 12px; border-bottom: 1px solid #eef2f7; color: #1f2d3d; vertical-align: top;
}
table.data tr:hover td { background: #f0f6ff; }

/* ---------- 状态标签 ---------- */
.tag { display: inline-block; padding: 2px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.tag-green { background: #E8F5E9; color: #2E7D32; }
.tag-orange { background: #FFF3E0; color: #E65100; }
.tag-blue { background: #E3F2FD; color: #1565C0; }
.tag-gray { background: #ECEFF1; color: #546E7A; }
.tag-red { background: #FCE4EC; color: #C62828; }

/* ---------- 统计卡 ---------- */
.stat-row { display: flex; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.stat-card {
  flex: 1; min-width: 150px; background: #fff; border-radius: 12px; padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05); border-top: 3px solid #3b82f6;
}
.stat-card .num { font-size: 26px; font-weight: 800; color: #0f1e33; }
.stat-card .label { font-size: 12px; color: #5b6b80; margin-top: 4px; }
.stat-card.orange { border-top-color: #f97316; }
.stat-card.green { border-top-color: #16a34a; }
.stat-card.red { border-top-color: #dc2626; }
/* 统计页小号卡片（收入汇总行） */
.stat-card.sm { flex: 0 1 auto; min-width: 130px; padding: 12px 18px; }
.stat-card.sm .num { font-size: 20px; }
.stat-card.sm .label { font-size: 11px; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item label { display: block; font-size: 13px; color: #334155; margin-bottom: 5px; font-weight: 600; }
.form-item input, .form-item select, .form-item textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #dbe4ef; border-radius: 6px;
  font-size: 13px; outline: none; font-family: inherit;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: #3b82f6; }
.form-item textarea { min-height: 80px; resize: vertical; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- 场地看板网格 ---------- */
.board-wrap { overflow-x: auto; }
.board-table { border-collapse: collapse; font-size: 12px; }
.board-table th, .board-table td {
  border: 1px solid #e3e9f0; padding: 6px 8px; text-align: center; min-width: 76px;
}
.board-table th { background: #eef2f7; color: #334155; }
.cell-free { background: #E8F5E9; color: #2E7D32; cursor: pointer; }
.cell-booked { background: #FFF3E0; color: #E65100; cursor: pointer; }
.cell-locked { background: #E3F2FD; color: #1565C0; cursor: pointer; }
.cell-maintain { background: #ECEFF1; color: #78909C; }

/* ---------- 筛选栏 ---------- */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar input, .filter-bar select {
  padding: 7px 10px; border: 1px solid #dbe4ef; border-radius: 6px; font-size: 13px; outline: none;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: #3b82f6; }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 13px; color: #5b6b80; }
.pager button { padding: 5px 12px; border: 1px solid #dbe4ef; border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; }
.pager button:hover { border-color: #3b82f6; color: #3b82f6; }
.pager button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,30,51,.5);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: #fff; border-radius: 14px; padding: 26px 28px; width: 92%;
  max-width: 640px; max-height: 90vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.modal h3 { font-size: 16px; color: #0f1e33; margin-bottom: 18px; }
.modal .close-x { float: right; cursor: pointer; color: #8a9bb0; font-size: 18px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 30px; left: 50%; transform: translateX(-50%);
  background: #0f1e33; color: #fff; padding: 10px 24px; border-radius: 8px;
  font-size: 14px; z-index: 200; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.toast.error { background: #C62828; }
.toast.success { background: #2E7D32; }

/* ---------- 图片上传预览 ---------- */
.img-preview { display: inline-block; position: relative; width: 72px; height: 72px; margin-right: 8px; border-radius: 8px; overflow: hidden; border: 1px solid #e3e9f0; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-preview .del { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.6); color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 11px; cursor: pointer; line-height: 18px; text-align: center; padding: 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .sidebar { width: 60px; }
  .sidebar-logo { font-size: 0; text-align: center; padding: 18px 0; }
  .menu-item { padding: 11px 0; text-align: center; font-size: 0; }
  .menu-item::first-letter { font-size: 18px; }
  .main { margin-left: 60px; }
  .form-grid { grid-template-columns: 1fr; }
}