:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #e6e8ec;
  --text: #2a2a2e;
  --muted: #8a8f99;
  --brand: #c96a87;
  --brand-dark: #a84e6b;
  --brand-soft: #fbeef2;
  --side-bg: #2c2430;
  --side-text: #cfc9d6;
  --green: #3ca36b;
  --green-soft: #eaf7f0;
  --amber: #c98a1f;
  --amber-soft: #fbf3e2;
  --blue: #3b82c4;
  --blue-soft: #e9f2fb;
  --red: #cf3d4e;
  --red-soft: #fcecee;
  --gray-soft: #f0f1f4;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}
.hidden { display: none !important; }

/* ===== login ===== */
.login-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fbeef2, #f5f6f8);
}
.login-card {
  width: 420px; max-width: 92vw; background: #fff;
  border-radius: 18px; padding: 40px 36px; text-align: center;
  box-shadow: var(--shadow);
}
.login-logo { font-size: 52px; }
.login-card h1 { margin: 8px 0 4px; font-size: 24px; color: var(--brand-dark); }
.login-sub { color: var(--muted); margin: 0 0 26px; }
.login-actions { display: flex; flex-direction: column; gap: 12px; }
.login-actions .btn { width: 100%; }
.login-tip { color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ===== layout ===== */
.app { display: flex; height: 100vh; }
.sidebar {
  width: 218px; background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.brand { padding: 18px 18px 14px; font-size: 18px; font-weight: 700; color: #fff; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px; }
.nav-item {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--side-text); padding: 10px 12px; border-radius: 8px;
  cursor: pointer; font-size: 14px; margin: 2px 0;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; justify-content: space-between; }
.role-badge { background: rgba(255,255,255,.14); padding: 4px 10px; border-radius: 12px; font-size: 12px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 62px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.topbar h2 { margin: 0; font-size: 18px; }
.topbar .date { color: var(--muted); font-size: 12px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip { background: var(--brand-soft); color: var(--brand-dark); padding: 6px 12px; border-radius: 16px; font-size: 13px; }
.api-status { font-size: 12px; padding: 5px 10px; border-radius: 14px; background: var(--gray-soft); color: var(--muted); }
.api-status.ok { background: var(--green-soft); color: var(--green); }
.api-status.off { background: var(--amber-soft); color: var(--amber); }
.api-status.conflict { background: #fff0e3; color: #b84e00; font-weight: 700; }
.content { flex: 1; overflow-y: auto; padding: 22px 24px; }

/* ===== generic ===== */
.btn {
  background: #fff; border: 1px solid var(--border); color: var(--text);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.btn:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-mini { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; cursor: pointer; font-size: 12px; color: var(--muted); }
.btn-mini.ghost { border: 0; color: var(--muted); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn-danger { border-color: var(--red); color: var(--red); }

.grid { display: grid; gap: 16px; }
.col-4 { grid-template-columns: repeat(4, 1fr); }
.col-5 { grid-template-columns: repeat(5, 1fr); }
.col-3 { grid-template-columns: repeat(3, 1fr); }
.col-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1180px) { .col-5 { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 1080px) { .col-4 { grid-template-columns: repeat(2,1fr); } .col-3 { grid-template-columns: repeat(2,1fr); } .col-2 { grid-template-columns: 1fr; } }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.kpi-value { font-size: 26px; font-weight: 700; margin: 4px 0; }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }
/* 日 / 周 / 月 切换 */
.seg { display: inline-flex; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg-btn { border: 0; background: none; padding: 7px 14px; font-size: 13px; cursor: pointer; color: var(--text); }
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.seg-btn.active { background: var(--brand); color: #fff; }
.section { margin-top: 18px; }
.section-title { font-size: 15px; font-weight: 700; margin: 0 0 10px; }

/* table */
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--muted); font-weight: 600; background: #fafbfc; }
tr:hover td { background: #fafbfc; }
.table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

/* badges */
.badge { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: 12px; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-gray { background: var(--gray-soft); color: var(--muted); }
.badge-brand { background: var(--brand-soft); color: var(--brand-dark); }
/* 会员档位：金 / 银 / 黑 / 钻…每种颜色一眼区分（颜色可在「系统设置 → 会员档位」里改） */
.badge-gold { background: #fdf1cf; color: #8a6100; }
.badge-silver { background: #eef1f5; color: #56636f; }
.badge-dark { background: #33384a; color: #ffd97a; }
.badge-purple { background: #f1e9fd; color: #6b4ea8; }

.tag { display: inline-block; padding: 2px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; color: var(--muted); margin: 2px; background: #fafbfc; }

/* filters */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-field { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.filter-field input, .filter-field select { border: 0; outline: 0; background: none; font-size: 13px; min-width: 90px; }
.filter-field input::placeholder { color: var(--muted); }

/* wizard */
.wizard { max-width: 880px; }
.wsec-title { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; letter-spacing: .3px; }
.wizard-steps { display: flex; gap: 8px; margin-bottom: 18px; }
.wstep { flex: 1; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px; color: var(--muted); }
.wstep.active { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.wstep { cursor: pointer; }
.wstep:hover { border-color: var(--brand); }
.wstep .dot { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: var(--gray-soft); text-align: center; line-height: 18px; margin-right: 6px; font-size: 11px; }
.wstep.active .dot { background: var(--brand); color: #fff; }
.form-row { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; margin-bottom: 14px; }
.form-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.form-field input, .form-field select { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; outline: 0; font-size: 13px; }
.form-field input:focus, .form-field select:focus { border-color: var(--brand); }
.form-field .hint { font-size: 11px; color: var(--amber); margin-top: 4px; }
/* 表单里的勾选项：与输入框同高、垂直居中
   （注意：.form-field label 是 display:block，直接用 .tag 当勾选标签会被撑成一整块，
   所以统一用 .check-line，并且用 .form-field .check-line 提高优先级覆盖 display） */
.check-line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text);
  margin: 0; cursor: pointer; white-space: nowrap; line-height: 1; }
.form-field .check-line { display: flex; margin: 0; height: 35px; }
.check-line input[type="checkbox"] { width: 15px; height: 15px; margin: 0; flex-shrink: 0; accent-color: var(--brand); }
.wsec-title .check-line { float: right; font-weight: 400; }
/* 「这套有鞋」下面的三列：鞋码 / 是否还原鞋 / 备注，一行排齐，不留空档 */
.grid-shoes { display: grid; grid-template-columns: 96px minmax(140px, 190px) 1fr; gap: 14px; margin-top: 10px; }
@media (max-width: 760px) { .grid-shoes { grid-template-columns: 1fr 1fr; } }
.wizard-actions { display: flex; justify-content: space-between; margin-top: 20px; }

/* resource conflicted marker */
.conflict { color: var(--red); font-size: 12px; }
.ok { color: var(--green); font-size: 12px; }

/* timeline */
.timeline { display: flex; flex-direction: column; gap: 10px; }
.tl-row { display: flex; gap: 14px; align-items: flex-start; }
.tl-time { width: 68px; color: var(--muted); font-size: 12px; padding-top: 4px; }
.tl-card { flex: 1; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.tl-clickable { cursor: pointer; }
.tl-clickable:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.tl-card .tl-title { font-weight: 600; }
.tl-card .tl-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.tl-card .tl-res { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }

/* assistant floating */
.assistant {
  position: fixed; right: 20px; bottom: 20px; width: 380px; max-width: 92vw;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.16); overflow: hidden; z-index: 50;
}
.assistant-header { display: flex; justify-content: space-between; align-items: center; background: var(--brand); color: #fff; padding: 10px 14px; font-weight: 600; }
.assistant-chat { padding: 12px; background: var(--gray-soft); }
.msg.from { display: flex; }
.bubble { background: #fff; border-radius: 12px; padding: 8px 12px; max-width: 82%; font-size: 13px; box-shadow: var(--shadow); }
.assistant-result { padding: 12px; }
.cand { display: flex; align-items: flex-start; gap: 8px; background: var(--brand-soft); border: 1px solid #f3d5dd; border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; cursor: pointer; font-size: 13px; }
.cand:hover { border-color: var(--brand); }
.cand .conf { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cand .src { font-size: 11px; color: var(--muted); margin-top: 4px; }
.assistant-note { padding: 8px 12px; font-size: 11px; color: var(--muted); background: #fafbfc; border-top: 1px solid var(--border); }

/* order actions */
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions-links { display: flex; gap: 8px; }
.link-mini { color: var(--brand-dark); cursor: pointer; font-size: 13px; }
.link-mini:hover { text-decoration: underline; }
.todo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.todo-actions .link-mini { display: inline-block; white-space: nowrap; padding: 2px 0; }

.chart-bars {
  display: grid; align-items: stretch; gap: 2px; height: 180px;
  padding: 10px 10px 8px; box-sizing: border-box;
  background: linear-gradient(to bottom, #fff, #fdfafb);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.chart-head { justify-content: space-between; align-items: flex-start; gap: 6px 12px; flex-wrap: wrap; }
.bar-col { min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; }
.bar-track {
  flex: 1; width: 100%; min-height: 0; display: flex; align-items: flex-end;
  justify-content: center; border-bottom: 1px solid var(--border);
}
.bar-fill {
  width: 74%; min-height: 4px; border-radius: 5px 5px 1px 1px;
  background: linear-gradient(to top, var(--brand-dark), var(--brand));
  box-shadow: 0 2px 6px rgba(201, 106, 135, .18);
  transition: filter .15s ease, transform .15s ease;
}
.bar-col:hover .bar-fill { filter: brightness(1.06); transform: scaleX(1.08); }
.bar-fill.zero { height: 2px !important; min-height: 2px; background: #eadfe3; box-shadow: none; }
.bar-label { height: 20px; line-height: 20px; color: var(--muted); font-size: 10px; }
.chart-day-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chart-day-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; border: 1px solid #f0dce2; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark); font-size: 11px;
}
.chart-day-chip b { font-weight: 600; }

.settings-group { margin-bottom: 18px; }
.settings-group h4 { margin: 0 0 10px; font-size: 14px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.switch { position: relative; width: 42px; height: 24px; background: #d6d9df; border-radius: 24px; cursor: pointer; }
.switch.on { background: var(--green); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on::after { left: 21px; }

.empty { color: var(--muted); text-align: center; padding: 30px; }
.mint { font-size: 12px; color: var(--muted); }
.flex { display: flex; gap: 12px; align-items: center; }
.grow { flex: 1; }
.mt8 { margin-top: 8px; }
.muted { color: var(--muted); }
.portal-note { background: var(--brand-soft); border: 1px solid #f3d5dd; color: var(--brand-dark); border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }

/* ===== 弹窗 ===== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(28,22,32,.45);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 24px;
}
.modal {
  width: 520px; max-width: 96vw; max-height: 88vh; overflow: auto;
  background: #fff; border-radius: 14px; box-shadow: 0 16px 48px rgba(0,0,0,.24);
}
.modal-wide { width: 620px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: #fafbfc; }
.script-box { background: var(--brand-soft); border: 1px solid #f3d5dd; border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.9; color: var(--brand-dark); user-select: text; white-space: pre-wrap; word-break: break-word; }

/* 系统设置 · 订单确认话术模块 */
.script-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.script-template-code { display: block; max-width: 420px; padding: 5px 7px; border-radius: 6px; background: var(--gray-soft); white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 1.55; }
.script-row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; white-space: nowrap; }
.script-row-actions .danger { color: var(--red); }
.script-token-help { border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; background: #fcfcfd; }
.script-token-help summary { cursor: pointer; color: var(--brand-dark); font-size: 13px; font-weight: 600; }
.script-token-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px 12px; margin-top: 10px; }
.script-token-grid > div { display: flex; align-items: center; gap: 7px; min-width: 0; }
.script-token-grid code, .script-token { background: var(--brand-soft); color: var(--brand-dark); border-radius: 5px; padding: 2px 5px; font-size: 12px; white-space: nowrap; }
.script-token-grid span { color: var(--muted); font-size: 12px; }
.script-token-picker { display: flex; flex-wrap: wrap; gap: 6px; padding: 9px; border: 1px dashed var(--border); border-radius: 9px; background: #fcfcfd; }
.script-token-btn { border: 1px solid #f0ccd5; border-radius: 6px; background: var(--brand-soft); color: var(--brand-dark); padding: 4px 7px; font-size: 12px; cursor: pointer; }
.script-token-btn:hover { border-color: var(--brand); background: #fff; }
@media (max-width: 760px) { .script-editor-grid { grid-template-columns: 1fr; } }

/* ===== 轻提示 ===== */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(148px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.bar-mini { display: inline-block; width: 90px; height: 8px; background: var(--gray-soft); border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.bar-mini span { display: block; height: 100%; background: var(--brand); }
.week-col { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px; min-height: 140px; }
.week-col.today { border-color: var(--brand); background: var(--brand-soft); }
.week-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; margin-bottom: 4px; }
.week-head span { color: var(--muted); font-size: 11px; }
.week-count { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.week-order { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; margin-bottom: 12px; cursor: pointer; font-size: 12px; }
.week-order:hover { border-color: var(--brand); }
.wo-time { color: var(--brand-dark); font-size: 18px; line-height: 1.35; font-weight: 600; }
.wo-name { margin: 2px 0; }
.wo-cast {
  margin: 4px 0 5px; padding: 3px 6px; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand-dark);
  line-height: 1.5; word-break: break-word;
}
.wo-meta { color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wo-note { margin-top: 5px; padding-top: 5px; border-top: 1px dashed var(--border); color: #8a5363; line-height: 1.45; word-break: break-word; }
.workbench-week-head { gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.workbench-nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.workbench-nav input { width: auto; min-width: 138px; padding: 7px 9px; }
.leave-reminder { padding: 10px 12px; border-radius: 9px; background: #fff8e8; border: 1px solid #f0d29a; color: #7a5312; line-height: 1.8; font-size: 13px; }
.booking-calendar {
  display: grid; grid-template-columns: repeat(7, minmax(128px, 1fr)); gap: 6px;
  overflow-x: auto; padding-bottom: 6px;
}
.calendar-weekday {
  text-align: center; font-size: 12px; font-weight: 700; color: var(--muted);
  background: #faf8fa; border-radius: 6px; padding: 6px 2px;
}
.calendar-day {
  min-height: 118px; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 7px; font-size: 11px; line-height: 1.45;
}
.calendar-day.outside { opacity: .42; background: #fafafa; }
.calendar-day.today { border-color: var(--brand); background: var(--brand-soft); }
.calendar-date { display: flex; justify-content: space-between; align-items: center; color: var(--muted); margin-bottom: 5px; }
.calendar-date b { color: var(--text); font-size: 14px; }
.calendar-leave { margin-bottom: 5px; padding: 3px 5px; border-radius: 5px; background: #fff2d8; color: #7a5312; word-break: break-word; }
.calendar-order { background: #faf8fb; border: 1px solid #eee5ec; border-radius: 6px; padding: 5px; margin-top: 5px; cursor: pointer; }
.calendar-order:hover { border-color: var(--brand); }
.calendar-pkg { color: var(--brand-dark); margin-top: 2px; word-break: break-word; }
.calendar-cast, .calendar-note { color: var(--muted); margin-top: 2px; word-break: break-word; }
.calendar-note { color: #8a5363; padding-top: 2px; border-top: 1px dashed #eadbe2; }
.order-cast-cell { min-width: 150px; line-height: 1.55; word-break: break-word; }
.wash-item { display: flex; gap: 12px; align-items: center; border-top: 1px solid var(--border); padding: 10px 0; }
.wash-item.urgent { background: var(--red-soft); border-radius: 8px; padding: 10px; }

.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #2c2430; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.2);
  animation: toast-in .18s ease-out; max-width: 80vw;
}
.toast-success { background: #2f8f5b; }
.toast-warn { background: #c07a12; }
.toast.out { opacity: 0; transition: opacity .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ===== 登录页 / 品牌 / 顶栏 ===== */
[v-cloak] { display: none; }
.mobile-only { display: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 30px; height: 30px; border-radius: 50%; background: #fff; object-fit: cover; }
.login-logo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; box-shadow: 0 4px 16px rgba(201,106,135,.25); }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.login-field { display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: 13px; color: var(--muted); }
.login-field > span { display: inline-flex; align-items: center; gap: 6px; }
.login-field select,
.login-field input { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; outline: 0; background: #fff; color: var(--text); }
.login-field select:focus,
.login-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.login-error { color: var(--red); font-size: 13px; min-height: 18px; text-align: left; }
.login-btn { padding: 12px; font-size: 15px; }
.topbar-title { display: flex; flex-direction: column; }
.btn-icon { background: none; border: 0; font-size: 20px; color: var(--text); padding: 6px 10px; cursor: pointer; border-radius: 8px; }
.btn-icon:hover { background: var(--gray-soft); }
.store-chip { background: var(--blue-soft); color: var(--blue); padding: 6px 12px; border-radius: 16px; font-size: 13px; }
.store-switch { border: 0; outline: 0; cursor: pointer; padding-right: 8px; font-family: inherit; }
.store-switch:focus { box-shadow: 0 0 0 3px rgba(59,130,196,.15); }
.drawer-mask { display: none; }
.bottom-nav { display: none; }
.fatal-box {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 999;
  background: #fcecee; color: var(--red); border-top: 1px solid #f3c3c9;
  padding: 12px 16px; font-size: 13px; line-height: 1.6;
}
.row-warn td { background: var(--red-soft) !important; }
.nav-item i { width: 18px; text-align: center; margin-right: 8px; }
.btn i, .link-mini i { margin-right: 4px; }

/* ===== 话术助手：聊天气泡输入区（大字输入 + 截图粘贴）===== */
.form-field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  outline: 0; font-size: 14px; line-height: 1.7; resize: vertical; min-height: 90px;
  font-family: inherit; color: var(--text); background: #fff;
}
.form-field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.ai-paste-zone {
  border: 1px dashed var(--border); border-radius: 12px; padding: 8px;
  background: #fff; transition: border-color .15s, background .15s;
}
.ai-paste-zone.dragging { border-color: var(--brand); background: var(--brand-soft); }
.ai-paste-zone textarea { border: 0; box-shadow: none !important; min-height: 190px; background: transparent; }
.ai-paste-zone textarea:focus { border: 0; }
.ai-img-list { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 4px 8px; }
.ai-img-list:empty { display: none; }
.ai-thumb { position: relative; width: 104px; height: 104px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--gray-soft); }
.ai-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-thumb-x {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(44,36,48,.72); color: #fff; font-size: 12px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ai-thumb-x:hover { background: var(--red); }
/* 服装档案：从截图 AI 读出来的字段加浅黄底，提醒客服「这一栏是猜的，核对一下」 */
.photo-filled { background: #fff8e1 !important; border-color: #f0c96a !important; }
#cm-photo-zone { cursor: pointer; }
#cm-photo-zone .ai-img-list { padding: 0 0 4px; }

/* ===== 用户权限勾选 ===== */
.modal-wide { max-width: 720px; width: 94vw; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.perm-group { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: #fcfcfd; }
.perm-group-title { font-size: 12px; color: var(--brand-dark); font-weight: 600; margin-bottom: 6px; }
.perm-item { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 0; cursor: pointer; line-height: 1.35; }
.perm-item input { width: 15px; height: 15px; accent-color: var(--brand); flex-shrink: 0; }
.perm-item input:disabled { cursor: not-allowed; }

/* ===== 订单素材 / 授权 / 备注 ===== */
/* 输入联想下拉（替代原生 datalist 的黑框） */
.addon-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.addon-row .addon-sel { flex: 2; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; outline: 0; background: #fff; }
.addon-row .addon-qty { flex: 0 0 84px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; outline: 0; }
.addon-row .addon-sel:focus, .addon-row .addon-qty:focus { border-color: var(--brand); }

/* ===== 套餐行（快速录单 / 编辑订单：一单可以约多个套餐）===== */
.pkg-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px 12px; background: #fcfcfd; }
.pkg-row + .pkg-row { margin-top: 8px; }
.pkg-row-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pkg-row-head b { font-size: 13px; color: var(--brand-dark); }
.pkg-row-head .grow { flex: 1; }
.pkg-row .form-row { margin-bottom: 6px; }
/* 弹窗里（编辑订单）行内两列在窄屏也放得下 */
@media (max-width: 640px) {
  .pkg-row { padding: 8px 8px 2px; }
  .pkg-row-head { flex-wrap: wrap; }
}

/* 人员岗位多选（一个人可以身兼多职：勾选 + 该岗位的每日上限） */
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-top: 4px; }
.role-cell { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; background: #fcfcfd; }
.role-cell .perm-item { margin: 0; }
.role-cell .sm2-rolecap { width: 72px; padding: 5px 8px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 12px; outline: 0; }
.role-cell .sm2-rolecap:focus { border-color: var(--brand); }

.combo-box {
  position: absolute; left: 0; right: 0; z-index: 60;
  margin-top: 4px; max-height: 260px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); padding: 4px;
}
.combo-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 13px;
}
.combo-item.active, .combo-item:hover { background: var(--brand-soft); }
.combo-main { color: var(--text); }
.combo-note { color: var(--muted); font-size: 11px; white-space: nowrap; }

.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-item { border-top: 1px solid var(--border); padding: 8px 6px; font-size: 13px; line-height: 1.6; border-radius: 8px; }
.todo-item:first-child { border-top: 0; }
.todo-item.clickable { cursor: pointer; }
.todo-item.clickable:hover { background: var(--brand-soft); }
.todo-item.clickable::after { content: '›'; float: right; color: var(--brand); font-size: 16px; margin-top: -18px; }
.todo-item .mint { font-size: 12px; }
.todo-row { cursor: pointer; }
.todo-row:hover td { background: var(--brand-soft); }
.mt12 { margin-top: 12px; }

.asset-list { margin: 6px 0; }
.asset-row { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); padding: 8px 0; font-size: 13px; }
.asset-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.asset-thumb { position: relative; width: 108px; }
.asset-thumb img { width: 108px; height: 108px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; }
.asset-meta { font-size: 11px; color: var(--muted); text-align: center; margin-top: 2px; }
.asset-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(44,36,48,.72); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; }
.asset-x:hover { background: var(--red); }
.consent-row { display: inline-flex; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.consent-chips { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.note-list { max-height: 200px; overflow-y: auto; }
.note-row { display: flex; align-items: flex-start; gap: 8px; border-top: 1px solid var(--border); padding: 6px 0; font-size: 13px; }
.note-row:first-child { border-top: 0; }
.audit-detail-cell { min-width: 320px; max-width: 620px; line-height: 1.65; }
.audit-summary { color: var(--text); word-break: break-word; }
.audit-fields { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.audit-fields > span {
  display: inline-flex; gap: 4px; align-items: baseline; padding: 3px 7px;
  border-radius: 6px; background: #f8f5f7; border: 1px solid #eee5eb;
  color: var(--muted); font-size: 11px;
}
.audit-fields b { color: var(--text); font-weight: 600; }
.audit-changes { margin-top: 6px; display: grid; gap: 4px; }
.audit-changes > div {
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  font-size: 11px; color: var(--muted);
}
.audit-changes > div > span { min-width: 58px; font-weight: 600; color: var(--text); }
.audit-changes del { color: #9a6a75; background: #fff1f3; border-radius: 4px; padding: 1px 5px; }
.audit-changes ins { color: #257253; background: #edf9f2; border-radius: 4px; padding: 1px 5px; text-decoration: none; }

/* ===== 移动端适配（平板 / 手机）===== */
@media (max-width: 900px) {
  .mobile-hidden { display: none !important; }
  .mobile-only { display: inline-flex !important; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: 250px;
    transform: translateX(-100%); transition: transform .2s ease; z-index: 120;
  }
  .sidebar.open { transform: none; }
  .drawer-mask { display: block; position: fixed; inset: 0; background: rgba(30,20,30,.4); z-index: 110; }
  .main { width: 100%; }
  .topbar { height: 56px; padding: 0 12px; gap: 8px; }
  .topbar-right { gap: 6px; }
  .topbar-right .user-chip,
  .topbar-right .api-status { display: none; }
  .content { padding: 14px 12px 80px; }
  .grid.col-5, .grid.col-4, .grid.col-3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 58px;
    background: #fff; border-top: 1px solid var(--border); z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav button {
    flex: 1; border: 0; background: none; font-size: 11px; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
  }
  .bottom-nav button i { font-size: 17px; }
  .bottom-nav button.active { color: var(--brand); }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 620px; }
  /* 弹窗在手机上做成底部抽屉 */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { width: 100% !important; max-width: 100%; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .modal-wide { width: 100%; }
  .filters { gap: 8px; }
  .filter-field { flex: 1 1 45%; }
  .wizard-actions { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .wizard-actions .btn { width: 100%; }
  .timeline .tl-row { flex-direction: column; gap: 4px; }
  .timeline .tl-time { width: auto; }
  .week-grid { grid-template-columns: repeat(7, minmax(130px, 1fr)); }
  .booking-calendar { grid-template-columns: repeat(7, minmax(118px, 1fr)); }
  .workbench-nav { justify-content: flex-start; }
  .wash-item { flex-direction: column; align-items: stretch; gap: 8px; }
  .assistant { left: 8px; right: 8px; width: auto; bottom: 70px; }
}

@media (max-width: 560px) {
  .grid.col-5, .grid.col-4, .grid.col-3, .grid.col-2 { grid-template-columns: 1fr !important; }
  .form-row { grid-template-columns: 1fr !important; }
  .kpi-value { font-size: 22px; }
  .content { padding: 12px 10px 78px; }
  .card { padding: 14px; }
  .topbar h2 { font-size: 16px; }
  .date { font-size: 11px; }
}
