/* ==========================================================================
   admin.css — PC 管理端（1440×900 基准，最小 1280）
   不套手机壳、不加载 base.css / ui.css。所有变量取自 tokens.css。
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body.ad-body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-15);
  line-height: var(--lh-relaxed);
  color: var(--c-text-1);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
em, i { font-style: normal; }
::selection { background: var(--c-brand-ring); }
:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 2px; }
.num, .ad-num, [data-num] {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-style: normal;
}
.row { display: flex; align-items: center; }
.row--between { justify-content: space-between; }
.gap2 { gap: var(--sp-2); } .gap4 { gap: var(--sp-4); } .gap6 { gap: var(--sp-6); }
.gap8 { gap: var(--sp-8); } .gap12 { gap: var(--sp-12); }
.grow { flex: 1 1 auto; min-width: 0; }
.ad-muted { color: var(--c-text-2); font-size: var(--fs-13); line-height: var(--lh-body); }

/* ================= 外壳 ================= */
.ad-shell { min-height: 100%; }
.ad-side {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: var(--z-sticky);
  width: var(--w-admin-side);
  display: flex; flex-direction: column;
  background: var(--c-card);
  border-right: 1px solid var(--c-line);
}
.ad-brand {
  height: var(--w-admin-top);
  display: flex; align-items: center; gap: var(--sp-5);
  padding: 0 var(--sp-6);
  border-bottom: 1px solid var(--c-line);
  flex: 0 0 auto;
}
.ad-brand__mark {
  width: 32px; height: 32px; border-radius: var(--r-md); flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--c-brand); color: var(--c-on-brand);
  box-shadow: var(--sh-brand);
}
.ad-brand__copy { display: flex; flex-direction: column; min-width: 0; }
.ad-brand__name { font-size: var(--fs-16); font-weight: var(--fw-s); letter-spacing: -.01em; white-space: nowrap; }
.ad-brand__sub { font-size: var(--fs-10); color: var(--c-text-2); white-space: nowrap; }
.ad-nav { padding: var(--sp-4) var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-1); overflow-y: auto; }
.ad-nav__item {
  position: relative; display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; height: 42px; padding: 0 var(--sp-3);
  border-radius: var(--r-md); color: var(--c-text-2); text-align: left;
  font-size: var(--fs-13);
  transition: color var(--t-fast), background-color var(--t-fast), box-shadow var(--t-fast);
}
.ad-nav__item:hover { background: var(--ad-hover); color: var(--c-text-1); }
.ad-nav__item.is-active { background: var(--c-brand-soft); color: var(--c-brand-ink); font-weight: var(--fw-m); }
.ad-nav__item.is-active::before {
  content: ""; position: absolute; left: 0; top: var(--sp-3); bottom: var(--sp-3);
  width: 3px; border-radius: var(--r-pill); background: var(--c-brand);
}
.ad-nav__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-side__foot {
  margin-top: auto; padding: var(--sp-5) var(--sp-6);
  border-top: 1px solid var(--c-line);
  display: flex; flex-direction: column; gap: 2px;
}
.ad-side__store { font-size: var(--fs-11); color: var(--c-text-1); font-weight: var(--fw-m); white-space: nowrap; }
.ad-side__meta { font-size: var(--fs-10); color: var(--c-text-2); white-space: nowrap; }

.ad-content {
  margin-left: var(--w-admin-side);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.ad-top {
  position: sticky; top: 0; z-index: var(--z-sticky);
  height: var(--w-admin-top); flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-6);
  padding: 0 var(--sp-8);
  background: var(--c-glass);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-line);
}
.ad-crumb { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-12); color: var(--c-text-2); white-space: nowrap; }
.ad-crumb i { color: var(--c-text-3); }
.ad-crumb b { color: var(--c-text-1); font-weight: var(--fw-m); }
.ad-top__tools { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.ad-search {
  display: flex; align-items: center; gap: var(--sp-2);
  height: 36px; width: 300px; padding: 0 var(--sp-2) 0 var(--sp-4);
  background: var(--c-fill); border: 1px solid transparent; border-radius: var(--r-pill);
  transition: background-color var(--t-fast), box-shadow var(--t-fast);
}
.ad-search:focus-within { background: var(--c-card); border-color: var(--c-brand); box-shadow: var(--sh-focus); }
.ad-search__icon { color: var(--c-text-2); display: flex; flex: 0 0 auto; }
.ad-search__input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: var(--fs-12); }
.ad-search__input::placeholder { color: var(--c-text-2); }
.ad-search__btn {
  flex: 0 0 auto; height: 26px; padding: 0 var(--sp-4); border-radius: var(--r-pill);
  background: var(--c-brand); color: var(--c-on-brand); font-size: var(--fs-11); font-weight: var(--fw-m);
}
.ad-icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: var(--r-pill);
  display: grid; place-items: center; color: var(--c-text-2);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.ad-icon-btn:hover { background: var(--c-fill); color: var(--c-text-1); }
