/* 吉贝拉月子中心管理系统 - 金色品牌风格 */
:root {
  --gold: #b08d2e;
  --gold-light: #d4af37;
  --gold-bg: #f7f3e8;
  --ink: #2b2b26;
  --muted: #8a8578;
  --bg: #f6f5f1;
  --card: #ffffff;
  --danger: #c0392b;
  --ok: #2e7d32;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(43, 43, 38, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; }
.hidden { display: none !important; }

/* ---------- 按钮（按压反馈） ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border: none; border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 600; transition: transform 0.08s ease, box-shadow 0.15s ease, opacity 0.15s;
  user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #fff; box-shadow: 0 2px 8px rgba(176, 141, 46, 0.35);
}
.btn-gold:hover { box-shadow: 0 3px 12px rgba(176, 141, 46, 0.45); }
.btn-lg { width: 100%; padding: 12px; font-size: 16px; border-radius: 10px; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid #ddd; }
.btn-ghost:hover { background: #f0efe9; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-danger { background: #fdf0ef; color: var(--danger); }
.btn-danger:hover { background: #f9dedc; }
.btn-ok { background: #eef7ee; color: var(--ok); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 登录页 ---------- */
.login-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #3a3626 0%, #2b2b26 60%, #1f1f1b 100%);
  position: relative; overflow: hidden;
}
.login-view::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(212, 175, 55, 0.18), transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(212, 175, 55, 0.12), transparent 50%);
}
.login-card {
  position: relative; width: 380px; background: var(--card); border-radius: 20px;
  padding: 40px 36px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  animation: rise 0.4s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.brand-mark {
  width: 56px; height: 56px; border-radius: 14px; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: 2px;
  box-shadow: 0 4px 14px rgba(176, 141, 46, 0.4);
}
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 12px; margin-bottom: 24px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form input {
  padding: 12px 14px; border: 1px solid #e3e0d5; border-radius: 10px; font-size: 15px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-form input:focus { border-color: var(--gold-light); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15); }
.hint { margin-top: 14px; font-size: 11px; color: var(--muted); text-align: center; }
.err { margin-top: 10px; color: var(--danger); font-size: 12px; text-align: center; }

/* ---------- 主布局 ---------- */
.app-view { display: flex; height: 100vh; }
.sidebar {
  width: 200px; background: #2b2b26; color: #d9d5c8; display: flex; flex-direction: column; flex-shrink: 0;
}
.logo { padding: 20px 18px 14px; font-size: 18px; font-weight: 800; color: var(--gold-light); }
.logo span { font-size: 11px; color: #8a8578; margin-left: 4px; font-weight: 400; }
#nav { flex: 1; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
#nav a {
  display: block; padding: 10px 12px; border-radius: 8px; color: #c9c4b6;
  text-decoration: none; font-size: 13.5px; border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}
#nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
#nav a.active {
  background: rgba(212, 175, 55, 0.12); color: var(--gold-light); border-left-color: var(--gold-light);
  font-weight: 700;
}
.sidebar-foot { padding: 14px 18px; font-size: 11px; color: #6a665c; border-top: 1px solid rgba(255, 255, 255, 0.06); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; background: var(--card); border-bottom: 1px solid #ece9df;
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  box-shadow: var(--shadow);
}
.topbar > span { font-size: 16px; font-weight: 700; position: relative; padding-left: 12px; }
.topbar > span::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 18px; border-radius: 2px; background: var(--gold-light);
}
.user { display: flex; align-items: center; gap: 10px; }
.user #user-name { font-weight: 600; font-size: 13px; }
.content { flex: 1; overflow-y: auto; padding: 20px 24px; }

