:root {
  --bg: #0b0d12;
  --panel: #13161e;
  --panel-2: #171b25;
  --panel-3: #1c2130;
  --border: #232936;
  --border-soft: #1c212c;
  --text: #e7eaf0;
  --muted: #8a93a6;
  --muted-2: #626b7d;
  --accent: #4d8dff;
  --accent-soft: rgba(77, 141, 255, 0.14);
  --ok: #35c07d;
  --ok-soft: rgba(53, 192, 125, 0.13);
  --warn: #e2a33c;
  --warn-soft: rgba(226, 163, 60, 0.13);
  --err: #e0574e;
  --err-soft: rgba(224, 87, 78, 0.13);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  height: 100%;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(77, 141, 255, 0.09), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, rgba(53, 192, 125, 0.05), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  max-width: none;
  margin: 0 auto;
  padding: 0 12px 28px;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 0 13px;
  background: linear-gradient(to bottom, var(--bg) 72%, rgba(11, 13, 18, 0));
}

.brand { display: flex; align-items: center; gap: 11px; }

.logo {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(140deg, #4d8dff, #7b5cff 60%, #35c07d);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 6px 18px rgba(77, 141, 255, 0.3);
}

.brand-text h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.brand-text p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--mono);
}

.actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.conn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-right: 4px;
}
.conn i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(226, 163, 60, 0.15);
}
.conn.online i { background: var(--ok); box-shadow: 0 0 0 3px rgba(53, 192, 125, 0.15); }
.conn.offline i { background: var(--err); box-shadow: 0 0 0 3px rgba(224, 87, 78, 0.15); }

/* ---------------- 按钮 ---------------- */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.06s;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
}
.btn:hover { background: var(--panel-3); border-color: #2d3546; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, #4d8dff, #3f79e0);
  border-color: #3f79e0;
  color: #fff;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(77, 141, 255, 0.22);
}
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: #ffb4ae; border-color: rgba(224, 87, 78, 0.4); background: var(--err-soft); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }

.icon-btn {
  border: 0; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 15px; padding: 4px 8px; border-radius: 6px;
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); }

/* ---------------- 统计卡 ---------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stat {
  background: linear-gradient(180deg, var(--panel), #11141b);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px 14px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
}
.stat .label { font-size: 11.5px; color: var(--muted); }
.stat strong {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.stat .hint { font-size: 11px; color: var(--muted-2); }
.stat.accent { border-color: rgba(77, 141, 255, 0.35); background: linear-gradient(180deg, rgba(77, 141, 255, 0.09), #11141b); }
.stat.accent strong { color: #9dbcff; }

/* ---------------- 进度 ---------------- */
.progress-bar {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
}
.progress-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; margin-bottom: 7px;
}
.progress-head #p-phase { font-weight: 500; }
.bar { height: 4px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #4d8dff, #7b5cff);
  transition: width 0.4s ease;
  position: relative;
}
.fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ---------------- 布局 ---------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.panel-head h2 { margin: 0; font-size: 12.5px; font-weight: 600; color: #c8cfdd; }

.side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 62px; }
.side .panel.grow { display: flex; flex-direction: column; }

/* ---------------- 工具栏 ---------------- */
.toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--panel-2);
  flex-wrap: wrap;
}
.spacer { flex: 1; }

.search {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 9px;
  height: 30px;
  min-width: 260px;
  color: var(--muted-2);
}
.search:focus-within { border-color: rgba(77, 141, 255, 0.5); }
.search input {
  border: 0; outline: 0; background: transparent; color: var(--text);
  font-size: 12.5px; width: 100%; font-family: inherit;
}
.search input::placeholder { color: var(--muted-2); }

select {
  height: 30px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

/* ---------------- 自定义下拉（系统风格） ---------------- */
.cselect { position: relative; display: inline-block; min-width: 112px; }
.cselect-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%; height: 30px; padding: 0 9px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 12.5px; font-family: inherit; cursor: pointer; outline: none;
}
.cselect-btn:hover { border-color: var(--accent); }
.cselect-btn i { font-style: normal; font-size: 10px; color: var(--muted); }
.cselect-menu {
  position: fixed; min-width: 120px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px; z-index: 200;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  max-height: 60vh; overflow-y: auto;
}
.cselect-opt {
  padding: 6px 10px; border-radius: 6px; cursor: pointer;
  font-size: 12.5px; white-space: nowrap; color: var(--text);
}
.cselect-opt:hover { background: var(--accent-soft); }
.cselect-opt.on { color: var(--accent); font-weight: 600; }