.ad-badge {
  position: absolute; top: 4px; right: 3px; min-width: 16px; height: 16px; padding: 0 var(--sp-1);
  border-radius: var(--r-pill); background: var(--c-danger); color: var(--c-on-brand);
  font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal;
  font-size: var(--fs-9); line-height: 16px; text-align: center; font-weight: var(--fw-m);
}
.ad-user { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-1); border-radius: var(--r-pill); transition: background-color var(--t-fast); }
.ad-user:hover { background: var(--c-fill); }
.ad-user__av {
  width: 32px; height: 32px; border-radius: var(--r-pill);
  background: var(--c-brand); color: var(--c-on-brand);
  display: grid; place-items: center; font-size: var(--fs-13); font-weight: var(--fw-s);
}
.ad-user__copy { display: flex; flex-direction: column; align-items: flex-start; line-height: var(--lh-tight); }
.ad-user__copy b { font-size: var(--fs-12); font-weight: var(--fw-m); }
.ad-user__copy small { font-size: var(--fs-10); color: var(--c-text-2); margin-top: 2px; }
.ad-user__chev { color: var(--c-text-3); }
.ad-main { height: calc(100vh - var(--w-admin-top)); overflow-y: auto; overflow-x: hidden; }
.ad-page { max-width: 1220px; margin: 0 auto; padding: var(--sp-8) var(--sp-8) var(--sp-12); min-width: 0; }

/* ================= 页面头 ================= */
.ad-pagehead {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-6);
  margin-bottom: var(--sp-6);
}
.ad-pagehead__copy { min-width: 0; }
.ad-eyebrow { font-size: var(--fs-10); font-weight: var(--fw-s); letter-spacing: .14em; color: var(--c-text-2); text-transform: uppercase; }
.ad-pagehead__title { font-size: var(--fs-26); font-weight: var(--fw-s); letter-spacing: -.02em; line-height: var(--lh-tight); margin-top: var(--sp-2); }
.ad-pagehead__desc { font-size: var(--fs-13); color: var(--c-text-2); line-height: var(--lh-body); margin-top: var(--sp-2); max-width: 780px; }
.ad-pagehead__actions { display: flex; align-items: center; gap: var(--sp-2); flex: 0 0 auto; }

/* ================= 按钮 ================= */
.ad-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: 36px; padding: 0 var(--sp-4); border-radius: var(--r-pill);
  font-size: var(--fs-12); font-weight: var(--fw-m);
  transition: transform var(--t-fast), opacity var(--t-fast), background-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
}
.ad-btn:active { transform: scale(.97); opacity: .9; }
.ad-btn--primary { background: var(--c-brand); color: var(--c-on-brand); box-shadow: var(--sh-brand); }
.ad-btn--primary:hover { background: var(--c-brand-strong); }
.ad-btn--plain { background: var(--c-card); color: var(--c-text-1); border: 1px solid var(--c-line-2); }
.ad-btn--plain:hover { background: var(--c-fill); }
.ad-btn--ghost { background: var(--c-brand-soft); color: var(--c-brand-ink); }
.ad-btn--danger { background: var(--c-danger-soft); color: var(--c-danger-ink); }
.ad-btn--sm { height: 30px; padding: 0 var(--sp-3); font-size: var(--fs-11); }
.ad-btn:disabled { opacity: .4; pointer-events: none; }

/* 下拉 / 输入 */
.ad-input {
  height: 38px; width: 100%; padding: 0 var(--sp-3);
  border-radius: var(--r-md); background: var(--c-fill); border: 1px solid transparent;
  font-size: var(--fs-13); transition: background-color var(--t-fast), box-shadow var(--t-fast);
}
.ad-input:focus { background: var(--c-card); border-color: var(--c-brand); box-shadow: var(--sh-focus); }
.ad-input--num { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; }
.ad-input--sm { height: 32px; font-size: var(--fs-12); }
.ad-label { display: flex; flex-direction: column; gap: var(--sp-2); font-size: var(--fs-12); color: var(--c-text-2); }
.ad-label > span { font-weight: var(--fw-m); color: var(--c-text-1); }

