/* 急凑凑 · 运营后台
   品牌：主 #0F5C4E / 辅 #E4762B / 底 #FBF9F4 / 字 #1F2A28
   桌面优先（1280 起），零外部依赖。 */

:root {
  --brand: #0F5C4E;
  --brand-dark: #0A3F35;
  --brand-mid: #147263;
  --brand-soft: #E8F2EF;
  --brand-line: #CADFD8;
  --accent: #E4762B;
  --accent-dark: #B95A1B;
  --accent-soft: #FDF0E4;
  --bg: #FBF9F4;
  --card: #FFFFFF;
  --text: #1F2A28;
  --muted: #6C7873;
  --muted-2: #8B958F;
  --line: #E7E2D7;
  --line-strong: #D6CFC0;
  --danger: #B23A2A;
  --danger-soft: #FBECE9;
  --ok: #1D7A50;
  --ok-soft: #E6F4EC;
  --warn: #9A5B0B;
  --warn-soft: #FDF1DE;
  --info: #245E7C;
  --info-soft: #E9F2F7;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(31, 42, 40, .04), 0 10px 26px rgba(31, 42, 40, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-width: 1180px;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

body.modal-open { overflow: hidden; }

a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; }
[hidden] { display: none !important; }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 11.5px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- 启动屏 */
.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
}
.boot-mark, .brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--brand);
  color: #F4EEE1;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 0;
}
.boot-mark { margin-bottom: 8px; }
.boot-text { font-size: 15px; font-weight: 600; color: var(--text); }
.boot-sub { font-size: 12px; }