.switch {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); cursor: pointer;
  user-select: none;
  padding: 0 4px;
}
.switch input { accent-color: var(--accent); cursor: pointer; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow: auto; max-height: calc(100vh - 285px); }

table { width: 100%; border-collapse: collapse; }

thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

tbody tr { cursor: pointer; transition: background 0.1s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.021); }

.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.empty { text-align: center; padding: 42px 0; color: var(--muted-2); }
.copy { color: var(--muted-2); margin-left: 6px; opacity: 0; transition: opacity 0.15s; }
tr:hover .copy { opacity: 1; }
.copy:hover { color: var(--accent); }

.phone { font-family: var(--mono); letter-spacing: 0.2px; }
.phone.plain { color: #9ee6be; }
.phone.masked { color: var(--muted); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2.5px 7px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: #78dba9; }
.badge.warn { background: var(--warn-soft); color: #f0c07a; }
.badge.err { background: var(--err-soft); color: #f0918a; }
.badge.neutral { background: var(--panel-3); color: var(--muted); }

.pager {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid var(--border-soft);
  background: var(--panel-2);
  font-size: 12px;
}
.page-no {
  min-width: 44px; text-align: center;
  font-family: var(--mono); font-size: 12px;
  padding: 4px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}

/* ---------------- 侧栏 ---------------- */
.runs { list-style: none; margin: 0; padding: 6px; max-height: 240px; overflow: auto; }
.runs li {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  font-size: 12px;
}
.runs li:hover { background: var(--panel-2); }
.runs .kind { color: #c3cad8; min-width: 92px; }
.runs .msg { color: var(--muted-2); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runs .dur { margin-left: auto; color: var(--muted-2); font-family: var(--mono); font-size: 11px; }

.dot-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted-2);
}
.dot-live.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(53, 192, 125, 0.15); }

.logs {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.65;
  padding: 8px 10px;
  height: 300px;
  overflow: auto;
  background: #0d1016;
}
.log-line { display: flex; gap: 7px; padding: 1px 0; }
.log-line .t { color: var(--muted-2); flex: 0 0 auto; }
.log-line .s { color: #6f7c96; flex: 0 0 84px; overflow: hidden; text-overflow: ellipsis; }
.log-line .m { color: #b9c2d4; word-break: break-all; }
.log-line.warn .m { color: #e6bf82; }
.log-line.error .m { color: #eda49d; }

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 20px;
}
.modal.hidden { display: none; }

.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.modal-card.wide { max-width: 760px; max-height: 82vh; overflow: auto; }
.modal-card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.modal-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-title h3 { margin: 0; }

.field { display: block; margin-top: 14px; }
.field span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.field input {
  width: 100%;
  height: 34px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0 10px;
  font-size: 12.5px;
  font-family: var(--mono);
  outline: none;
}
.field input:focus { border-color: rgba(77, 141, 255, 0.55); }

.check { display: flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 12px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--accent); }

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.detail-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 7px 14px;
  font-size: 12.5px;
  padding: 4px 0 14px;
}
.detail-grid dt { color: var(--muted); }
.detail-grid dd { margin: 0; font-family: var(--mono); font-size: 12px; word-break: break-all; }

.detail-section { margin-top: 14px; }
.detail-section h4 { margin: 0 0 8px; font-size: 12px; color: var(--muted); font-weight: 500; }
.pre {
  background: #0d1016;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px;
  font-family: var(--mono);
  font-size: 11px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: #aab4c8;
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: #1d2331;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 12.5px;
  z-index: 200;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.toast.hidden { display: none; }
.toast.err { border-color: rgba(224, 87, 78, 0.45); color: #f0a8a2; }

.hidden { display: none !important; }

/* ---------------- 滚动条 ---------------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a3141; border-radius: 5px; border: 2px solid var(--panel); }
::-webkit-scrollbar-thumb:hover { background: #364054; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1400px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; }
  .table-wrap { max-height: 60vh; }
}
@media (max-width: 720px) {
  .app { padding: 0 12px 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-text p { display: none; }
  .search { min-width: 150px; }
  .actions .btn { padding: 6px 9px; font-size: 12px; }
}

/* ---------------- 门店与地区 ---------------- */
.poi {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  cursor: help;
  color: #cfd8ea;
}
.region { color: #9fb4d8; white-space: nowrap; }
.region .dot { margin: 0 4px; color: #55617a; font-style: normal; }
.rec-reason {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  font-size: 11px;
  border-radius: 8px;
  background: rgba(80, 140, 255, 0.15);
  color: #7aa7f5;
  white-space: nowrap;
}
.poi.rec { color: #8fd0a8; }

/* ---------------- 19 列派单视图（仅订单页，避免污染其他小表格） ---------------- */
#viewOrders .table-wrap { overflow-x: auto; }
#viewOrders table { min-width: 1450px; }
.c-seq { width: 52px; text-align: center; color: #8b96ad; }
.c-time { white-space: nowrap; }
.c-amount { white-space: nowrap; }
.c-weixin .mono { font-size: 12px; }
.c-orderid { white-space: nowrap; }
.prod {
  display: inline-block;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.badge.info {
  background: rgba(90, 150, 255, 0.16);
  color: #7aa7f5;
}
/* 字段选择器 */
.col-picker-wrap { position: relative; }
.col-picker {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 210px;
  max-height: 430px;
  overflow-y: auto;
  background: #171c28;
  border: 1px solid #2a3245;
  border-radius: 10px;
  padding: 10px 12px;
  z-index: 80;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}
.col-all {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #2a3245;
  margin-bottom: 6px;
  cursor: pointer;
}
.col-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
}
.col-item:hover { background: rgba(255, 255, 255, 0.04); }
.col-actions {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid #2a3245;
  margin-top: 6px;
}

/* ---------------- 主题切换 ---------------- */
.theme-toggle { font-size: 15px; line-height: 1; padding: 6px 10px; }

/* ---------------- 浅色主题 ---------------- */
html[data-theme='light'] {
  --bg: #f3f5f9;
  --panel: #ffffff;
  --panel-2: #f7f8fb;
  --panel-3: #eef1f6;
  --border: #dfe3ec;
  --border-soft: #e8ebf2;
  --text: #232936;
  --muted: #5c6472;
  --muted-2: #8b93a3;
  --accent-soft: rgba(77, 141, 255, 0.12);
  --ok-soft: rgba(24, 138, 82, 0.1);
  --warn-soft: rgba(196, 130, 20, 0.12);
  --err-soft: rgba(214, 69, 60, 0.1);
}

html[data-theme='light'] body::before {
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(77, 141, 255, 0.07), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, rgba(24, 138, 82, 0.04), transparent 60%);
}

html[data-theme='light'] .topbar {
  background: linear-gradient(to bottom, var(--bg) 72%, rgba(243, 245, 249, 0));
}

html[data-theme='light'] .btn:hover { border-color: #c4ccd9; }
html[data-theme='light'] .btn.danger { color: #b3362e; }

html[data-theme='light'] .stat { background: linear-gradient(180deg, var(--panel), #f2f4f9); }
html[data-theme='light'] .stat.accent { background: linear-gradient(180deg, rgba(77, 141, 255, 0.08), #eef3ff); }
html[data-theme='light'] .stat.accent strong { color: #2f6bdb; }

html[data-theme='light'] .panel-head h2 { color: #3c4657; }

html[data-theme='light'] .phone.plain { color: #12855a; }
html[data-theme='light'] .badge.ok { color: #148a52; }
html[data-theme='light'] .badge.warn { color: #9a6206; }
html[data-theme='light'] .badge.err { color: #b3362e; }
html[data-theme='light'] .badge.info { color: #2f6bdb; }

html[data-theme='light'] .runs .kind { color: #3c4657; }

html[data-theme='light'] .logs,
html[data-theme='light'] .pre { background: #f7f8fb; }
html[data-theme='light'] .log-line .s { color: #8b93a3; }
html[data-theme='light'] .log-line .m { color: #3c4657; }
html[data-theme='light'] .log-line.warn .m { color: #9a6206; }
html[data-theme='light'] .log-line.error .m { color: #b3362e; }
html[data-theme='light'] .pre { color: #3c4657; }

html[data-theme='light'] .toast { background: #ffffff; box-shadow: 0 10px 30px rgba(30, 40, 60, 0.18); }
html[data-theme='light'] .toast.err { color: #b3362e; }

html[data-theme='light'] ::-webkit-scrollbar-thumb { background: #c9d0dc; }
html[data-theme='light'] ::-webkit-scrollbar-thumb:hover { background: #aeb7c6; }

html[data-theme='light'] .poi { color: #2a3245; }
html[data-theme='light'] .region { color: #4a5b7d; }
html[data-theme='light'] .region .dot { color: #a8b0bf; }
html[data-theme='light'] .rec-reason { background: rgba(47, 107, 219, 0.1); color: #2f6bdb; }
html[data-theme='light'] .poi.rec { color: #12855a; }
html[data-theme='light'] .c-seq { color: #99a1b0; }

html[data-theme='light'] .col-picker {
  background: #ffffff;
  border-color: #dfe3ec;
  box-shadow: 0 14px 34px rgba(30, 40, 60, 0.16);
}
html[data-theme='light'] .col-all { border-bottom-color: #dfe3ec; }
html[data-theme='light'] .col-actions { border-top-color: #dfe3ec; }
html[data-theme='light'] .col-item:hover { background: rgba(30, 40, 60, 0.05); }

/* ---------------- 单击可编辑单元格 ---------------- */

.editable {
  cursor: pointer;
  border-bottom: 1px dashed rgba(140, 150, 175, 0.55);
  padding-bottom: 1px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.editable:hover {
  border-bottom-color: #4d8bfd;
  color: #8ab6ff;
}
.editable.empty {
  color: #7d8698;
  font-size: 14px;
  opacity: 0.75;
}
.editable.empty:hover {
  opacity: 1;
  color: #8ab6ff;
}

.edit-mark {
  margin-left: 4px;
  font-size: 11px;
  color: #d9a441;
  opacity: 0.85;
}

.edited {
  color: #ffd479;
}
html[data-theme='light'] .edited { color: #b07514; }

.cell-input {
  width: 100%;
  min-width: 90px;
  max-width: 220px;
  box-sizing: border-box;
  padding: 3px 6px;
  font: inherit;
  color: inherit;
  background: rgba(77, 139, 253, 0.12);
  border: 1px solid #4d8bfd;
  border-radius: 4px;
  outline: none;
}
.cell-input:focus {
  background: rgba(77, 139, 253, 0.2);
  box-shadow: 0 0 0 2px rgba(77, 139, 253, 0.25);
}
html[data-theme='light'] .cell-input {
  background: #ffffff;
  color: #22304a;
}

/* ---------------- 操作列按钮 ---------------- */

.c-actions {
  white-space: nowrap;
  width: 130px;
}

.act-wrap {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 13px;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(77, 139, 253, 0.14);
  border: 1px solid rgba(77, 139, 253, 0.45);
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.act-btn:hover {
  transform: translateY(-1px);
  background: rgba(77, 139, 253, 0.3);
  box-shadow: 0 2px 8px rgba(77, 139, 253, 0.35);
}

.act-btn.primary {
  background: rgba(255, 176, 32, 0.16);
  border-color: rgba(255, 176, 32, 0.55);
}

.act-btn.primary:hover {
  background: rgba(255, 176, 32, 0.32);
  box-shadow: 0 2px 8px rgba(255, 176, 32, 0.35);
}

.act-btn.todo {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.7);
}

.act-btn.todo:hover {
  transform: none;
  box-shadow: none;
  background: rgba(77, 139, 253, 0.14);
}

html[data-theme='light'] .act-btn {
  background: #eef4ff;
  border-color: #b9d0ff;
}

html[data-theme='light'] .act-btn.primary {
  background: #fff6e6;
  border-color: #ffd591;
}

/* ---------------- 左侧导航 ---------------- */

.shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* 各页面：单屏锁定，内容超出只在页面内部滚 */
.app {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  margin: 0 auto;
  padding: 0 12px 12px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#viewSettings,
#viewDashboard {
  overflow-y: auto;
}

.sidenav {
  width: 200px;
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  padding: 4px 8px 14px;
}

.side-logo {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--accent-soft);
  border-radius: 8px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  border: 1px solid transparent;
  transition: background 0.15s ease;
  user-select: none;
}

.nav-item:hover {
  background: var(--panel-2);
}

.nav-item.active {
  background: var(--accent-soft);
  border-color: rgba(77, 141, 255, 0.35);
  color: var(--accent);
  font-weight: 600;
}

.side-foot {
  margin-top: auto;
  padding: 8px;
  text-align: center;
}

/* ---------------- 详情弹窗（卡片式） ---------------- */

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 12px;
}

.detail-id {
  font-size: 15px;
  font-weight: 600;
  word-break: break-all;
}

.detail-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.dcard {
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.dcard h4 {
  margin: 0 0 12px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
}

.dico {
  font-size: 13px;
}

.prod-banner {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prod-banner b {
  font-size: 14px;
  line-height: 1.5;
}

.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 7px 10px;
  margin: 0;
  font-size: 13px;
}

.kv.two {
  grid-template-columns: 110px 1fr 110px 1fr;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  word-break: break-all;
}

.price-row {
  display: flex;
  gap: 22px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}

.price-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

.price-item span {
  color: var(--muted);
}

.price-item b {
  font-size: 15px;
}

.price-item.pay b {
  color: var(--err);
  font-size: 18px;
}

.poi-block {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--panel);
}

.poi-block-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.poi-name-banner {
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 600;
  margin-bottom: 8px;
}

.poi-block .kv {
  grid-template-columns: 90px 1fr;
}

.clue-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

/* ---------------- 设置页 ---------------- */

.settings-body {
  padding: 4px 2px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ---------------- 操作列悬浮（吸附右侧） ---------------- */

th.c-actions,
td.c-actions {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--panel);
  box-shadow: -6px 0 8px -6px rgba(0, 0, 0, 0.35);
}

html[data-theme='light'] th.c-actions,
html[data-theme='light'] td.c-actions {
  background: #ffffff;
  box-shadow: -6px 0 8px -6px rgba(0, 0, 0, 0.12);
}

tbody tr:hover td.c-actions {
  background: var(--panel-2);
}

/* ---------------- 侧边栏收起态 ---------------- */

.shell.side-collapsed .sidenav {
  width: 60px;
  flex-basis: 60px;
  padding: 14px 6px;
}

.shell.side-collapsed .nav-txt,
.shell.side-collapsed .side-brand span {
  display: none;
}

.shell.side-collapsed .side-brand {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.shell.side-collapsed .nav-item {
  text-align: center;
  padding-left: 0;
  padding-right: 0;
}

.shell.side-collapsed .side-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.nav-collapse {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-collapse:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------------- 表格铺满屏（搜索在上 / 表格中 / 翻页在下） ---------------- */

#viewOrders .layout {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

#viewOrders .table-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#viewOrders .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

/* ---------------- 数据大屏 ---------------- */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
}

.stat.big {
  padding: 22px 20px;
}

.stat.big strong {
  font-size: 34px;
  letter-spacing: 0.5px;
}

.stat.big .label {
  font-size: 13px;
}

.stat.big.warn strong {
  color: var(--warn);
}

.stat.big.ok strong {
  color: var(--ok);
}

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

/* ---------------- 单屏锁定细节 ---------------- */

.app > .topbar {
  flex: 0 0 auto;
}

.app > section.progress-bar {
  flex: 0 0 auto;
}

#viewOrders .layout {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* ---------------- 侧边栏收起态 ---------------- */

#viewPois .layout {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#viewPois .table-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#viewPois .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

/* ---------------- 表格全屏（仅 .table-wrap 进入全屏） ---------------- */
.table-wrap:fullscreen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  background: var(--bg, #0b0d12);
  padding: 8px 12px;
  box-sizing: border-box;
  overflow: auto;
}

.table-wrap:fullscreen table {
  min-width: 1450px;
  height: auto;
}

/* ---------------- 筛选栏（两行式） ---------------- */
.filter-bar {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-row .search { flex: 0 1 300px; min-width: 220px; }
.filter-row select { min-width: 150px; }
.date-range { display: flex; align-items: center; gap: 4px; }
.date-range input[type='date'] {
  height: 30px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
}
.date-range input[type='date']:focus { border-color: rgba(77, 141, 255, 0.5); }
html[data-theme='light'] .date-range input[type='date'] { color-scheme: light; }

/* ---------------- 日历下拉（自研） ---------------- */
.dp-input {
  height: 30px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  min-width: 108px;
}
.dp-input:focus { border-color: rgba(77, 141, 255, 0.5); }
html[data-theme='light'] .dp-input { color-scheme: light; }

.f-label { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.dp-panel {
  position: fixed;
  z-index: 3000;
  width: 248px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
  padding: 10px 12px 8px;
  user-select: none;
}
.dp-head {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}
.dp-sel {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  height: 24px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}
.dp-y { width: 72px; }
.dp-m { width: 56px; }
.dp-unit { font-size: 12px; color: var(--muted); }
.dp-nav { margin-left: auto; display: flex; gap: 4px; }
.dp-btn {
  width: 22px; height: 22px;
  border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
  border-radius: 6px; cursor: pointer; font-size: 11px; line-height: 1;
}
.dp-btn:hover { border-color: rgba(77, 141, 255, 0.5); }
.dp-week {
  display: grid; grid-template-columns: repeat(7, 1fr);
  font-size: 11px; color: var(--muted); text-align: center; margin-bottom: 2px;
}
.dp-week .wk { color: #e0574e; }
.dp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-day {
  height: 26px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text);
  font-size: 12px; cursor: pointer;
}
.dp-day:hover { background: var(--panel-3); }
.dp-day.dim { color: var(--muted); opacity: 0.55; }
.dp-day.today { color: #4d8dff; font-weight: 600; }
.dp-day.sel { background: #4d8dff; color: #fff; font-weight: 600; }
.dp-foot {
  display: flex; justify-content: space-between;
  border-top: 1px solid var(--border-soft);
  margin-top: 6px; padding-top: 6px;
}
.dp-link {
  border: 0; background: transparent; cursor: pointer;
  font-size: 12px; color: #4d8dff; padding: 2px 6px;
}
.dp-link:hover { text-decoration: underline; }

/* ---------------- 商户签约表 ---------------- */
.auto-mark { color: var(--muted); font-size: 11px; margin-left: 2px; }
.cell-empty { color: var(--muted); opacity: 0.6; }
.cell-range { display: flex; align-items: center; gap: 4px; }
.cell-range .dp-input { min-width: 96px; width: 96px; padding: 0 4px; }
.cell-save {
  height: 26px; padding: 0 8px;
  border: 1px solid rgba(77, 141, 255, 0.5);
  background: rgba(77, 141, 255, 0.12);
  color: #4d8dff; border-radius: 6px; cursor: pointer;
}
.cell-save:hover { background: rgba(77, 141, 255, 0.22); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 4px 0 14px;
}
.form-grid label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--muted);
}
.form-grid input, .form-grid select {
  height: 30px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0 8px; font-size: 12.5px; font-family: inherit; outline: none;
}
.form-grid input:focus, .form-grid select:focus { border-color: rgba(77, 141, 255, 0.5); }
.form-grid .dp-input { width: 100%; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.page-size { height: 26px; }

/* ---------------- 大屏：商家数据表（布局对齐订单页，表格内部滚动） ---------------- */
#viewDashboard .layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
#viewDashboard .dash-grid { flex: 0 0 auto; }
#dashMerchantPanel { flex: 1 1 auto; min-height: 0; }
#dashMerchantPanel .panel-head { flex: 0 0 auto; }
#dashMerchantPanel .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
#dashMerchantPanel table { min-width: 860px; }
#dashMerchantPanel tbody tr { cursor: default; }

/* 下拉框统一风格（日历面板内的年/月选择也对齐系统样式） */
.dp-sel { height: 26px; border-radius: 8px; font-size: 12.5px; }

/* ---------------- 自研下拉（与日历同风格） ---------------- */
.cs-wrap { position: relative; display: inline-flex; }
.cs-btn {
  height: 30px;
  min-width: 150px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 26px 0 10px;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background-repeat: no-repeat;
  background-position: right 9px center;
}
.cs-btn::after {
  content: '';
  position: absolute;
  right: 9px; top: 50%;
  width: 7px; height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.cs-btn:hover, .cs-btn:focus { border-color: rgba(77, 141, 255, 0.5); }
.cs-panel {
  position: fixed;
  z-index: 3000;
  min-width: 150px;
  max-height: 264px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
  padding: 6px;
  user-select: none;
}
.cs-opt {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.cs-opt:hover { background: var(--panel-3); }
.cs-opt.sel { background: #4d8dff; color: #fff; font-weight: 600; }

/* ---------------- 商户页纵向铺满（表格内部滚动） ---------------- */
#viewPois .layout {
  align-items: stretch;
  grid-template-rows: minmax(0, 1fr);
}
#viewPois .table-panel {
  display: flex;
  flex-direction: column;
}
#viewPois .toolbar { flex: 0 0 auto; }
#viewPois .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
#viewPois .pager { flex: 0 0 auto; }

/* ---------------- 派单体系 v2 ---------------- */
.rec-box {
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 10px;
  line-height: 1.7;
}
.quota-warn { color: #e0574e; font-size: 12.5px; }
.quota-full { color: #e0574e; font-weight: 600; }
.assign-pois {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  margin-bottom: 10px;
}
.poi-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
}
.poi-opt:last-child { border-bottom: 0; }
.poi-opt:hover { background: var(--panel-3); }
.poi-opt.sel { background: rgba(77, 141, 255, 0.12); }
.poi-opt.sel .poi-name { color: #4d8dff; font-weight: 600; }
.poi-opt .poi-name { font-weight: 500; min-width: 170px; }
.poi-opt .mono { white-space: nowrap; }
.tpl-preview {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  margin: 0 0 10px;
  font-family: inherit;
}
.tpl-mini {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  font-family: inherit;
  max-width: 320px;
  color: var(--muted);
}
.sub-line { font-size: 11.5px; margin-top: 2px; color: var(--muted); }
.sub-line b { color: var(--text); }
.act-btn.spin { animation: actspin 0.8s linear infinite; display: inline-block; }
@keyframes actspin { to { transform: rotate(360deg); } }

/* ---------------- 数据大屏 v2（科技风） ---------------- */
.dash-v2 {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px 14px;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(29, 79, 216, 0.35), transparent 60%),
    radial-gradient(900px 420px at 8% 108%, rgba(24, 160, 200, 0.18), transparent 55%),
    radial-gradient(900px 420px at 92% 108%, rgba(52, 108, 255, 0.16), transparent 55%),
    linear-gradient(180deg, #050b1f 0%, #071129 55%, #04101f 100%);
}
#viewDashboard .app,
#viewDashboard { background: #04101f; }

.dash-head {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.dash-title {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}
.dash-title h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 6px;
  font-weight: 800;
  color: #eaf6ff;
  text-shadow: 0 0 18px rgba(64, 156, 255, 0.9), 0 0 44px rgba(24, 108, 255, 0.55);
}
.dt-deco {
  width: 130px;
  height: 10px;
  background: linear-gradient(90deg, transparent, #35c7ff);
  clip-path: polygon(0 45%, 62% 45%, 68% 0, 100% 0, 100% 100%, 68% 100%, 62% 55%, 0 55%);
  filter: drop-shadow(0 0 6px rgba(53, 199, 255, 0.8));
}
.dt-deco.flip { transform: scaleX(-1); }
.dash-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #7fa8d9;
}
.dash-meta .sep { opacity: 0.4; }

.dash-kpis {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.dash-kpi {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 22px;
  border: 1px solid rgba(64, 140, 255, 0.35);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(13, 42, 92, 0.55), rgba(8, 26, 60, 0.55));
  box-shadow: inset 0 0 26px rgba(30, 100, 220, 0.25), 0 4px 18px rgba(0, 0, 0, 0.35);
}
.dash-kpi::before,
.dash-kpi::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border: 2px solid #3fd4ff;
}
.dash-kpi::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.dash-kpi::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
.kpi-label {
  font-size: 15px;
  font-weight: 700;
  color: #d8ecff;
  letter-spacing: 2px;
}
.kpi-sub { margin-top: 4px; font-size: 12px; color: #6f9bd2; }
.kpi-sub b { color: #3fd4ff; font-style: normal; }
.kpi-value { margin-left: auto; display: flex; align-items: baseline; gap: 8px; }
.digits { display: inline-flex; gap: 5px; }
.digits i {
  font-style: normal;
  min-width: 30px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  font-family: 'Consolas', 'DIN Alternate', monospace;
  color: #4fe3ff;
  background: linear-gradient(180deg, rgba(12, 46, 104, 0.9), rgba(7, 25, 58, 0.9));
  border: 1px solid rgba(63, 178, 255, 0.45);
  border-radius: 5px;
  text-shadow: 0 0 12px rgba(64, 214, 255, 0.85);
  box-shadow: inset 0 0 10px rgba(24, 130, 240, 0.35);
}
.kpi-unit { font-style: normal; font-size: 16px; font-weight: 700; color: #3fd4ff; }
.kpi-ring {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(63, 212, 255, 0.7);
  border-top-color: transparent;
  box-shadow: 0 0 12px rgba(63, 212, 255, 0.5), inset 0 0 8px rgba(63, 212, 255, 0.35);
  animation: ringspin 4s linear infinite;
}
@keyframes ringspin { to { transform: rotate(360deg); } }

.dash-boards {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.dash-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid rgba(64, 140, 255, 0.3);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(10, 34, 78, 0.5), rgba(6, 22, 52, 0.5));
  box-shadow: inset 0 0 30px rgba(20, 80, 190, 0.2);
  overflow: hidden;
}
.dash-panel h2 {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 16px;
  font-size: 15px;
  letter-spacing: 2px;
  color: #d8ecff;
  border-bottom: 1px solid rgba(64, 140, 255, 0.3);
  background: linear-gradient(90deg, rgba(28, 84, 180, 0.4), transparent);
}
.dash-panel h2 .tag {
  width: 8px; height: 8px;
  background: #3fd4ff;
  box-shadow: 0 0 8px rgba(63, 212, 255, 0.9);
  transform: rotate(45deg);
}
.dash-panel h2 em {
  font-style: normal;
  margin-left: auto;
  font-size: 13px;
  color: #3fd4ff;
  font-family: Consolas, monospace;
}
.dash-thead,
.dash-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 58px 58px 64px 64px 66px;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
}
.dash-thead {
  flex: 0 0 auto;
  height: 34px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #8fb8e8;
  background: rgba(20, 62, 130, 0.35);
  border-bottom: 1px solid rgba(64, 140, 255, 0.25);
}
.dash-tbody {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 4px 0 8px;
}
.dash-row {
  height: 40px;
  font-size: 12.5px;
  color: #c4dcf8;
  border-bottom: 1px dashed rgba(64, 140, 255, 0.14);
}
.dash-row:nth-child(odd) { background: rgba(18, 55, 118, 0.18); }
.dash-row .c-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
  color: #e4f2ff;
}
.dash-row .c-name em {
  font-style: normal;
  margin-left: 6px;
  font-size: 11px;
  color: #6f9bd2;
  font-weight: 400;
}
.dash-row .c-sales { color: #8fb8e8; }
.dash-row .c-num { text-align: center; font-family: Consolas, monospace; font-size: 13px; }
.dash-row .c-num.done { color: #4fe3ff; font-weight: 700; }
.dash-row .c-num.neg { color: #ff5c68; font-weight: 700; }
.dash-row .c-num.pos { color: #35e08a; }
.dash-row .c-tag { text-align: center; }
.dash-row .c-tag b {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}
.dash-row .c-tag b.ok { color: #35e08a; border: 1px solid rgba(53, 224, 138, 0.6); background: rgba(53, 224, 138, 0.12); }
.dash-row .c-tag b.no { color: #ff5c68; border: 1px solid rgba(255, 92, 104, 0.6); background: rgba(255, 92, 104, 0.12); }
.dash-empty {
  padding: 28px 0;
  text-align: center;
  color: #6f9bd2;
  font-size: 13px;
}
/* 大屏滚动条 */
.dash-tbody::-webkit-scrollbar { width: 6px; }
.dash-tbody::-webkit-scrollbar-thumb { background: rgba(64, 140, 255, 0.35); border-radius: 3px; }

/* 门店类型徽章 */
.badge.direct { color: #4d8dff; border: 1px solid rgba(77, 141, 255, 0.5); background: rgba(77, 141, 255, 0.1); }
.badge.coop { color: #b07dff; border: 1px solid rgba(176, 125, 255, 0.5); background: rgba(176, 125, 255, 0.12); }