/* ================= 卡片 / 指标 ================= */
.ad-card {
  background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--r-lg); padding: var(--sp-6);
  min-width: 0;
}
.ad-card + .ad-card { margin-top: var(--sp-4); }
.ad-card--flush { padding: 0; overflow: hidden; }
.ad-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.ad-card__title { font-size: var(--fs-15); font-weight: var(--fw-s); letter-spacing: -.01em; }
.ad-card__sub { font-size: var(--fs-11); color: var(--c-text-2); margin-top: 2px; }
.ad-link { font-size: var(--fs-11); color: var(--c-brand-ink); font-weight: var(--fw-m); display: inline-flex; align-items: center; gap: var(--sp-1); }
.ad-link:hover { text-decoration: underline; }
.ad-grid { display: grid; gap: var(--sp-4); }
.ad-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ad-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ad-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ad-grid--dash { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
.ad-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-6); }
.ad-kpi {
  background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--r-lg);
  padding: var(--sp-5); min-width: 0;
}
.ad-kpi__label { font-size: var(--fs-11); color: var(--c-text-2); display: flex; align-items: center; gap: var(--sp-1); }
.ad-kpi__value {
  display: block; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal;
  font-size: var(--fs-26); line-height: var(--lh-tight); font-weight: var(--fw-s); letter-spacing: -.02em;
  margin-top: var(--sp-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ad-kpi__meta { display: flex; gap: var(--sp-2); align-items: center; font-size: var(--fs-10); color: var(--c-text-2); margin-top: var(--sp-2); }
.ad-delta { display: inline-flex; padding: 1px var(--sp-2); border-radius: var(--r-sm); background: var(--c-success-soft); color: var(--c-success-ink); font-size: var(--fs-9); font-weight: var(--fw-m); }
.ad-delta--down { background: var(--c-danger-soft); color: var(--c-danger-ink); }

/* 标签 / 状态 */
.ad-tag {
  display: inline-flex; align-items: center; gap: 3px; min-height: 22px; padding: 0 var(--sp-2);
  border-radius: var(--r-sm); background: var(--c-fill); color: var(--c-text-2);
  font-size: var(--fs-10); line-height: var(--lh-snug); white-space: nowrap;
}
.ad-tag--brand { background: var(--c-brand-soft); color: var(--c-brand-ink); }
.ad-tag--success { background: var(--c-success-soft); color: var(--c-success-ink); }
.ad-tag--warn { background: var(--c-warn-soft); color: var(--c-warn-ink); }
.ad-tag--danger { background: var(--c-danger-soft); color: var(--c-danger-ink); }
.ad-tag--info { background: var(--c-info-soft); color: var(--c-info-ink); }
.ad-tag--neutral { background: var(--c-fill); color: var(--c-text-2); }
.ad-tag-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.ad-money { color: var(--c-amount); font-weight: var(--fw-s); }

/* ================= 图表（纯 DOM/CSS） ================= */
.ad-chart { height: 232px; display: flex; align-items: stretch; gap: var(--sp-3); padding-top: var(--sp-6); }
.ad-chart__col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
.ad-chart__val { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; font-size: var(--fs-10); color: var(--c-text-2); white-space: nowrap; }
.ad-chart__track {
  flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center;
  border-bottom: 1px solid var(--c-line); min-height: 140px;
  background-image: linear-gradient(var(--c-chart-grid) 1px, transparent 1px);
  background-size: 100% 25%;
}
.ad-chart__bar {
  width: min(32px, 58%); min-height: 4px; border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--c-chart-1); transition: box-shadow var(--t-fast);
}
.ad-chart__bar--soft { background: var(--c-chart-2); }
.ad-chart__bar:hover { box-shadow: var(--sh-2); }
.ad-chart__label { font-size: var(--fs-10); color: var(--c-text-2); white-space: nowrap; }
.ad-chart__label--now { color: var(--c-brand-ink); font-weight: var(--fw-m); }
.ad-chart__legend { display: flex; gap: var(--sp-4); font-size: var(--fs-10); color: var(--c-text-2); }
.ad-chart__legend i { width: 8px; height: 8px; border-radius: var(--r-sm); background: var(--c-chart-1); display: inline-block; margin-right: var(--sp-1); }
.ad-chart__legend i.soft { background: var(--c-chart-2); }
.ad-chart-foot { display: flex; justify-content: space-between; font-size: var(--fs-10); color: var(--c-text-2); margin-top: var(--sp-3); }
.ad-line-chart { position: relative; height: 92px; margin-top: var(--sp-4); }
.ad-line-chart svg { width: 100%; height: 100%; overflow: visible; }
.ad-line-chart .grid { stroke: var(--c-chart-grid); stroke-width: 1; }
.ad-line-chart .line { fill: none; stroke: var(--c-brand); stroke-width: 2; }
.ad-line-chart .dot { fill: var(--c-card); stroke: var(--c-brand); stroke-width: 2; }

/* 环形图 */
.ad-donut {
  width: 148px; height: 148px; border-radius: var(--r-full); flex: 0 0 auto;
  background: conic-gradient(var(--c-chart-1) 0 62%, var(--c-chart-2) 62% 100%);
  display: grid; place-items: center; position: relative;
}
.ad-donut::before { content: ""; position: absolute; inset: 22px; background: var(--c-card); border-radius: var(--r-full); }
.ad-donut__center { position: relative; z-index: 1; text-align: center; }
.ad-donut__center b { display: block; font-size: var(--fs-20); font-weight: var(--fw-s); font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; }
.ad-donut__center span { font-size: var(--fs-10); color: var(--c-text-2); }
.ad-donut-wrap { display: flex; align-items: center; gap: var(--sp-8); }
.ad-donut-legend { display: flex; flex-direction: column; gap: var(--sp-3); font-size: var(--fs-12); }
.ad-donut-legend span { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-6); }
.ad-donut-legend i { display: inline-block; width: 8px; height: 8px; border-radius: var(--r-sm); background: var(--c-chart-1); margin-right: var(--sp-2); }
.ad-donut-legend i.soft { background: var(--c-chart-2); }
.ad-donut-legend .num { font-weight: var(--fw-s); color: var(--c-text-1); font-size: var(--fs-12); }

