/* =========================================================
 * admin.css —— 早产月嫂后台管理样式
 * 与前台同一套暖粉 / 米色主题，桌面优先、移动端可用
 * ========================================================= */

:root {
  --pink: #e8627f;
  --pink-deep: #d84a6a;
  --pink-soft: #fdeef1;
  --cream: #fdf6ef;
  --text: #4a3f3c;
  --text-2: #8a7a75;
  --line: #f0e2dc;
  --ok: #3fa97c;
  --busy: #ee9b3e;
  --done: #9aa0a6;
  --blue: #4a90d9;
  --danger: #d9534f;
  --shadow: 0 2px 10px rgba(150, 100, 80, .08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #f2e7dd;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

[hidden] { display: none !important; }
code { background: #f6ece4; border-radius: 4px; padding: 1px 5px; font-size: 12px; }

/* ==================== 登录页 ==================== */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(150deg, #f9c9d4, #fdeee9 60%, #fdf3ec);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 20px;
  padding: 34px 28px 28px;
  box-shadow: 0 10px 30px rgba(150, 100, 80, .18);
  text-align: center;
}
.login-logo { font-size: 40px; }
.login-card h1 { margin: 8px 0 4px; font-size: 22px; }
.login-sub { margin: 0 0 22px; font-size: 13px; color: var(--text-2); }
.login-card .input { margin-bottom: 12px; }
.login-hint { margin: 12px 0 0; font-size: 11.5px; color: #b39a92; }
.login-hint.error { color: var(--danger); }

/* ==================== 主界面布局 ==================== */
.admin { max-width: 1180px; margin: 0 auto; padding: 0 14px 40px; }

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-title { font-size: 19px; font-weight: 700; }
.admin-actions { display: flex; align-items: center; gap: 10px; }
.admin-actions .link { font-size: 13px; color: var(--pink-deep); text-decoration: none; }

.admin-nav {
  display: flex;
  gap: 6px;
  background: #fff;
  border-radius: 14px;
  padding: 6px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  margin-bottom: 16px;
}
.nav-item {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-2);
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.nav-item.active {
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: #fff;
  font-weight: 600;
}

.tab-title { margin: 4px 0 14px; font-size: 17px; }

/* ==================== 卡片 / 统计 ==================== */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card-title { margin: 0 0 12px; font-size: 15px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-card b { display: block; font-size: 24px; color: var(--pink-deep); }
.stat-card span { font-size: 12px; color: var(--text-2); }
.stat-card.ok b { color: var(--ok); }
.stat-card.busy b { color: var(--busy); }
.stat-card.blue b { color: var(--blue); }

/* ==================== 工具栏 ==================== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fdfaf7;
  color: var(--text);
  outline: none;
  width: 100%;
}
.input:focus { border-color: var(--pink); background: #fff; }
.input.inline { width: auto; flex: 1; min-width: 140px; }
.input.select { flex: 0 0 auto; cursor: pointer; }
.input.textarea { resize: vertical; font-family: inherit; }
.file-input { font-size: 12px; }

/* ==================== 按钮 ==================== */
.btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: #fff;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
}
.btn-danger {
  border: 1px solid #eebcba;
  background: #fff;
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
}
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 9px; }
.btn-mini {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ==================== 表格 ==================== */
.table-wrap { overflow-x: auto; padding: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 780px; }
.table th {
  text-align: left;
  padding: 10px 10px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: #fdfaf7;
}
.table td {
  padding: 10px;
  border-bottom: 1px solid #f7efe9;
  vertical-align: middle;
}
.table tbody tr:hover { background: #fdfaf7; }
.table .empty-row td { text-align: center; color: var(--text-2); padding: 30px 0; }

.cell-nanny { display: flex; align-items: center; gap: 8px; }
.cell-nanny img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #fbe9e2;
}
.cell-nanny .nm { font-weight: 600; }

.status-badge { font-size: 11px; padding: 2px 9px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.status-badge.ok   { background: #e5f6ee; color: #2e8f66; }
.status-badge.busy { background: #fdf0dc; color: #c97f1f; }
.status-badge.done { background: #eef0f2; color: #7a8288; }
.status-badge.pending   { background: #fdf0dc; color: #c97f1f; }  /* 待确认 */
.status-badge.confirmed { background: #e8f1fb; color: #3373b5; }  /* 已确认 */
.status-badge.cancelled { background: #eef0f2; color: #7a8288; }  /* 已取消 */

.tags-inline { display: flex; flex-wrap: wrap; gap: 4px; }
.case-missing { color: #d0453c; font-size: 12px; cursor: help; }
.case-missing::after { content: " ⚠"; font-size: 11px; }

/* 解锁记录：设备号 / 到账状态 */
.device-code {
  font-family: Consolas, Monaco, monospace;
  font-size: 11.5px;
  color: #6b5a52;
  background: #f6efea;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
}
.cell-sub { margin-top: 3px; font-size: 11px; color: #a3908a; }
.sb-ok { color: #3d8b4f; font-weight: 600; }

/* 解锁记录：付款凭证 */
.ref-no { font-family: Consolas, Monaco, monospace; color: #c0392b; letter-spacing: 1px; }
.switch-ok { color: #3d8b4f; }
.switch-warn { color: #d0453c; font-weight: 600; }
.memo-cell { display: flex; align-items: center; gap: 6px; }
.memo-code-cell {
  font-family: Consolas, Monaco, monospace;
  font-size: 15px;
  letter-spacing: 3px;
  color: #c0392b;
  background: #fdf0ee;
  border: 1px solid #f0d5d0;
  border-radius: 6px;
  padding: 2px 9px;
}

/* 付款截图查看弹窗 */
.modal-card-wide { max-width: 520px; }
.shot-view { text-align: center; padding: 4px 0 8px; }
.shot-view img {
  max-width: 100%;
  max-height: 62vh;
  border: 1px solid var(--line, #f0ddd3);
  border-radius: 10px;
  background: #fff;
}

/* 支付设置：收款码预览 */
.qr-preview-wrap {
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.qr-preview {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border: 1px solid var(--line, #f0ddd3);
  border-radius: 10px;
  background: #fff;
}
.case-tip {
  margin: 10px 0 0;
  padding: 9px 12px;
  font-size: 12.5px;
  color: #a1440f;
  background: #fdf3e7;
  border: 1px solid #f3dcbd;
  border-radius: 8px;
}
.tags-inline span {
  font-size: 10.5px;
  color: #c96a80;
  background: var(--pink-soft);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.op-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 12px;
  cursor: pointer;
  margin: 0 3px 3px 0;
}
.op-btn.ok { color: var(--ok); border-color: #bfe0d1; }
.op-btn.danger { color: var(--danger); border-color: #eebcba; }
.op-btn.primary { color: var(--pink-deep); border-color: #f2c4cd; }

/* ==================== 弹窗 ==================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-mask { position: absolute; inset: 0; background: rgba(60, 40, 35, .45); animation: fadeIn .2s; }
.modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  box-sizing: border-box;
  animation: slideUp .22s ease-out;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-wide { max-width: 860px; }
.modal-small { max-width: 380px; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-close {
  border: none;
  background: #f4f1ee;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  color: var(--text-2);
  cursor: pointer;
}
.form-scroll { overflow-y: auto; flex: 1; padding-right: 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.modal-tip { margin: 12px 0 0; font-size: 11.5px; color: #b39a92; line-height: 1.7; }

/* 表单 */
.form-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 720px) { .form-grid2 { grid-template-columns: 1fr; } }
.form-col label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.form-col label .input { margin-top: 5px; }
.req { color: var(--danger); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

.avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin-top: 6px;
  border: 2px solid var(--pink-soft);
  background: #fbe9e2;
}

/* 头像上传区 */
.avatar-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.tip-inline { font-size: 12px; color: var(--text-2); }

/* 信息发布授权承诺框 */
.auth-box {
  border: 1px dashed #e8c9bd;
  background: #fdfaf7;
  border-radius: 12px;
  padding: 12px;
  margin-top: 6px;
}
.auth-box b { font-size: 13px; color: var(--pink-deep); }
.auth-box p { margin: 6px 0 10px; font-size: 12px; color: #6b5a55; line-height: 1.85; }
.auth-box .check-row { margin-bottom: 0; }

/* 勾选行（通用） */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  line-height: 1.6;
  text-align: left;
}
.check-row input { margin: 2px 0 0; width: auto; flex: 0 0 auto; }

/* 演示数据标记 */
.demo-tag {
  font-size: 10px;
  color: #b06a7a;
  background: var(--pink-soft);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 5px;
  white-space: nowrap;
}

.chips-preview { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chips-preview span {
  font-size: 11px;
  color: #c96a80;
  background: var(--pink-soft);
  padding: 2px 9px;
  border-radius: 999px;
}

/* 排期编辑器 */
.schedule-editor {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fdfaf7;
}
.schedule-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text);
  flex-wrap: wrap;
}
.schedule-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
@media (max-width: 560px) { .schedule-grid { grid-template-columns: repeat(4, 1fr); } }
.day-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 6px 2px;
  text-align: center;
  cursor: pointer;
  font: inherit;
  transition: all .12s;
}
.day-btn.free { border-color: #f2b8c6; }
.day-btn.busy { background: #f0e9e4; color: #b5a9a4; border-color: transparent; }
.day-btn .dd { display: block; font-size: 11.5px; font-weight: 600; color: var(--text); }
.day-btn.busy .dd { color: #b5a9a4; }
.day-btn .wk { display: block; font-size: 10px; color: var(--text-2); }
.day-btn .st { display: block; margin-top: 3px; font-size: 10px; }
.day-btn.free .st { color: var(--pink-deep); font-weight: 600; }
.day-btn.busy .st { color: #b5a9a4; }

/* 确认弹窗 */
.confirm-title { margin: 0 0 8px; font-size: 16px; }
.confirm-msg { margin: 0 0 16px; font-size: 13.5px; color: var(--text-2); line-height: 1.7; }
.unlock-btns { display: flex; gap: 10px; }
.unlock-btns .btn-primary, .unlock-btns .btn-ghost { flex: 1; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: rgba(50, 35, 30, .88);
  color: #fff;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 999px;
  z-index: 99;
  max-width: 80%;
  text-align: center;
  animation: fadeIn .2s;
}

/* 文档列表 / 提示 */
.doc-list { margin: 0; padding-left: 18px; font-size: 13px; color: #6b5a55; line-height: 2; }
.tip { margin: 0 0 10px; font-size: 12.5px; color: var(--text-2); line-height: 1.7; }

/* 最近订单（总览） */
.recent-list { display: flex; flex-direction: column; }
.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
  flex-wrap: wrap;
}
.recent-item:last-child { border-bottom: none; }
.recent-item .who { font-weight: 600; }
.recent-item .when { font-size: 12px; color: var(--text-2); }
