/* admin-server/public/style.css —— 青绿主题 #1FA1A0 */
:root {
  --primary: #1FA1A0;
  --primary-dark: #157f7e;
  --primary-light: #e3f6f5;
  --text: #222;
  --muted: #8a9199;
  --line: #eceef1;
  --bg: #f5f6f8;
  --danger: #e54d42;
  --warn: #e08a00;
  --ok: #07a15c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1FA1A0 0%, #0f6a6a 100%);
  padding: 20px;
}

.login-card {
  width: 380px;
  background: #fff;
  border-radius: 16px;
  padding: 40px 34px 34px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
}

.login-logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 1px;
}

.login-sub {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 28px;
}

.login-card .field { margin-bottom: 16px; }

.login-tip {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  background: #f7f8fa;
  border-radius: 8px;
  padding: 12px;
}

.login-err {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin-top: 4px;
}

/* 登录方式切换 */
.login-tabs {
  display: flex;
  gap: 6px;
  background: #f2f4f6;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 22px;
}

.login-tabs .tab-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  padding: 8px 0;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}

.login-tabs .tab-btn.active {
  background: #fff;
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

.tab-pane[hidden] { display: none; }

/* 验证码输入行 */
.code-line {
  display: flex;
  gap: 8px;
  align-items: center;
}

.code-line input { flex: 1; }

.code-line .btn {
  white-space: nowrap;
  padding: 0 14px;
  height: 40px;
  line-height: 40px;
}

.code-line .btn[disabled] {
  opacity: .6;
  cursor: not-allowed;
}

/* 二维码 */
.qr-box {
  width: 190px;
  height: 190px;
  margin: 4px auto 14px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.qr-hint {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}

.qr-code {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
}

.qr-code b {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 19px;
  letter-spacing: 4px;
  color: var(--primary-dark);
  margin-left: 4px;
}

.qr-status {
  text-align: center;
  font-size: 13px;
  color: var(--primary-dark);
  margin-top: 10px;
  min-height: 20px;
}

.qr-status.err { color: var(--danger); }

.qr-actions {
  text-align: center;
  margin-top: 6px;
  font-size: 13px;
}

.qr-actions .link-btn { color: var(--primary); cursor: pointer; }

.dev-hint {
  background: #fff8e6;
  border: 1px solid #ffe2a8;
  color: #8a5a00;
  font-size: 12.5px;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
  line-height: 1.6;
}

.dev-hint b {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 16px;
  letter-spacing: 3px;
}

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 210px;
  flex-shrink: 0;
  background: #0f2c2c;
  color: #cfe6e5;
  display: flex;
  flex-direction: column;
}

.brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-title { font-size: 16px; font-weight: 700; color: #fff; }
.brand-sub { font-size: 12px; color: #7fb6b5; margin-top: 4px; }

.nav { padding: 12px 10px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #cfe6e5;
  margin-bottom: 4px;
  user-select: none;
}

.nav-item:hover { background: rgba(255, 255, 255, .07); }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-ico { width: 18px; text-align: center; opacity: .9; }

.sidebar-foot {
  padding: 14px 20px;
  font-size: 12px;
  color: #6f9d9c;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.mode-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--warn);
}

.mode-dot.cloud { background: #35d07f; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 58px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.page-title { font-size: 16px; font-weight: 600; }

.user-box { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.user-name { font-weight: 600; }
.role-chip {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
}

.link-btn { color: var(--muted); cursor: pointer; font-size: 13px; }
.link-btn:hover { color: var(--primary); }

.content { padding: 22px 24px 40px; flex: 1; overflow: auto; }

/* ---------------- 通用 ---------------- */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-title { font-size: 15px; font-weight: 600; }
.card-desc { font-size: 12px; color: var(--muted); margin-top: 4px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-end { display: flex; gap: 10px; margin-left: auto; }

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

/* 基础设置「服务类型 + 次级选项」行编辑器 */
.svc-co {
  border: 1px solid #e8eaec;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  background: #fcfdfd;
}
.svc-co:last-child { margin-bottom: 0; }
.svc-co-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.svc-name {
  flex: 1;
  max-width: 260px;
  padding: 7px 10px;
  border: 1px solid #e3e6e8;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1FA1A0;
  background: #fff;
}
.svc-name:focus { border-color: var(--primary); outline: none; }
.svc-co-del {
  border: 1px solid #e8eaec;
  background: #fff;
  color: #999;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}
.svc-co-del:hover { color: #d9534f; border-color: #f0c7c5; }
.svc-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr 36px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.svc-row-head { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.svc-row input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #e3e6e8;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}
.svc-row input:focus { border-color: var(--primary); outline: none; }
.svc-del {
  border: 1px solid #e3e6e8;
  background: #fff;
  color: #999;
  border-radius: 8px;
  height: 34px;
  cursor: pointer;
}
.svc-del:hover { color: #d9534f; border-color: #f0c7c5; }
.svc-add { margin-top: 4px; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

.stat {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.stat-label { font-size: 13px; color: var(--muted); }
.stat-num { font-size: 30px; font-weight: 700; color: var(--primary); margin-top: 6px; }
.stat-num.muted { color: #bbb; }
.stat-num.warn { color: var(--warn); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--primary); }
.btn.ghost:hover { background: var(--primary-light); }
.btn.gray { background: #fff; color: #666; border-color: #dfe2e6; }
.btn.gray:hover { background: #f4f5f6; }
.btn.danger { background: #fff; color: var(--danger); border-color: #f0c4c1; }
.btn.danger:hover { background: #fdf2f1; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%;
  border: 1px solid #e2e5e9;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: #fbfcfd;
  outline: none;
}

input:focus, select:focus, textarea:focus { border-color: var(--primary); background: #fff; }
textarea { resize: vertical; min-height: 74px; }

/* 表格 */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: #fafbfc;
}
td { padding: 11px 12px; border-bottom: 1px solid #f4f5f7; vertical-align: middle; }
tr:hover td { background: #fbfcfd; }
.mono { font-family: Menlo, Consolas, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 徽标 */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
}
.b-pending { background: #fff3e0; color: var(--warn); }
.b-scheduled { background: var(--primary-light); color: var(--primary-dark); }
.b-progress { background: #e8f1ff; color: #2b6fd6; }
.b-done { background: #e7f8ee; color: var(--ok); }
.b-cancel { background: #f0f0f0; color: #999; }
.b-low { background: #fdeceb; color: var(--danger); }

.empty { text-align: center; color: #b7bdc4; padding: 34px 0; font-size: 13px; }

/* 需要用户动手的故障提示（例如后台服务是旧版本） */
.alert-warn {
  background: #fff8ea;
  border: 1px solid #ffe2ad;
  color: #9a6414;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
}
.alert-warn code {
  background: rgba(0,0,0,.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

/* 弹窗 */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 32, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 16px;
  z-index: 50;
  overflow: auto;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: 560px;
  max-width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
}

.modal.wide { width: 760px; }

.modal-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 15px; font-weight: 600; }
.modal-close { cursor: pointer; color: #aab1b8; font-size: 20px; line-height: 1; }
.modal-body { padding: 18px 22px; max-height: 62vh; overflow: auto; }
.modal-foot {
  padding: 14px 22px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* 岗位多选（复选框做成药丸状） */
.role-picks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.field .role-picks .role-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 7px 14px;
  border: 1px solid #e3e7ea;
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  user-select: none;
}
.field .role-picks .role-pick:hover { border-color: var(--primary); }
.field .role-picks .role-pick:has(input:checked) {
  border-color: var(--primary);
  background: rgba(31, 161, 160, .10);
}
.role-pick input[type=checkbox] { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.role-pick input:checked + span { color: var(--primary); font-weight: 600; }

/* 列表里的岗位小标签 */
.role-tag {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 4px;
  border-radius: 10px;
  background: rgba(31, 161, 160, .10);
  color: #17817F;
  font-size: 12px;
  white-space: nowrap;
}

.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #16302f;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 99;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(4px); }
.toast.err { background: #8f2a22; }

/* 详情 */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 10px 12px; font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .v { color: var(--text); word-break: break-all; }

.tl { margin-top: 6px; }
.tl-item { border-left: 2px solid var(--primary-light); padding: 0 0 14px 14px; position: relative; }
.tl-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}
.tl-action { font-size: 13px; font-weight: 600; }
.tl-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.tag {
  display: inline-block;
  background: #f4f5f7;
  color: #666;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  margin: 0 6px 6px 0;
}

.verify-result { margin-top: 14px; }
.verify-card { border-radius: 10px; padding: 16px 18px; }
.verify-card.ok { background: #e7f8ee; border: 1px solid #c8ecd9; }
.verify-card.bad { background: #fdeceb; border: 1px solid #f5cbc7; }
.verify-card.warn { background: #fff6e6; border: 1px solid #f6e0b8; }
.verify-title { font-size: 15px; font-weight: 700; }
.verify-sub { font-size: 12px; color: #666; margin-top: 4px; }

/* ---------- 员工管理 ---------- */

.hint { font-size: 12px; color: var(--muted); }

.tip-list { padding: 4px 0 2px; font-size: 13px; line-height: 1.9; color: #555; }
.tip-list > div { padding: 4px 0; border-bottom: 1px dashed #eef0f2; }
.tip-list > div:last-child { border-bottom: 0; }
.tip-list b { color: var(--text); }

.field label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #e2e5e9;
  border-radius: 8px;
  background: #fbfcfd;
  cursor: pointer;
}
.field label.check input[type=checkbox] { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }

.staff-qr { display: flex; gap: 22px; align-items: center; }
.staff-qr-img {
  width: 220px;
  height: 220px;
  flex: 0 0 220px;
  border: 1px solid #eef0f2;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.staff-qr-img img { width: 100%; height: 100%; display: block; }
.staff-qr-side { flex: 1; min-width: 0; }
.staff-qr-name { font-size: 15px; font-weight: 700; }
.staff-code {
  font-family: Menlo, Consolas, monospace;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--primary-dark);
  margin: 10px 0 8px;
}
.staff-qr-side .hint { display: block; margin-top: 6px; line-height: 1.7; }

.qr-fail { text-align: center; font-size: 13px; color: var(--danger); padding: 0 14px; line-height: 1.8; }
.qr-fail .hint { color: var(--muted); margin-top: 6px; word-break: break-all; }

.fail-list { font-size: 13px; line-height: 1.9; color: #c0392b; max-height: 40vh; overflow: auto; }

/* ---------- 订单修改记录（订单详情弹窗） ---------- */
.edit-log {
  border: 1px solid #eef2f3;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fbfdfd;
}

.edit-log:last-child {
  margin-bottom: 0;
}

.edit-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  margin-bottom: 8px;
}

.edit-head .hint {
  color: #999;
  font-size: 12px;
}

.edit-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  line-height: 1.7;
}

.edit-label {
  color: #888;
  min-width: 78px;
}

.edit-from {
  color: #999;
  text-decoration: line-through;
  word-break: break-all;
}

.edit-arrow {
  color: #1FA1A0;
}

.edit-to {
  color: #1FA1A0;
  font-weight: 600;
  word-break: break-all;
}