/* ---------- 通用组件 ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: #f0efe9; color: var(--muted);
}
.badge-gold { background: var(--gold-bg); color: var(--gold); border: 1px solid rgba(212, 175, 55, 0.4); }
.badge-ok { background: #eef7ee; color: var(--ok); }
.badge-danger { background: #fdf0ef; color: var(--danger); }
.badge-blue { background: #eef3fb; color: #3b5b8a; }
.badge-gray { background: #f0efe9; color: var(--muted); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card h3 { font-size: 15px; margin-bottom: 12px; padding-left: 10px; position: relative; }
.card h3::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 4px; height: 14px;
  border-radius: 2px; background: var(--gold-light);
}

.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

/* 指标卡 */
.kpi {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; position: relative; overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; right: -20px; bottom: -20px; width: 80px; height: 80px;
  border-radius: 50%; background: rgba(212, 175, 55, 0.07);
}
.kpi .label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.kpi .value { font-size: 24px; font-weight: 800; }
.kpi .value small { font-size: 13px; color: var(--muted); font-weight: 400; }
.kpi.warn { background: linear-gradient(135deg, #fff 40%, #fdf0ef); }
.kpi.warn .value { color: var(--danger); }
.kpi.ok .value { color: var(--ok); }
.kpi .note { margin-top: 6px; font-size: 11px; color: var(--muted); }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; color: var(--muted); font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid #ece9df; background: #faf9f5; white-space: nowrap;
}
td { padding: 10px; border-bottom: 1px solid #f0eee6; font-size: 13px; vertical-align: middle; }
tr:hover td { background: #fcfbf7; }
.td-actions { display: flex; gap: 6px; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 30px; font-size: 13px; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.form-item { display: flex; flex-direction: column; gap: 5px; }
.form-item label { font-size: 12px; color: var(--muted); font-weight: 600; }
.form-item label .req { color: var(--danger); margin-left: 2px; }
.form-item input, .form-item select, .form-item textarea {
  padding: 9px 12px; border: 1px solid #e3e0d5; border-radius: 8px; font-size: 14px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s; background: #fff;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: var(--gold-light); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* 胶囊选择（少填表：点选代替输入） */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 7px 16px; border-radius: 999px; border: 1.5px solid #e3e0d5; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--muted); background: #fff; transition: all 0.15s;
}
.pill:active { transform: scale(0.96); }
.pill.on { border-color: var(--gold-light); background: var(--gold-bg); color: var(--gold); box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25); }

/* 房态网格 */
.room-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.room {
  border-radius: var(--radius); padding: 14px; cursor: pointer; transition: transform 0.12s, box-shadow 0.15s;
  border: 1.5px solid transparent;
}
.room:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(43, 43, 38, 0.1); }
.room .no { font-size: 15px; font-weight: 800; }
.room .type { font-size: 11px; color: var(--muted); }
.room .st { margin-top: 8px; font-size: 11px; font-weight: 700; }
.room.free { background: #f4f8f4; border-color: #d6e6d6; }
.room.free .st { color: var(--ok); }
.room.booked { background: #fdf8ec; border-color: #ecd9a8; }
.room.booked .st { color: var(--gold); }
.room.live { background: #fdf0ef; border-color: #efc4bf; }
.room.live .st { color: var(--danger); }
.room.clean { background: #eef3fb; border-color: #c9d8ef; }
.room.clean .st { color: #3b5b8a; }
.room.repair { background: #f0efe9; border-color: #d9d5c8; }
.room.repair .st { color: var(--muted); }
.room .cust { margin-top: 4px; font-size: 11px; color: var(--ink); }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(30, 30, 26, 0.55); }
.modal-card {
  position: relative; background: var(--card); border-radius: 16px; padding: 24px;
  width: 520px; max-width: 92vw; max-height: 86vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: rise 0.25s ease;
}
.modal-card.wide { width: 680px; }
.modal-card h3 { font-size: 16px; margin-bottom: 16px; padding-left: 10px; position: relative; }
.modal-card h3::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 4px; height: 15px;
  border-radius: 2px; background: var(--gold-light);
}

/* 工具条 */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type="search"], .toolbar select {
  padding: 8px 12px; border: 1px solid #e3e0d5; border-radius: 8px; font-size: 13px; outline: none; background: #fff;
}
.toolbar .spacer { flex: 1; }

/* 订单套餐卡 */
.pkg-card {
  border: 1.5px solid #e3e0d5; border-radius: var(--radius); padding: 14px 16px; cursor: pointer;
  transition: all 0.15s; text-align: center;
}
.pkg-card:active { transform: scale(0.97); }
.pkg-card .name { font-weight: 700; font-size: 14px; }
.pkg-card .price { font-size: 20px; font-weight: 800; color: var(--gold); margin-top: 6px; }
.pkg-card .days { font-size: 11px; color: var(--muted); }
.pkg-card.on { border-color: var(--gold-light); background: var(--gold-bg); box-shadow: 0 4px 14px rgba(212, 175, 55, 0.2); }
.amount-line { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: var(--gold-bg); border-radius: 8px; margin-top: 12px; font-weight: 700; }
.amount-line .num { font-size: 20px; color: var(--gold); }
.disc-warn { color: var(--danger); font-size: 12px; margin-top: 6px; }

/* 驾驶舱告警条 */
.alert-banner {
  border-radius: var(--radius); padding: 12px 16px; font-size: 13px; font-weight: 600; margin-bottom: 16px;
}
.alert-loss { background: #fdf0ef; color: var(--danger); border: 1px solid #efc4bf; }
.alert-healthy { background: #eef7ee; color: var(--ok); border: 1px solid #cde4cd; }

/* 进度条 */
.progress { height: 6px; background: #ece9df; border-radius: 3px; overflow: hidden; }
.progress .bar { height: 100%; background: linear-gradient(90deg, var(--gold-light), var(--gold)); border-radius: 3px; }