/* ================= 表格 ================= */
.ad-filterbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  flex-wrap: wrap; margin-bottom: var(--sp-4);
}
.ad-tabs { display: flex; gap: var(--sp-1); padding: 3px; border-radius: var(--r-pill); background: var(--c-card); border: 1px solid var(--c-line); }
.ad-tab {
  height: 30px; padding: 0 var(--sp-3); border-radius: var(--r-pill); font-size: var(--fs-11); color: var(--c-text-2);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.ad-tab:hover { background: var(--c-fill); }
.ad-tab.is-on { background: var(--c-text-1); color: var(--c-on-brand); font-weight: var(--fw-m); }
.ad-search-mini {
  display: flex; align-items: center; gap: var(--sp-2); height: 36px; width: 260px;
  padding: 0 var(--sp-3); border-radius: var(--r-md); background: var(--c-card); border: 1px solid var(--c-line);
}
.ad-search-mini input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: var(--fs-12); }
.ad-search-mini svg { color: var(--c-text-2); }
.ad-bulkbar {
  display: flex; align-items: center; gap: var(--sp-3); min-height: 38px; padding: 0 var(--sp-4);
  border-radius: var(--r-md); background: var(--c-brand-soft); color: var(--c-brand-ink);
  font-size: var(--fs-12); margin-bottom: var(--sp-3);
}
.ad-bulkbar b { font-weight: var(--fw-s); }
.ad-table-wrap { width: 100%; overflow-x: auto; border-radius: var(--r-lg); background: var(--c-card); border: 1px solid var(--c-line); }
.ad-table { width: 100%; border-collapse: collapse; min-width: 840px; }
.ad-table th {
  height: 40px; padding: 0 var(--sp-4); background: var(--c-bg);
  font-size: var(--fs-10); color: var(--c-text-2); font-weight: var(--fw-m); text-align: left;
  border-bottom: 1px solid var(--c-line); white-space: nowrap;
}
.ad-table td {
  height: var(--ad-row-h); padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-12); border-bottom: 1px solid var(--c-line); vertical-align: middle;
}
.ad-table tr:last-child td { border-bottom: 0; }
.ad-table tbody tr { transition: background-color var(--t-fast); }
.ad-table tbody tr:hover { background: var(--ad-hover); }
.ad-table tr.is-low { background: var(--c-danger-soft); }
.ad-table tr.is-low:hover { background: var(--c-danger-soft); }
.ad-table tr.is-selected { background: var(--c-brand-soft); }
.ad-table .ad-nowrap { white-space: nowrap; }
.ad-table .ad-cell-main { display: block; color: var(--c-text-1); font-weight: var(--fw-m); }
.ad-table .ad-cell-sub { display: block; color: var(--c-text-2); font-size: var(--fs-10); line-height: var(--lh-snug); }
.ad-table .ad-actions { display: flex; gap: var(--sp-1); justify-content: flex-end; white-space: nowrap; }
.ad-table .ad-btn { height: 28px; padding: 0 var(--sp-3); font-size: var(--fs-10); }
.ad-check {
  width: 18px; height: 18px; border-radius: var(--r-sm); border: 1.5px solid var(--c-line-2);
  background: var(--c-card); display: inline-grid; place-items: center; color: transparent;
  transition: background-color var(--t-fast), color var(--t-fast);
  vertical-align: middle;
}
.ad-check.is-on { background: var(--c-brand); border-color: var(--c-brand); color: var(--c-on-brand); }
.ad-empty {
  padding: var(--sp-16) var(--sp-6); text-align: center; background: var(--c-card);
  border-radius: var(--r-lg); border: 1px solid var(--c-line);
}
.ad-empty__art { width: 56px; height: 56px; border-radius: var(--r-full); background: var(--c-fill); color: var(--c-text-3); display: inline-grid; place-items: center; margin-bottom: var(--sp-4); }
.ad-empty__title { font-size: var(--fs-15); font-weight: var(--fw-m); }
.ad-empty__desc { font-size: var(--fs-12); color: var(--c-text-2); margin-top: var(--sp-1); }
.ad-pagination { display: flex; align-items: center; justify-content: space-between; margin-top: var(--sp-4); font-size: var(--fs-11); color: var(--c-text-2); }
.ad-pagination__pages { display: flex; gap: var(--sp-1); }
.ad-pagination__pages button { width: 30px; height: 30px; border-radius: var(--r-sm); font-size: var(--fs-11); color: var(--c-text-2); }
.ad-pagination__pages button.is-on { background: var(--c-brand-soft); color: var(--c-brand-ink); font-weight: var(--fw-m); }