/* ---------------------------------------------------------------- 登录页 */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(560px, 1.08fr) minmax(520px, .92fr);
  background: var(--bg);
}
.login-brand {
  position: relative;
  overflow: hidden;
  padding: 54px 60px;
  color: #F1F6F3;
  background:
    radial-gradient(900px 520px at 88% 8%, rgba(228, 118, 43, .20), transparent 62%),
    radial-gradient(720px 520px at 6% 92%, rgba(255, 255, 255, .10), transparent 60%),
    linear-gradient(160deg, #116B5A 0%, #0F5C4E 46%, #0A3F35 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-brand::before,
.login-brand::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
  pointer-events: none;
}
.login-brand::before { width: 560px; height: 560px; right: -220px; bottom: -260px; }
.login-brand::after { width: 340px; height: 340px; right: -110px; bottom: -150px; }
.login-brand-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.login-brand-top .brand-mark { background: rgba(251, 249, 244, .14); border: 1px solid rgba(251, 249, 244, .32); }
.login-brand-name { font-size: 19px; font-weight: 650; letter-spacing: .02em; }
.login-brand-name small { display: block; font-size: 11.5px; font-weight: 400; letter-spacing: .12em; color: rgba(241, 246, 243, .62); margin-top: 1px; }
.login-brand-main { position: relative; z-index: 1; max-width: 560px; padding: 36px 0; }
.login-brand-main h1 {
  font-size: 38px;
  line-height: 1.28;
  letter-spacing: -.01em;
  font-weight: 650;
  margin-bottom: 18px;
}
.login-brand-main h1 em { font-style: normal; color: #F6C79B; }
.login-brand-main p { color: rgba(241, 246, 243, .72); font-size: 14px; line-height: 1.8; max-width: 470px; }
.login-points { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.login-points span {
  padding: 5px 11px;
  border: 1px solid rgba(241, 246, 243, .24);
  border-radius: 999px;
  font-size: 12px;
  color: rgba(241, 246, 243, .82);
}
.login-brand-foot { position: relative; z-index: 1; font-size: 11.5px; color: rgba(241, 246, 243, .52); }
.login-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px;
}
.login-card { width: 376px; }
.login-card h2 { font-size: 24px; font-weight: 650; letter-spacing: -.01em; }
.login-card .login-sub { margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.login-form { margin-top: 28px; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > label { font-size: 12px; font-weight: 600; color: #45534F; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #FFFEFB;
  color: var(--text);
  font: inherit;
  padding: 0 10px;
  height: 36px;
  transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; padding: 9px 10px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: #A6AFA9; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 92, 78, .10);
}
.login-error {
  border: 1px solid #EAC3BB;
  background: var(--danger-soft);
  color: #8E3224;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12px;
}
.login-btn { height: 40px; font-size: 13.5px; font-weight: 600; letter-spacing: .04em; }
.login-demo { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; }
.login-demo-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.login-demo-head span { font-size: 12px; font-weight: 600; color: #45534F; }
.login-demo-head small { font-size: 11px; color: var(--muted-2); }
.demo-accounts { display: grid; gap: 6px; }
.demo-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FFFEFB;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.demo-account:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.demo-account .demo-role { font-size: 11.5px; color: var(--brand); font-weight: 600; }
.demo-account .mono { color: var(--muted); font-size: 11.5px; }
.login-foot { margin-top: 22px; font-size: 11.5px; color: var(--muted-2); }

/* ---------------------------------------------------------------- 应用骨架 */
.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  color: #DCE9E4;
  background:
    radial-gradient(420px 260px at 100% 0, rgba(228, 118, 43, .13), transparent 70%),
    linear-gradient(180deg, #0F5C4E 0%, #0C4B40 62%, #0A3F35 100%);
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.side-brand .brand-mark { width: 34px; height: 34px; font-size: 18px; border-radius: 9px; background: rgba(251, 249, 244, .14); border: 1px solid rgba(251, 249, 244, .28); }
.side-brand-name { font-size: 14.5px; font-weight: 650; color: #F4F8F6; letter-spacing: .02em; }
.side-brand-sub { font-size: 10.5px; color: rgba(220, 233, 228, .55); letter-spacing: .14em; margin-top: 1px; }
.side-section { padding: 6px 8px; font-size: 10px; color: rgba(220, 233, 228, .45); letter-spacing: .16em; }
.nav { display: grid; gap: 3px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #C8DBD5;
  font-size: 12.5px;
  line-height: 20px;
  transition: background .12s, color .12s;
}
.nav a svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.nav a:hover { background: rgba(251, 249, 244, .08); color: #F4F8F6; }
.nav a.active { background: rgba(251, 249, 244, .13); color: #FFFFFF; box-shadow: inset 2px 0 0 var(--accent); }
.nav a.active svg { opacity: 1; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(251, 249, 244, .12); }
.side-foot .env { display: flex; align-items: center; gap: 7px; font-size: 11px; color: rgba(220, 233, 228, .64); }
.side-foot .env-dot { width: 6px; height: 6px; border-radius: 50%; background: #7CCB9F; box-shadow: 0 0 0 3px rgba(124, 203, 159, .16); }
.side-foot .version { margin-top: 5px; font-size: 10.5px; color: rgba(220, 233, 228, .38); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 62px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  background: rgba(251, 249, 244, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.topbar-title h1 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.topbar-title .sub { white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.who { display: flex; align-items: center; gap: 8px; padding-left: 14px; border-left: 1px solid var(--line); }
.who-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 650;
}
.who-name { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.who-role { font-size: 10.5px; color: var(--muted); line-height: 1.2; margin-top: 1px; }
.content { width: 100%; max-width: 1600px; padding: 20px 28px 44px; }

/* ---------------------------------------------------------------- 通用 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #FFFEFB;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: #F7F4EC; border-color: #C4BCAB; }
.btn:focus-visible { outline: 2px solid rgba(15, 92, 78, .35); outline-offset: 1px; }
.btn:disabled { opacity: .48; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-danger { background: #FFF8F6; border-color: #E4B7AE; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: #D79E92; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); border-color: transparent; }
.btn-sm { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 0; border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.icon-btn:hover { background: #F1EDE3; color: var(--text); }
.link-btn { border: 0; background: none; color: var(--brand); padding: 0; cursor: pointer; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 0 rgba(31, 42, 40, .02); }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  min-height: 48px;
}
.panel-head h3 { font-size: 13.5px; font-weight: 650; }
.panel-head .sub { margin-top: 1px; }
.panel-body { padding: 14px 16px; }
.panel-body.flush { padding: 0; }
.panel + .panel { margin-top: 14px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.field-inline { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.field-inline .input, .field-inline .select { width: auto; height: 32px; }

.input-sm, .select-sm { height: 30px; font-size: 12px; }
.select { appearance: none; padding-right: 26px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236C7873' stroke-width='1.4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.search-input { width: 232px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
  background: #F1EFE8;
  color: #5E6864;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.pending_dispatch { background: var(--warn-soft); color: #955508; }
.badge.assigned { background: var(--info-soft); color: var(--info); }
.badge.accepted { background: #E8F2F1; color: #1B6A5F; }
.badge.en_route { background: #ECEFF9; color: #3D4E8C; }
.badge.arrived { background: #F2EBF8; color: #6A428F; }
.badge.working { background: #E9F2EA; color: #2F6B3A; }
.badge.completed { background: #FFF3D8; color: #8A5B05; }
.badge.paid { background: var(--ok-soft); color: var(--ok); }
.badge.closed { background: #EDF1EF; color: #4C5B55; }
.badge.cancelled { background: #F1EFEA; color: #8A8378; }
.badge.off { background: #F6EEE9; color: #9B5B3D; }
.badge.on { background: var(--ok-soft); color: var(--ok); }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-settled { background: var(--ok-soft); color: var(--ok); }
.badge-open { background: var(--warn-soft); color: var(--warn); }
.badge-processing { background: var(--info-soft); color: var(--info); }
.badge-resolved { background: var(--ok-soft); color: var(--ok); }
.badge-rejected { background: #F1EFEA; color: #7C7568; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  border-radius: 5px;
  background: #F3F0E8;
  color: #58625E;
  font-size: 10.5px;
  white-space: nowrap;
}
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.chip.accent { background: var(--accent-soft); color: var(--accent-dark); }
.chip-row { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------------------------------------------------------------- 表格 */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
  background: #FAF8F2;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 9px 10px; border-bottom: 1px solid #EFEBE2; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FCFAF5; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: #F7F4EB; }
.table .money { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .right { text-align: right; }
.table th.right { text-align: right; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn + .btn { margin-left: 4px; }
.table tr.is-selected { background: #F5FAF8; }
.table tr.is-settled { color: var(--muted); }
.table tr.is-settled .money { font-weight: 500; }
.table .col-check { width: 34px; }
.checkbox { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; vertical-align: middle; }
.tag-type { font-size: 10.5px; }

.table-note-row td { background: #FCFAF5; color: var(--muted); font-size: 11.5px; padding: 7px 10px; }

/* ---------------------------------------------------------------- 工作台 */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px 12px;
  min-height: 92px;
}
.metric .metric-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.metric .metric-value { margin-top: 5px; font-size: 25px; line-height: 1.2; font-weight: 650; letter-spacing: -.02em; }
.metric .metric-value .unit { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.metric .metric-sub { margin-top: 3px; font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric.warn { border-color: #E8B98E; background: linear-gradient(180deg, #FFF9F2, #FFFDFA); }
.metric.warn .metric-value { color: #A7540F; }
.metric.warn .metric-label .flag { font-size: 10px; color: #A7540F; background: #FBE3C9; border-radius: 999px; padding: 1px 6px; }
.metric .metric-value.money-value { font-size: 22px; }
.metric .metric-value.dash { color: var(--muted-2); font-weight: 500; }

.status-strip { display: flex; align-items: stretch; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; margin-bottom: 14px; }
.status-strip .status-item { flex: 1; padding: 9px 12px; border-right: 1px solid var(--line); min-width: 0; }
.status-strip .status-item:last-child { border-right: 0; }
.status-strip .si-label { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.status-strip .si-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2); flex: none; }
.status-strip .si-count { margin-top: 2px; font-size: 15px; font-weight: 650; }
.status-strip .status-item.zero .si-count { color: var(--muted-2); font-weight: 500; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr); gap: 14px; align-items: start; }
.legend { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; }
.legend .lg-bar { width: 9px; height: 9px; border-radius: 2px; background: var(--brand); opacity: .86; }
.legend .lg-line { width: 14px; height: 2px; background: var(--accent); position: relative; }
.legend .lg-line::after { content: ""; position: absolute; left: 5px; top: -2.5px; width: 7px; height: 7px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); }
.chart-wrap { padding: 8px 12px 4px; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 12px; }
.chart-legend { display: flex; gap: 14px; align-items: center; }

.rank-bar { height: 5px; border-radius: 3px; background: #F0ECE2; overflow: hidden; min-width: 60px; }
.rank-bar span { display: block; height: 100%; border-radius: 3px; background: var(--brand); opacity: .8; }
.rank-cell { display: flex; align-items: center; gap: 10px; }
.rank-cell .rank-bar { flex: 1; }
.rank-index { width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 650; background: #F1EEE6; color: var(--muted); }
.rank-index.top { background: var(--accent-soft); color: var(--accent-dark); }


/* 订单表：固定列宽，地址超长省略 */
.orders-table { table-layout: fixed; }
.orders-table .order-address { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orders-table td .ellipsis { max-width: 100%; }

/* ---------------------------------------------------------------- 筛选 / tabs */
.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 14px; background: var(--card); border-radius: var(--radius) var(--radius) 0 0; }
.tab {
  position: relative;
  border: 0;
  background: none;
  padding: 11px 11px 10px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }
.tab .count { display: inline-block; min-width: 17px; margin-left: 4px; padding: 0 4px; border-radius: 999px; background: #F1EEE6; color: var(--muted); font-size: 10.5px; line-height: 16px; text-align: center; font-weight: 500; }
.tab.active .count { background: var(--brand-soft); color: var(--brand); }

.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-form { display: flex; align-items: center; gap: 8px; }
.orders-panel { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: -1px; }
.orders-head { background: #FFFEFB; }
.table-scroll { max-height: none; }

/* ---------------------------------------------------------------- 订单抽屉 */
.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(24, 32, 30, .34);
  display: flex;
  justify-content: flex-end;
}
.drawer {
  width: 612px;
  max-width: 92vw;
  height: 100%;
  background: var(--bg);
  box-shadow: -18px 0 44px rgba(20, 30, 27, .16);
  display: flex;
  flex-direction: column;
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.drawer-head .eyebrow { font-size: 10.5px; color: var(--muted); letter-spacing: .14em; }
.drawer-head h2 { margin-top: 3px; font-size: 18px; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; }
.drawer-head .sub { margin-top: 4px; }
.drawer-body { padding: 16px 20px 26px; display: grid; gap: 12px; overflow-y: auto; flex: 1; }
.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 11px 20px;
  background: var(--card);
  border-top: 1px solid var(--line);
  flex: none;
}
.drawer-foot .foot-hint { margin-right: auto; font-size: 11px; color: var(--muted); }
.drawer-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.drawer-card-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.drawer-card-head h3 { font-size: 12.5px; font-weight: 650; }
.drawer-card-body { padding: 12px 14px; }
.drawer-section-title { font-size: 11px; color: var(--muted); letter-spacing: .06em; }

.order-amount { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; padding: 14px; }
.order-amount .oa-label { font-size: 10.5px; color: var(--muted); }
.order-amount .oa-value { margin-top: 2px; font-size: 15px; font-weight: 650; }
.order-amount .oa-value.big { font-size: 22px; color: var(--brand); letter-spacing: -.02em; }
.order-amount .oa-value.accent { color: var(--accent-dark); }
.order-amount .oa-value.negative { color: var(--danger); }

.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv.two-col { grid-template-columns: 82px minmax(0, 1fr) 82px minmax(0, 1fr); }
.kv.two-col dd:nth-of-type(2n) { padding-right: 6px; }

.tech-line { display: flex; align-items: center; gap: 10px; }
.tech-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 650; font-size: 13px; flex: none; }
.tech-line-name { font-weight: 600; font-size: 13px; }
.tech-line-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }

.review-summary { display: flex; align-items: center; gap: 8px; }
.review-stars { display: inline-flex; gap: 2px; font-size: 18px; line-height: 1; color: #D8D2C5; }
.review-star.on { color: var(--accent); }
.review-score { font-size: 16px; font-weight: 650; color: var(--text); }
.review-tags { margin-top: 9px; }
.review-comment { margin-top: 9px; font-size: 12.5px; line-height: 1.7; color: #45534F; white-space: pre-wrap; overflow-wrap: anywhere; }

.timeline { list-style: none; padding: 2px 0 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 13px 18px; border-left: 1px solid var(--line); margin-left: 4px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.timeline li:first-child::before { background: var(--brand); }
.timeline .tl-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.timeline .tl-action { font-weight: 600; font-size: 12px; }
.timeline .tl-time { font-size: 10.5px; color: var(--muted-2); font-family: var(--mono); }
.timeline .tl-note { margin-top: 2px; color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.timeline .tl-meta { margin-top: 2px; display: flex; gap: 5px; align-items: center; color: var(--muted-2); font-size: 10.5px; }

.empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 12px; }
.empty .empty-title { font-size: 13px; font-weight: 600; color: #4B5A55; margin-bottom: 3px; }
.empty .empty-sub { font-size: 11.5px; color: var(--muted-2); }
.state-box { padding: 38px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; text-align: center; }
.state-box .state-title { font-size: 13px; font-weight: 600; color: #45534F; }
.state-box .state-sub { max-width: 440px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { border: 1px solid #EAC3BB; background: #FFF9F7; color: #8E3224; border-radius: 8px; padding: 9px 11px; font-size: 12px; }

/* ---------------------------------------------------------------- 师傅 */
.tech-table .name-cell { display: flex; flex-direction: column; gap: 1px; }
.tech-table .name-cell strong { font-size: 12.5px; font-weight: 600; }
.tech-table .level { display: inline-grid; place-items: center; width: 26px; height: 20px; border-radius: 5px; background: var(--brand-soft); color: var(--brand); font-size: 10.5px; font-weight: 650; }
.tech-table .rating { color: #9A6B18; font-weight: 600; white-space: nowrap; }
.tech-table .rating .star { color: var(--accent); margin-right: 2px; }
.tech-table .money.pending { color: var(--accent-dark); }
.tech-table .commission { color: var(--muted); font-size: 11.5px; white-space: nowrap; }

/* ---------------------------------------------------------------- 计价表 */
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.cat-panel { overflow: hidden; }
.cat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 13px 14px 11px; border-bottom: 1px solid var(--line); background: #FFFEFB; }
.cat-title { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.cat-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); font-weight: 650; font-size: 13px; }
.cat-title h3 { font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.cat-title h3 .code { font-family: var(--mono); font-size: 10px; font-weight: 400; color: var(--muted-2); }
.cat-title p { margin-top: 2px; font-size: 11px; color: var(--muted); }
.cat-controls { display: flex; align-items: flex-end; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.mini-field { display: grid; gap: 3px; font-size: 10px; color: var(--muted); }
.mini-field .input { height: 27px; font-size: 12px; padding: 0 7px; }
.money-input { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 6px; background: #FFFEFB; height: 27px; overflow: hidden; }
.money-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 92, 78, .09); }
.money-input i { font-style: normal; color: var(--muted); font-size: 11px; padding-left: 7px; }
.money-input input { width: 62px; border: 0; outline: none; background: transparent; height: 100%; padding: 0 5px 0 2px; font: inherit; font-size: 12px; color: var(--text); }
.warranty-input { width: 40px; }
.items-table { font-size: 12px; }
.items-table th { background: #FCFAF5; }
.items-table td { padding: 7px 10px; }
.items-table .item-name { font-weight: 500; }
.items-table .range { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.items-table .default { font-weight: 600; white-space: nowrap; }
.items-table .actions .btn { height: 22px; padding: 0 6px; font-size: 11px; }
.cat-foot { padding: 6px 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted-2); font-size: 10.5px; }
.pricing-toolbar-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- 结算 */
.settle-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.settle-summary .metric { min-height: 80px; }
.settle-grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 14px; align-items: start; }
.settle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #FFFEFB;
  border-radius: 0 0 var(--radius) var(--radius);
}
.settle-bar .sel-info { font-size: 12px; color: var(--muted); }
.settle-bar .sel-info strong { color: var(--text); }
.settle-note { font-size: 11.5px; color: var(--muted); padding: 8px 14px; background: #FCFAF5; border-top: 1px solid var(--line); }
.selected-cb { accent-color: var(--brand); }


/* 结算明细：列多，压缩内边距并保证师傅名不换行 */
.settle-table th, .settle-table td { padding-left: 8px; padding-right: 8px; }
.settle-table td .badge + .sub { margin-top: 2px; }

/* ---------------------------------------------------------------- 售后 */
.ticket-table .reason-cell { max-width: 280px; }
.ticket-table .reason-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-table .resolution-text { margin-top: 3px; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-table .resolution-text strong { color: var(--brand); font-weight: 600; }
.type-chip { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 5px; font-size: 10.5px; white-space: nowrap; background: #F3F0E8; color: #58625E; }
.type-chip.repair { background: var(--info-soft); color: var(--info); }
.type-chip.complaint { background: var(--warn-soft); color: var(--warn); }
.type-chip.claim { background: var(--danger-soft); color: var(--danger); }
.ticket-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: nowrap; }

/* ---------------------------------------------------------------- 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(24, 32, 30, .42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.modal {
  width: 500px;
  max-width: 96vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(20, 30, 27, .26);
  overflow: hidden;
}
.modal-wide { width: 640px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex: none; }
.modal-head h3 { font-size: 14.5px; font-weight: 650; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 11px 18px; border-top: 1px solid var(--line); background: #FFFEFB; flex: none; }
.modal-note { font-size: 11.5px; color: var(--muted); margin-bottom: 12px; line-height: 1.65; }
.form-grid { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid .field > label, .form-row .field > label { font-size: 11.5px; font-weight: 600; color: #45534F; }
.form-hint { font-size: 11px; color: var(--muted-2); line-height: 1.6; }
.form-summary { display: flex; gap: 18px; padding: 9px 11px; background: #FAF8F2; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; }
.form-summary b { font-variant-numeric: tabular-nums; }
.confirm-text { font-size: 13px; line-height: 1.7; color: #37453F; }
.confirm-detail { margin-top: 9px; padding: 9px 11px; background: #FAF8F2; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; color: var(--muted); }

.cand-list { display: grid; gap: 8px; }
.cand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #FFFEFB;
  cursor: pointer;
  text-align: left;
  transition: border-color .12s, background .12s;
}
.cand:hover { border-color: var(--brand-line); background: #F7FBF9; }
.cand:focus-visible { outline: 2px solid rgba(15, 92, 78, .32); outline-offset: 1px; }
.cand.busy { opacity: .55; pointer-events: none; }
.cand-score {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand);
}
.cand-score.mid { background: var(--warn-soft); color: var(--warn); }
.cand-score.low { background: #F1EFEA; color: var(--muted); }
.cand-main { min-width: 0; flex: 1; }
.cand-name { display: flex; align-items: baseline; gap: 7px; }
.cand-name strong { font-size: 13px; }
.cand-name .sub { font-size: 11px; }
.cand-reasons { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.cand-reasons .chip { height: 17px; font-size: 10px; padding: 0 6px; }
.cand-cur { font-size: 10px; color: var(--accent-dark); background: var(--accent-soft); border-radius: 999px; padding: 1px 6px; }
.cand-cta { flex: none; }

/* ---------------------------------------------------------------- Toast */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 220px;
  max-width: 380px;
  padding: 10px 13px;
  border-radius: 8px;
  background: #1F2A28;
  color: #F6F5EF;
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: 0 10px 28px rgba(20, 30, 27, .24);
  animation: toast-in .16s ease-out;
}
.toast-dot { width: 7px; height: 7px; border-radius: 50%; background: #7CCB9F; margin-top: 5px; flex: none; }
.toast-err .toast-dot { background: #F08A78; }
.toast-err { background: #4A241E; }
.toast.out { opacity: 0; transform: translateY(4px); transition: opacity .18s, transform .18s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D8D2C5; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #C4BCAB; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 窄屏（仍为桌面） */
@media (max-width: 1400px) {
  .content { padding: 18px 22px 38px; }
  .topbar { padding: 0 22px; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .settle-grid { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: minmax(0, 1fr); }
}