/* ================= 概览 ================= */
.ad-overview-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); gap: var(--sp-4); align-items: start; margin-bottom: var(--sp-4); }
.ad-todo-list { display: flex; flex-direction: column; }
.ad-todo {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; text-align: left;
  padding: var(--sp-3) 0; border-bottom: 1px solid var(--c-line);
}
.ad-todo:last-child { border-bottom: 0; }
.ad-todo:hover .ad-todo__title { color: var(--c-brand-ink); }
.ad-todo__icon { width: 34px; height: 34px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--c-brand-soft); color: var(--c-brand-ink); flex: 0 0 auto; }
.ad-todo__title { display: block; font-size: var(--fs-12); font-weight: var(--fw-m); }
.ad-todo__meta { display: block; font-size: var(--fs-10); color: var(--c-text-2); }
.ad-todo__num { flex: 0 0 auto; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; font-size: var(--fs-20); font-weight: var(--fw-s); color: var(--c-text-1); }
.ad-bays { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.ad-bay {
  display: flex; flex-direction: column; gap: 2px; min-height: 86px; padding: var(--sp-3);
  border-radius: var(--r-md); background: var(--c-fill); border: 1px solid transparent; text-align: left;
  transition: background-color var(--t-fast);
}
.ad-bay:hover { border-color: var(--c-brand-weak); background: var(--c-card); }
.ad-bay--busy { background: var(--c-brand-soft); }
.ad-bay__no { font-size: var(--fs-10); color: var(--c-text-2); }
.ad-bay__plate { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; font-size: var(--fs-12); font-weight: var(--fw-s); white-space: nowrap; }
.ad-bay__status { font-size: var(--fs-10); color: var(--c-text-2); }
.ad-quick-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.ad-quick {
  display: inline-flex; align-items: center; gap: var(--sp-2); height: 34px; padding: 0 var(--sp-4);
  border-radius: var(--r-pill); background: var(--c-card); border: 1px solid var(--c-line);
  font-size: var(--fs-11); color: var(--c-text-2);
}
.ad-quick:hover { border-color: var(--c-brand-weak); color: var(--c-brand-ink); }

/* ================= 工单 ================= */
.ad-wo-plate { display: flex; flex-direction: column; gap: 1px; }
.ad-wo-plate b { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; font-size: var(--fs-12); font-weight: var(--fw-s); }
.ad-wo-plate small { font-size: var(--fs-10); color: var(--c-text-2); }
.ad-version-badge { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; font-size: var(--fs-11); }

/* ================= 定价 / 配件 ================= */
.ad-split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: var(--sp-4); align-items: start; }
.ad-list { display: flex; flex-direction: column; }
.ad-list-item { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-4) 0; border-bottom: 1px solid var(--c-line); }
.ad-list-item:last-child { border-bottom: 0; }
.ad-list-item__main { flex: 1; min-width: 0; }
.ad-list-item__title { display: block; font-size: var(--fs-13); font-weight: var(--fw-m); }
.ad-list-item__meta { display: block; font-size: var(--fs-10); color: var(--c-text-2); }
.ad-price-input { width: 92px; text-align: right; }
.ad-inline { display: inline-flex; align-items: center; gap: var(--sp-2); justify-content: flex-end; }
.ad-audit { display: flex; flex-direction: column; gap: var(--sp-3); max-height: 270px; overflow-y: auto; }
.ad-audit__item { display: flex; gap: var(--sp-3); font-size: var(--fs-11); color: var(--c-text-2); }
.ad-audit__dot { width: 6px; height: 6px; border-radius: var(--r-full); background: var(--c-brand); margin-top: 7px; flex: 0 0 auto; }
.ad-audit__time { display: block; font-size: var(--fs-10); color: var(--c-text-2); margin-top: 1px; }
.ad-package { padding: var(--sp-5); }
.ad-package + .ad-package { margin-top: var(--sp-3); }
.ad-package__name { font-size: var(--fs-14); font-weight: var(--fw-s); }
.ad-package__items { font-size: var(--fs-10); color: var(--c-text-2); line-height: var(--lh-body); margin-top: var(--sp-1); }
.ad-package__price { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; font-size: var(--fs-20); font-weight: var(--fw-s); color: var(--c-amount); }
.ad-stock { display: inline-flex; align-items: center; gap: var(--sp-2); }
.ad-stock__bar { width: 54px; height: 5px; border-radius: var(--r-pill); background: var(--c-line); overflow: hidden; }
.ad-stock__fill { height: 100%; background: var(--c-success); }
.ad-stock__fill.is-low { background: var(--c-danger); }
.ad-stock__text { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; font-size: var(--fs-11); }
.ad-stock-log { display: flex; flex-direction: column; }
.ad-stock-log__item { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--c-line); font-size: var(--fs-11); }
.ad-stock-log__item:last-child { border-bottom: 0; }

/* ================= 客户 ================= */
.ad-customer-name { display: flex; align-items: center; gap: var(--sp-2); }
.ad-avatar-mini {
  width: 28px; height: 28px; border-radius: var(--r-pill); background: var(--c-brand-soft);
  color: var(--c-brand-ink); display: grid; place-items: center; font-size: var(--fs-10); font-weight: var(--fw-s);
  flex: 0 0 auto;
}
.ad-vehicle-mini { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-3); border-radius: var(--r-md); background: var(--c-fill); }
.ad-vehicle-mini + .ad-vehicle-mini { margin-top: var(--sp-2); }
.ad-vehicle-mini__plate { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; font-size: var(--fs-12); font-weight: var(--fw-s); }
.ad-vehicle-mini__meta { font-size: var(--fs-10); color: var(--c-text-2); }

/* ================= 排班 ================= */
.ad-schedule-wrap { overflow-x: auto; border: 1px solid var(--c-line); border-radius: var(--r-lg); background: var(--c-card); }
.ad-schedule { min-width: 1040px; width: 100%; border-collapse: collapse; }
.ad-schedule th {
  height: 46px; padding: var(--sp-2); border-bottom: 1px solid var(--c-line); background: var(--c-bg);
  font-size: var(--fs-10); color: var(--c-text-2); font-weight: var(--fw-m); text-align: center;
}
.ad-schedule th:first-child { width: 160px; text-align: left; padding-left: var(--sp-4); }
.ad-schedule td { padding: var(--sp-2); border-bottom: 1px solid var(--c-line); border-left: 1px solid var(--c-line); text-align: center; }
.ad-schedule tr:last-child td { border-bottom: 0; }
.ad-schedule .ad-tech-cell { text-align: left; padding-left: var(--sp-4); border-left: 0; }
.ad-tech-name { display: flex; align-items: center; gap: var(--sp-2); }
.ad-tech-name b { font-size: var(--fs-12); }
.ad-tech-name small { font-size: var(--fs-10); color: var(--c-text-2); }
.ad-shift {
  display: flex; flex-direction: column; align-items: center; gap: 1px; width: 100%;
  padding: var(--sp-1); border-radius: var(--r-sm); font-size: var(--fs-9); color: var(--c-text-2);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.ad-shift b { font-size: var(--fs-10); font-weight: var(--fw-m); }
.ad-shift--work { background: var(--c-success-soft); color: var(--c-success-ink); }
.ad-shift--leave { background: var(--c-warn-soft); color: var(--c-warn-ink); }
.ad-shift--off { background: var(--c-fill); color: var(--c-text-2); }
.ad-shift:hover { box-shadow: var(--sh-1); }
.ad-schedule-legend { display: flex; gap: var(--sp-4); flex-wrap: wrap; font-size: var(--fs-10); color: var(--c-text-2); margin-top: var(--sp-3); }
.ad-schedule-legend i { display: inline-block; width: 8px; height: 8px; border-radius: var(--r-sm); margin-right: var(--sp-1); }
.ad-schedule-legend .work { background: var(--c-success); }
.ad-schedule-legend .leave { background: var(--c-warn); }
.ad-schedule-legend .off { background: var(--c-line-2); }
.ad-schedule-pick { display: flex; flex-direction: column; gap: var(--sp-1); }
.ad-schedule-pick__item {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; text-align: left;
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--c-fill);
  transition: background-color var(--t-fast);
}
.ad-schedule-pick__item.is-on { background: var(--c-brand-soft); }
.ad-schedule-pick__item b { display: block; font-size: var(--fs-12); font-weight: var(--fw-m); }
.ad-schedule-pick__item small { display: block; font-size: var(--fs-10); color: var(--c-text-2); }
.ad-conflict { display: none; margin-top: var(--sp-3); padding: var(--sp-3); border-radius: var(--r-md); background: var(--c-danger-soft); color: var(--c-danger-ink); font-size: var(--fs-11); line-height: var(--lh-body); }
.ad-conflict.is-on { display: flex; flex-direction: column; gap: 2px; }
.ad-conflict b { font-weight: var(--fw-s); }

/* ================= 报表 ================= */
.ad-range { display: flex; gap: var(--sp-1); background: var(--c-fill); border-radius: var(--r-pill); padding: 3px; }
.ad-range button { height: 28px; padding: 0 var(--sp-3); border-radius: var(--r-pill); font-size: var(--fs-11); color: var(--c-text-2); }
.ad-range button.is-on { background: var(--c-card); color: var(--c-text-1); font-weight: var(--fw-m); box-shadow: var(--sh-1); }
.ad-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.ad-bar-row { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-3); font-size: var(--fs-11); }
.ad-bar-row__label { width: 112px; flex: 0 0 auto; color: var(--c-text-2); }
.ad-bar-row__track { flex: 1; height: 8px; border-radius: var(--r-pill); background: var(--c-fill); overflow: hidden; }
.ad-bar-row__fill { height: 100%; border-radius: var(--r-pill); background: var(--c-chart-1); }
.ad-bar-row__val { width: 90px; flex: 0 0 auto; text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; font-size: var(--fs-10); color: var(--c-text-1); }
.ad-rework { display: flex; align-items: center; gap: var(--sp-6); }
.ad-rework__num { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; font-size: var(--fs-32); color: var(--c-text-1); font-weight: var(--fw-s); line-height: 1; }
.ad-rework__meta { font-size: var(--fs-11); color: var(--c-text-2); line-height: var(--lh-body); }

/* ================= 设置 ================= */
.ad-settings-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--sp-4); align-items: start; }
.ad-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.ad-form-grid .ad-label--full { grid-column: 1 / -1; }
.ad-setting-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) 0; border-bottom: 1px solid var(--c-line); }
.ad-setting-row:last-child { border-bottom: 0; }
.ad-toggle {
  position: relative; width: 44px; height: 26px; border-radius: var(--r-pill); background: var(--c-line-2);
  padding: 2px; transition: background-color var(--t-base) var(--ease-out); flex: 0 0 auto;
}
.ad-toggle__knob { display: block; width: 22px; height: 22px; border-radius: var(--r-full); background: var(--c-card); box-shadow: var(--sh-1); transition: transform var(--t-base) var(--ease-out); }
.ad-toggle.is-on { background: var(--c-success); }
.ad-toggle.is-on .ad-toggle__knob { transform: translateX(18px); }
.ad-role-table td { font-size: var(--fs-11); }
.ad-settings-note { font-size: var(--fs-10); color: var(--c-text-2); line-height: var(--lh-body); margin-top: var(--sp-3); }

/* ================= 抽屉 / 对话框 ================= */
.ad-overlay { position: fixed; inset: 0; z-index: var(--z-overlay); pointer-events: none; }
.ad-overlay.is-open { pointer-events: auto; }
.ad-mask {
  position: absolute; inset: 0; background: var(--c-mask);
  opacity: 0; transition: opacity var(--t-base) var(--ease-out);
}
.ad-overlay.is-open .ad-mask { opacity: 1; }
.ad-drawer {
  position: absolute; right: 0; top: 0; bottom: 0; width: var(--w-drawer);
  max-width: 92vw; background: var(--c-card); display: flex; flex-direction: column;
  transform: translateX(102%); transition: transform var(--t-slow) var(--ease-out);
  box-shadow: var(--sh-3);
}
.ad-overlay.is-open .ad-drawer { transform: none; }
.ad-drawer__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-6) var(--sp-6) var(--sp-4); border-bottom: 1px solid var(--c-line); flex: 0 0 auto;
}
.ad-drawer__eyebrow { font-size: var(--fs-10); color: var(--c-text-2); font-weight: var(--fw-m); letter-spacing: .06em; }
.ad-drawer__title { font-size: var(--fs-20); font-weight: var(--fw-s); letter-spacing: -.01em; margin-top: var(--sp-1); font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; }
.ad-drawer__body { flex: 1; overflow-y: auto; padding: var(--sp-5) var(--sp-6); }
.ad-drawer__foot {
  display: flex; justify-content: flex-end; gap: var(--sp-2); flex: 0 0 auto;
  padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--c-line); background: var(--c-glass);
}
.ad-drawer-summary { padding-bottom: var(--sp-4); border-bottom: 1px solid var(--c-line); }
.ad-plate {
  display: inline-flex; align-items: center; padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-sm); background: var(--c-plate-bg); color: var(--c-on-brand);
  font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal;
  font-size: var(--fs-14); font-weight: var(--fw-m);
}
.ad-drawer-summary__car { font-size: var(--fs-15); font-weight: var(--fw-s); margin-top: var(--sp-3); }
.ad-drawer-summary__owner { font-size: var(--fs-11); color: var(--c-text-2); }
.ad-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); margin-top: var(--sp-4); }
.ad-kpis > div { background: var(--c-fill); border-radius: var(--r-md); padding: var(--sp-3); }
.ad-kpi__label { display: block; font-size: var(--fs-10); color: var(--c-text-2); }
.ad-kpi__value { display: block; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; font-size: var(--fs-14); font-weight: var(--fw-s); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-drawer-sec { padding: var(--sp-5) 0; border-bottom: 1px solid var(--c-line); }
.ad-drawer-sec:last-child { border-bottom: 0; }
.ad-drawer-sec h3 { font-size: var(--fs-12); font-weight: var(--fw-s); margin-bottom: var(--sp-3); letter-spacing: .02em; color: var(--c-text-1); }
.ad-kv { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-1) 0; font-size: var(--fs-11); color: var(--c-text-2); }
.ad-kv b, .ad-kv .num { color: var(--c-text-1); font-weight: var(--fw-m); text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; }
.ad-kv--tight { padding: 2px 0; }
.ad-stages { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); margin-top: var(--sp-3); }
.ad-stage { background: var(--c-fill); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); }
.ad-stage__name { display: block; font-size: var(--fs-11); font-weight: var(--fw-m); }
.ad-stage__time { display: block; font-size: var(--fs-9); color: var(--c-text-2); }
.ad-version-line { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) 0; border-bottom: 1px solid var(--c-line); }
.ad-version-line:last-child { border-bottom: 0; }
.ad-version-line__v { flex: 0 0 28px; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; font-size: var(--fs-11); font-weight: var(--fw-s); }
.ad-version-line__s { flex: 0 0 auto; }
.ad-version-line__amt { margin-left: auto; font-size: var(--fs-11); }
.ad-drawer-group { padding: var(--sp-2) 0; }
.ad-drawer-group__title { display: flex; gap: var(--sp-2); font-size: var(--fs-11); font-weight: var(--fw-m); color: var(--c-text-2); margin-top: var(--sp-2); }
.ad-qc-round { background: var(--c-fill); border-radius: var(--r-md); padding: var(--sp-3); margin-bottom: var(--sp-2); }
.ad-qc-round__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-11); margin-bottom: 2px; }
.ad-photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); }
.ad-photo {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: var(--r-md); min-height: 84px; overflow: hidden; color: var(--c-text-2);
  background: linear-gradient(140deg, var(--c-tone-slate), var(--c-tone-steel)); text-align: left;
}
.ad-photo--sm { min-height: 64px; }
.ad-photo__motif { color: var(--c-on-image-dim); }
.ad-photo__note { font-size: var(--fs-9); color: var(--c-text-1); padding: 1px var(--sp-2); background: var(--c-glass-2); border-radius: var(--r-sm); max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-photo-full { min-height: 280px; border-radius: var(--r-lg); display: grid; place-items: center; color: var(--c-on-image-dim); margin-bottom: var(--sp-4); background: linear-gradient(140deg, var(--c-tone-slate), var(--c-tone-night)); }
.ad-tone--slate { background: linear-gradient(140deg, var(--c-tone-slate), var(--c-tone-steel)); }
.ad-tone--warm { background: linear-gradient(140deg, var(--c-tone-warm), var(--c-tone-olive)); }
.ad-tone--cool { background: linear-gradient(140deg, var(--c-tone-cool), var(--c-tone-slate)); }
.ad-tone--olive { background: linear-gradient(140deg, var(--c-tone-olive), var(--c-tone-steel)); }
.ad-tone--steel { background: linear-gradient(140deg, var(--c-tone-steel), var(--c-tone-night)); }
.ad-tone--plum { background: linear-gradient(140deg, var(--c-tone-plum), var(--c-tone-warm)); }
.ad-tone--night { background: linear-gradient(140deg, var(--c-tone-night), var(--c-text-1)); }
.ad-empty-line { font-size: var(--fs-11); color: var(--c-text-2); padding: var(--sp-2) 0; }
.ad-notice-list { display: flex; flex-direction: column; }
.ad-notice-item { display: flex; align-items: flex-start; gap: var(--sp-3); width: 100%; text-align: left; padding: var(--sp-4) 0; border-bottom: 1px solid var(--c-line); }
.ad-notice-item:last-child { border-bottom: 0; }
.ad-notice-item__icon { width: 32px; height: 32px; border-radius: var(--r-md); background: var(--c-brand-soft); color: var(--c-brand-ink); display: grid; place-items: center; flex: 0 0 auto; }
.ad-notice-item b { display: block; font-size: var(--fs-12); font-weight: var(--fw-m); }
.ad-notice-item small { display: block; font-size: var(--fs-10); color: var(--c-text-2); line-height: var(--lh-body); }

.ad-dialog {
  position: absolute; left: 50%; top: 50%; width: 420px; max-width: calc(100vw - var(--sp-8));
  background: var(--c-card); border-radius: var(--r-lg); box-shadow: var(--sh-3);
  transform: translate(-50%, -50%) scale(.96); opacity: 0;
  transition: transform var(--t-base) var(--ease-out), opacity var(--t-base) var(--ease-out);
  overflow: hidden;
}
.ad-overlay.is-open .ad-dialog { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.ad-dialog__body { padding: var(--sp-6); }
.ad-dialog__title { font-size: var(--fs-17); font-weight: var(--fw-s); }
.ad-dialog__text { font-size: var(--fs-12); color: var(--c-text-2); line-height: var(--lh-relaxed); margin-top: var(--sp-2); }
.ad-dialog__foot { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--c-line); background: var(--c-bg); }
.ad-toast {
  position: fixed; left: 50%; bottom: var(--sp-12); z-index: var(--z-toast);
  transform: translateX(-50%) translateY(8px); opacity: 0; pointer-events: none;
  padding: var(--sp-3) var(--sp-6); border-radius: var(--r-pill);
  background: var(--c-scrim); color: var(--c-on-brand); font-size: var(--fs-12);
  transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
  box-shadow: var(--sh-3);
}
.ad-toast.is-on { opacity: 1; transform: translateX(-50%); }

/* ================= 页脚 ================= */
.ad-foot {
  display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
  margin-top: var(--sp-12); padding-top: var(--sp-6);
  border-top: 1px solid var(--c-line);
  font-size: var(--fs-10); color: var(--c-text-2); line-height: var(--lh-body);
}

/* ================= 1280 以下：只留图标栏 ================= */
@media (max-width: 1279px) {
  .ad-side { width: var(--w-admin-side-min); }
  .ad-content { margin-left: var(--w-admin-side-min); }
  .ad-brand { padding: 0; justify-content: center; }
  .ad-brand__copy { display: none; }
  .ad-nav { padding-left: var(--sp-2); padding-right: var(--sp-2); }
  .ad-nav__item { justify-content: center; padding: 0; }
  .ad-nav__label { display: none; }
  .ad-nav__item.is-active::before { display: none; }
  .ad-side__foot { padding: var(--sp-4) var(--sp-2); align-items: center; }
  .ad-side__store, .ad-side__meta { display: none; }
  .ad-page { padding-left: var(--sp-6); padding-right: var(--sp-6); }
  .ad-search { width: 240px; }
  .ad-user__copy { display: none; }
  .ad-user__chev { display: none; }
  .ad-user { padding: 2px; }
  .ad-kpi-grid { gap: var(--sp-3); }
  .ad-overview-grid { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); }
  .ad-split { grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .ad-btn:active { transform: none !important; }
  .ad-drawer { transform: none !important; }
  .ad-dialog { transform: translate(-50%, -50%) !important; }
  .ad-toast { transform: translateX(-50%) !important; }
}