:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #1f2d3d;
  --muted: #7f8c8d;
  --blue: #2f6fed;
  --green: #27ae60;
  --red: #e74c3c;
  --orange: #e67e22;
  --radius: 12px;
}

.portal-card { width: min(780px, 100%); padding: clamp(16px, 4vw, 30px); }
.portal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.portal-header p { margin: 3px 0 0; }
#portalTitle:focus { outline: none; }
.portal-pages { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 182px), 1fr)); gap: 10px; }
.portal-page {
  display: grid; align-content: center; text-align: left; gap: 6px; min-height: 75px;
  padding: 13px 15px; background: #f0f6ff; border: 1px solid #c6d9fa; border-radius: 9px; color: #194981;
}
.portal-page span { font-size: 12px; }
.portal-page:hover:not(:disabled) { background: #e3eeff; }
.portal-page:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.portal-page:disabled { opacity: 1; background: #f4f5f7; border-color: var(--line); color: #627184; cursor: not-allowed; }
#portalError:empty { display: none; }
#btnPortalSwitch { width: 100%; }
.account-management .table-wrap { margin-top: 12px; }
#managedAccountsTable th[scope="row"] { color: var(--text); font-size: 13px; }
.managed-account-grants span {
  display: inline-block; margin: 2px 4px 2px 0; padding: 2px 7px;
  background: #eef5ff; border-radius: 5px; color: #234d83;
}
.managed-account-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.managed-account-actions button { min-height: 32px; padding: 4px 9px; }
dialog.managed-account-dialog { width: min(600px, calc(100% - 24px)); }
#managedAccountEditor { padding: clamp(14px, 4vw, 20px); }
.managed-account-dialog label[for] { display: block; margin: 10px 0 4px; }
#managedAccountName, #managedRevealPassword, #managedRevealValue { width: 100%; }
.managed-account-password { flex-wrap: wrap; }
.managed-account-password input { flex: 1 1 175px; }
.managed-account-permissions { border: 1px solid var(--line); border-radius: 8px; margin: 13px 0 0; padding: 8px 10px 12px; min-width: 0; }
#managedAccountOptions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
  gap: 6px;
}
#managedAccountOptions label {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 36px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 5px;
  overflow-wrap: anywhere;
  cursor: pointer;
}
#managedAccountOptions input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
}
#managedAccountOptions label:hover { background: #f6f8fb; }
#managedAccountOptions label:has(input:checked) { background: #eef5ff; color: #194981; }
#managedAccountFormMessage:empty { display: none; }
.managed-account-save {
  position: sticky;
  bottom: 0;
  margin-top: 12px;
  padding: 8px 0 0;
  background: var(--card);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

h1, h2 { margin: 0; font-weight: 700; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
p { margin: 6px 0; }
.muted { color: var(--muted); font-size: 12.5px; }
.error { color: var(--red); min-height: 20px; margin-top: 10px; }

[hidden] { display: none !important; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 20% 0%, #e8f0ff 0%, var(--bg) 60%);
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(31, 45, 61, .04);
}
.login-card { width: 100%; max-width: 440px; padding: 26px; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, #2f6fed, #27ae60);
  color: #fff; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}

.seg {
  display: flex; background: #eef2f7; border-radius: 10px;
  padding: 4px; margin-bottom: 16px;
}
.seg-btn {
  flex: 1; border: 0; background: transparent; padding: 9px 0;
  border-radius: 8px; font-size: 14px; color: var(--muted); cursor: pointer;
}
.seg-btn.active { background: #fff; color: var(--text); font-weight: 700;
  box-shadow: 0 1px 3px rgba(31,45,61,.12); }

label { display: block; margin: 12px 0 6px; font-size: 13px; color: #34495e; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; color: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(47, 111, 237, .18); border-color: var(--blue);
}
button {
  font: inherit; cursor: pointer; border-radius: 8px; padding: 9px 16px;
  border: 1px solid transparent;
}
button:disabled { opacity: .55; cursor: not-allowed; }
.primary { background: var(--blue); color: #fff; font-weight: 700; }
.primary:hover { background: #2559c9; }
.ghost { background: #fff; border-color: var(--line); color: #34495e; }
.ghost:hover { border-color: #c3cedd; }
#btnLogin { width: 100%; margin-top: 20px; padding: 12px; font-size: 15px; }

/* ---------------- 主界面：左侧导航 ---------------- */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: 212px; flex: 0 0 212px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 12px;
  background: #fff; border-right: 1px solid var(--line);
  padding: 14px 12px 12px;
}
.side-head {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 4px 12px; border-bottom: 1px solid var(--line);
}
.side-head .brand-mark { width: 34px; height: 34px; border-radius: 9px; font-size: 16px; }
.mobile-menu-toggle { display: none; }
.side-titles { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.side-titles strong { font-size: 13.5px; white-space: nowrap; }
.side-titles .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tabs { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.tab {
  background: transparent; border: 0; color: var(--muted);
  padding: 10px 12px; border-radius: 8px; font-weight: 600;
  text-align: left; width: 100%;
}
.tab:hover { background: #f2f6fb; color: var(--text); }
.tab.active { background: #eaf1ff; color: var(--blue); }
.tab-group { min-width: 0; }
.tab-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tab-group-toggle::after {
  content: "";
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.tab-group-toggle[aria-expanded="true"]::after { transform: rotate(225deg); }
.tab-group.contains-active > .tab-group-toggle { color: var(--blue); }
.tab-group-options { display: grid; gap: 2px; padding: 3px 0 3px 13px; }
.tab-group-options .tab { font-weight: 500; }

.side-foot {
  border-top: 1px solid var(--line); padding-top: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.side-meta {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 12px; color: var(--muted); word-break: break-all;
}
.side-foot #btnLogout { width: 100%; }
#dataGlobalSiteWrap { margin-bottom: 8px; }
#dataGlobalSiteWrap > label { margin: 0 0 4px; font-size: 12px; }

.content { flex: 1; min-width: 0; }
main { padding: 18px 20px 40px; max-width: 1200px; }

@media (max-width: 860px) {
  #app { flex-direction: column; min-height: 100dvh; }
  .sidebar {
    z-index: 20; height: auto; width: 100%; flex: 0 0 auto;
    border-right: 0; border-bottom: 1px solid var(--line); gap: 0;
    padding: 8px 12px;
  }
  .side-head { border-bottom: 0; padding: 0; }
  .side-titles { flex: 1; }
  .mobile-menu-toggle { display: block; flex: none; min-height: 42px; padding: 6px 12px; white-space: nowrap; }
  .sidebar:not(.mobile-menu-open) :is(.tabs, .side-meta, #btnLogout) { display: none; }
  .sidebar .tabs {
    flex: none; max-height: min(48vh, 380px); max-height: min(48dvh, 380px);
    margin-top: 8px; padding: 4px 0; overflow: auto; overscroll-behavior-y: contain;
    border-top: 1px solid var(--line);
  }
  .sidebar .tab { min-height: 42px; }
  .side-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 8px; border-top: 0; padding-top: 0; }
  .sidebar.mobile-menu-open .side-foot { border-top: 1px solid var(--line); padding-top: 6px; }
  .side-meta { flex-direction: row; gap: 8px; }
  .side-meta #buildTag, .side-foot #btnLogout { width: auto; white-space: nowrap; }
  #dataGlobalSiteWrap {
    grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    align-items: center; gap: 6px; margin: 6px 0 0;
  }
  #dataGlobalSiteWrap > label { margin: 0; }
  #dataGlobalSiteWrap > select { min-width: 0; padding: 5px 8px; }
  .sidebar.mobile-menu-open #dataGlobalSiteWrap { margin: 0 0 6px; }
}

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px;
}
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 4px; }
.stat .v.ok { color: var(--green); }
.stat .v.bad { color: var(--red); }
.board-value-alert { color: #c0392b; font-weight: 700; }
.reach-date { border-radius: 8px; padding: 6px 12px; font-size: 12px; }
.reach-date[aria-pressed="true"] { background: #1a73e8; border-color: #1a73e8; color: #fff; }
.reach-date-label { font-size: 12px; margin-inline-start: 4px; }
.stat .v.warn { color: var(--orange); }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.space { justify-content: space-between; }
.row.right { justify-content: flex-end; }
.row input { width: auto; min-width: 180px; flex: 1; }

.board-filters { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; }
.board-filter-group {
  display: flex;
  align-items: flex-start;
  max-width: 100%;
  gap: 6px;
}
.board-filter-label {
  flex: none;
  font-size: 12px;
  line-height: 28px;
  white-space: nowrap;
}
.board-filter-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  gap: 5px 6px;
}
.board-filter-options > button { min-height: 28px; white-space: nowrap; }
.board-filter-count { padding-inline: 4px; font-size: 12px; white-space: nowrap; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.on { background: var(--green); }
.dot.off { background: #c7d0da; }
.dot.warn { background: var(--orange); }
.dot.bad { background: var(--red); }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; background: #eef2f7; color: #4a5a6a;
}
.tag.green { background: #e8f7ee; color: #1e8449; }
.tag.red { background: #fdecea; color: #b03a2e; }
.tag.orange { background: #fdf2e6; color: #b9770e; }

.capacity-standard-toolbar, .capacity-standard-controls {
  display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap;
}
.capacity-standard-toolbar { justify-content: space-between; margin: 6px 0 8px; }
.capacity-standard-toolbar .board-sub { margin: 0; }
.capacity-standard-controls label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.capacity-standard-legend, .capacity-standard-status { margin: 5px 0 8px; font-size: 12px; line-height: 1.5; }
.capacity-standard-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.capacity-standard-table { min-width: 860px; font-variant-numeric: tabular-nums; }
.capacity-standard-table th, .capacity-standard-table td { text-align: center; white-space: nowrap; }
.capacity-standard-table tr > :first-child {
  position: sticky; left: 0; z-index: 1; text-align: left; background: #fff;
}
.capacity-standard-table thead th, .capacity-standard-table tfoot th, .capacity-standard-table tfoot td {
  background: #f5f7fb;
}
.capacity-standard-table tfoot th, .capacity-standard-table tfoot td { border-top: 1px solid var(--line); font-weight: 600; }
.capacity-standard-mark { color: #1e8449; margin-inline: 3px; font-weight: 700; }
.capacity-standard-price { color: var(--muted); font-size: 12px; }
@media (max-width: 600px) {
  .capacity-standard-toolbar { align-items: flex-start; }
  .capacity-standard-controls { width: 100%; }
  .capacity-standard-price { display: block; }
  .capacity-standard-price > span { display: none; }
}

/* ---------------- 设置表单 ---------------- */
.group { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; }
.group:first-child { border-top: 0; margin-top: 0; }
.group h3 {
  margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; gap: 8px;
}
.group h3::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--blue);
  flex: 0 0 auto;
}
.group > .muted { margin: 2px 0 14px; line-height: 1.6; }
/* 一行一项：左边标签、右边输入框（沿用原设置窗口的排法） */
.fields {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px; align-items: start;
}
.fields.four { grid-template-columns: minmax(0, 1fr); }
.subgroup .fields { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
}
.subgroup { margin-top: 16px; }
.subgroup h4 {
  margin: 0 0 8px; font-size: 13.5px; font-weight: 700; color: #46586b;
  padding-left: 8px; border-left: 3px solid #c7d7ea;
}
.swcheck {
  display: flex; align-items: center; gap: 8px; height: 36px;
  padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fbfcfe; cursor: pointer; font-size: 13.5px;
  justify-self: start; min-width: 96px;
}
.swcheck input { width: 18px; height: 18px; flex: 0 0 auto; }
.fields > * { min-width: 0; }
.field {
  min-width: 0; display: grid; grid-template-columns: 200px minmax(0, 230px);
  align-items: center; gap: 4px 12px; padding: 7px 0;
}
.field > label {
  margin: 0; font-size: 13px; color: #34495e;
  display: flex; align-items: center; gap: 4px;
}
.field.wide { grid-template-columns: 200px minmax(0, 520px); }
.field .hint {
  grid-column: 1 / -1; color: var(--muted); font-size: 12px;
  margin: 2px 0 0; line-height: 1.45;
}
.field .unit { color: var(--muted); font-size: 12px; font-weight: 400; }
.field input[type="text"], .field input[type="password"],
.field input[type="number"], .field select {
  width: 100%; min-width: 0; height: 36px; padding: 6px 10px;
}
.field textarea { width: 100%; min-width: 0; }
.check { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.check input { width: 18px; height: 18px; flex: 0 0 auto; }
.check label { margin: 0; }
.notice { padding: 10px 12px; border-radius: 8px; margin: 8px 0; font-size: 13px; }
.notice.warn { background: #fdf2e6; color: #8a5a00; }
.notice.ok { background: #e8f7ee; color: #1e8449; }
.notice.bad { background: #fdecea; color: #b03a2e; }

/* ---------------- 地图 ---------------- */
#map { height: calc(100vh - 210px); min-height: 560px; border-radius: 10px; border: 1px solid var(--line); margin-top: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #eaf1ff; color: #1f4fb8; border-radius: 999px;
  padding: 4px 6px 4px 12px; font-size: 12.5px;
}
.chip button { border: 0; background: transparent; color: #b03a2e; padding: 2px 6px; }

/* ---------------- 日志 / 弹窗 ---------------- */
.logbox {
  background: #0f172a; color: #d6e2f5; border-radius: 10px;
  padding: 14px; max-height: 520px; overflow: auto;
  font: 12.5px/1.5 Consolas, "Courier New", monospace;
  white-space: pre-wrap; word-break: break-all; margin: 12px 0 0;
}
.logbox.small { max-height: 220px; }

.server-error-list {
  list-style: none; padding: 0; margin: 12px 0 0;
  max-height: min(520px, 65vh); overflow: auto;
  border: 1px solid var(--line); border-radius: 10px;
}
.server-error-list li { padding: 10px 12px; }
.server-error-list li + li { border-top: 1px solid var(--line); }
.server-error-list pre {
  margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere;
  font: 12.5px/1.55 Consolas, "Courier New", monospace;
}
.server-error-actions {
  display: flex; justify-content: space-between; align-items: center;
  gap: 6px 12px; flex-wrap: wrap;
}
.server-error-state {
  display: inline-block; padding: 3px 8px; border-radius: 6px;
  color: #8a5000; background: #fff3dc; font-size: 12.5px; font-weight: 700;
}
.server-error-state.resolved { color: #176646; background: #e4f4ea; }
.server-error-actions button { padding: 6px 10px; min-height: 36px; }
.server-error-actions button[aria-busy="true"] { cursor: wait; opacity: .65; }
.server-error-controls { display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.server-error-controls label { margin: 0; }
.server-error-controls select { width: auto; padding: 6px 10px; }

.modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 900;
}
.modal-card { background: #fff; border-radius: var(--radius); padding: 20px; width: 100%; max-width: 900px; }
.modal-card.small-card { max-width: 520px; }
.checkline { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; }
.checkline input { width: 18px; height: 18px; }
.modal-card textarea {
  width: 100%; height: 46vh; font: 12.5px/1.5 Consolas, monospace; margin-top: 10px;
}

@media (max-width: 640px) {
  main { padding: 4px 10px 40px; }
  #map { height: 60vh; }
  .row input { min-width: 120px; }
  .stat .v { font-size: 19px; }
}

/* ---------------- 装备清单行 ---------------- */
.equip-row {
  display: flex; gap: 10px; align-items: center; margin: 8px 0; flex-wrap: wrap;
}
.equip-row select, .equip-row input {
  height: 38px; min-height: 38px; padding: 0 10px; font-size: 13.5px;
  line-height: 36px; box-sizing: border-box;
}
.equip-row select { width: 200px; }
.equip-row .equip-small { width: 280px; }
.equip-row .equip-qty { width: 80px; text-align: center; }
.equip-row button { height: 38px; padding: 0 14px; }
@media (max-width: 720px) {
  .equip-row select, .equip-row .equip-small { width: 100%; }
}
.inline-check { display:flex; align-items:center; gap:8px; margin:10px 0 0; font-size:13px; color:var(--muted); }
.inline-check input { width:16px; height:16px; }

/* 弹窗内容过高时内部滚动，保证按钮和最后一行都能看到 */
.modal { padding: 24px 16px; overflow-y: auto; }
.modal-card { max-height: 92vh; display: flex; flex-direction: column; }
.modal-card > .table-wrap {
  overflow-y: auto !important; overflow-x: hidden; min-height: 120px;
  max-height: calc(92vh - 130px); scrollbar-gutter: stable;
}
.modal-card > .table-wrap::-webkit-scrollbar { width: 10px; }
.modal-card > .table-wrap::-webkit-scrollbar-thumb {
  background: #c3cbd6; border-radius: 5px;
}
.modal-card > .row, .modal-card > h2, .modal-card > p { flex: 0 0 auto; }
/* 数据统计：表格内部滚动 + 表头吸顶 */
#view-stats .table-wrap {
  max-height: calc(100vh - 430px); overflow: auto; border: 1px solid var(--line);
  border-radius: 10px; background: #fff;
}
#statsTable { border-collapse: separate; border-spacing: 0; }
#statsTable tr:first-child th {
  position: sticky; top: 0; z-index: 5; background: #f7faf8;
  box-shadow: 0 1px 0 var(--line);
}
#statsTable th, #statsTable td { white-space: nowrap; }

/* 实时看板子栏目 */
.board-tabs { display: flex; gap: 4px; margin: 2px 0 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.board-tabs .board-tab {
  padding: 7px 16px; border: 1px solid var(--line); border-bottom: none;
  border-radius: 8px 8px 0 0; background: #eef1f5; color: inherit; cursor: pointer; font-size: 13px; font-weight: 700;
}
.board-tabs .board-tab.active { background: #fff; color: #1a73e8; box-shadow: 0 1px 0 #fff; }
.dboard-report-actions { display: flex; margin: 0 0 8px; }
.dboard-effective-cards { display: contents; }
#dboardEffectiveOpen { min-height: 34px; padding: 5px 12px; color: #1b5595; font-weight: 600; }
.dboard-effective-dialog {
  width: min(1320px, calc(100% - 24px)); max-height: calc(100% - 24px);
  padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius);
  background: #f5f8fc; color: var(--text);
}
.dboard-effective-dialog::backdrop { background: #17253673; }
.dboard-effective-header {
  padding: 16px clamp(13px, 3vw, 26px); gap: 12px; color: #fff;
  background: linear-gradient(110deg, #143250, #204c73);
}
.dboard-effective-header h2 { margin: 0 0 5px; color: inherit; }
.dboard-effective-header p { margin: 0; color: #d6e6f5; font-size: 13px; }
.dboard-effective-header .ghost { min-height: 34px; padding: 5px 12px; }
.dboard-effective-status,
.dboard-effective-note { margin: 14px clamp(13px, 3vw, 24px); color: #455a6e; }
.dboard-effective-note { font-size: 12px; line-height: 1.55; }
.dboard-effective-scroll {
  max-height: min(65vh, 650px); margin: 14px clamp(10px, 3vw, 24px);
  overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
.dboard-effective-scroll:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.dboard-effective-scroll table { min-width: 985px; border-collapse: separate; border-spacing: 0; }
.dboard-effective-scroll thead th {
  position: sticky; top: 0; z-index: 1; background: #edf3fa; color: #3a536d;
}
.dboard-effective-scroll :is(th, td) {
  padding: 10px 8px; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.dboard-effective-scroll :is(th, td):first-child { padding-inline-start: 14px; text-align: left; }
.dboard-effective-scroll tbody th { color: #263e55; font-size: inherit; }
.dboard-effective-scroll tbody tr:nth-child(even) { background: #fbfdff; }
.dboard-effective-scroll tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.dboard-effective-scroll tfoot { background: #ebf2fa; font-weight: 700; }
.dboard-effective-scroll tfoot th { color: inherit; font-size: inherit; border-bottom: none; }
.dboard-effective-rate { font-weight: 700; }
.dboard-effective-rate.is-met { color: #117a4c; }
.dboard-effective-rate.is-near { color: #976100; }
.dboard-effective-rate.is-below { color: #b5382b; }

/* 排班出勤彩色块 */
.att-kpis { display:flex; gap:10px; margin:6px 0 14px; }
.att-kpi { flex:1; border-radius:8px; padding:12px 16px; color:#fff; text-align:center; }
.att-kpi .k-label { font-size:13px; opacity:.92; }
.att-kpi .k-value { font-size:28px; font-weight:800; line-height:1.25; }
.att-kpi.blue { background:#1a73e8; }
.att-kpi.green { background:#28a745; }
.att-kpi.red { background:#dc3545; }
.board-sub { font-size:14px; margin:14px 0 6px; color:#33475b; }

/* 站点操作按钮组：四列网格、靠右对齐 */
#adminSites td:last-child { text-align:right; }
.mod-btns {
  display:grid; grid-template-columns:repeat(5, 84px); gap:6px;
  justify-content:end; margin-left:auto; width:max-content;
}
.mod-btns .ghost { width:100%; justify-content:center; white-space:nowrap; padding:8px 6px; }

/* 实时看板表格：姓名/骑手ID 不换行、给足宽度，整体横向滚动而不是挤成竖排 */
#boardTable, #dboardTable { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: auto; }
#boardTable th, #boardTable td,
#dboardTable th, #dboardTable td { padding: 8px 6px; font-size: 13px; white-space: nowrap; }
#boardTable td:nth-child(2) { min-width: 74px; }
#boardTable td:nth-child(3) { min-width: 92px; }
/* 看板表格：容器内滚动，横向滚动条固定在表格底部可见处 */
#dboardPaneMain .table-wrap,
#boardPaneMain .table-wrap {
  max-height: calc(100vh - 430px);
  overflow: auto;
  scrollbar-gutter: stable;
}
#dboardPaneMain .table-wrap::-webkit-scrollbar,
#boardPaneMain .table-wrap::-webkit-scrollbar { height: 10px; width: 10px; }
#dboardPaneMain .table-wrap::-webkit-scrollbar-thumb,
#boardPaneMain .table-wrap::-webkit-scrollbar-thumb { background:#c3cbd6; border-radius:5px; }
/* 实时看板表格：固定列宽铺满区域，排班时段列可控 */
#dboardTable, #boardTable { width:100%; table-layout:fixed; }
#dboardTable td, #dboardTable th,
#boardTable td, #boardTable th { overflow:hidden; text-overflow:ellipsis; }
#dboardTable td:nth-child(5), #boardTable td:nth-child(4) {
  white-space: normal; font-size: 12px; line-height: 1.35;
}
#dboardTable th:nth-child(1) { width: 86px; }
#dboardTable th:nth-child(3) { width: 74px; }
#dboardTable th:nth-child(4) { width: 94px; }
#dboardTable th:nth-child(5) { width: 128px; }
#dboardTable th:nth-child(7) { width: 105px; }
#dboardTable th:nth-child(8) { width: 68px; }
#dboardTable th:nth-child(9) { width: 79px; }
#dboardTable th:nth-child(10) { width: 109px; }
#boardTable th:nth-child(2), #boardTable td:nth-child(2) { width:80px; }
#boardTable th:nth-child(3), #boardTable td:nth-child(3) { width:86px; }
#boardTable th:nth-child(4), #boardTable td:nth-child(4) { width:176px; }
#boardTable th:nth-child(6), #boardTable td:nth-child(6) { width:95px; }
#boardTable th:nth-child(7), #boardTable td:nth-child(7) { width:70px; }
#boardTable th:nth-child(8), #boardTable td:nth-child(8) { width:65px; }
#boardTable th:nth-child(9), #boardTable td:nth-child(9) { width:88px; }
#dboardTable .board-status { width: 72px; }
#boardTable .board-status { width:82px; }
#dboardTable td.board-status, #boardTable td.board-status {
  white-space: normal;
  text-overflow: clip;
}
#dboardTable .board-effective, #boardTable .board-effective {
  width: 78px;
  text-align: center;
}
#dboardTable .board-effective { width: 92px; }
.board-effective-yes { color: #1e8449; }
.board-effective button {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.board-effective button:hover { text-decoration: underline; }
#dboardTable .board-standard-diff, #boardTable .board-standard-diff {
  width: 104px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
#dboardTable .board-standard-diff { width: 70px; }
.board-standard-met { color: #146b38; font-size: 15px; }
.board-standard-short { color: #ae2a24; font-weight: 600; white-space: normal; }
.board-standard-short > span { white-space: nowrap; }
#dboardTable .board-service-fee, #boardTable .board-service-fee {
  width: 105px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
#dboardTable .board-service-fee { width: 84px; }
.board-service-fee strong { color: #146b38; }

/* KPI 表格：不换行、首列加宽、横向滚动 */
#boardKpiQuality, #dboardKpiQuality,
#boardKpiScoreLeft, #dboardKpiScoreLeft,
#boardKpiScoreRight, #dboardKpiScoreRight,
#boardKpiRating, #dboardKpiRating {
  width: max-content; min-width: 100%; border-collapse: collapse;
}
#boardKpiQuality th, #boardKpiQuality td,
#dboardKpiQuality th, #dboardKpiQuality td,
#boardKpiScoreLeft th, #boardKpiScoreLeft td,
#dboardKpiScoreLeft th, #dboardKpiScoreLeft td,
#boardKpiScoreRight th, #boardKpiScoreRight td,
#dboardKpiScoreRight th, #dboardKpiScoreRight td,
#boardKpiRating th, #boardKpiRating td,
#dboardKpiRating th, #dboardKpiRating td {
  white-space: nowrap; font-size: 12px; padding: 8px 10px;
}
#boardKpiQuality tr > *:first-child,
#dboardKpiQuality tr > *:first-child,
#boardKpiScoreLeft tr > *:first-child,
#dboardKpiScoreLeft tr > *:first-child,
#boardKpiScoreRight tr > *:first-child,
#dboardKpiScoreRight tr > *:first-child {
  min-width: 220px; text-align: left;
}
#boardKpiQuality tr > *:first-child { position: sticky; left: 0; background: #fff; z-index: 1; }
#dboardKpiQuality tr > *:first-child { position: sticky; left: 0; background: #fff; z-index: 1; }

/* KPI 质量表：只固定「商圈片名称」这一列（含合并表头），其它列正常随滚动隐藏 */
#boardKpiQuality tr:nth-child(2) > th:first-child,
#dboardKpiQuality tr:nth-child(2) > th:first-child {
  position: static; background: #eef2f7; z-index: auto;
}
#boardKpiQuality th[rowspan],
#dboardKpiQuality th[rowspan] {
  position: sticky; left: 0; background: #eef2f7; z-index: 3;
  box-shadow: 2px 0 3px rgba(0,0,0,0.06);
}
#boardKpiQuality tbody td:first-child { }
#boardKpiQuality tr td:first-child,
#dboardKpiQuality tr td:first-child {
  position: sticky; left: 0; background: #fff; z-index: 2;
  box-shadow: 2px 0 3px rgba(0,0,0,0.06);
}

/* 手机端：质量数据表必须能左右滑动；取消首列 sticky，避免触摸横向滑动被固定列拦住 */
@media (max-width: 860px) {
  .table-wrap:has(> #boardKpiQuality),
  .table-wrap:has(> #dboardKpiQuality) {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  #boardKpiQuality,
  #dboardKpiQuality {
    display: table;
    width: max-content;
    min-width: 760px;
    touch-action: pan-x pan-y;
  }
  #boardKpiQuality tr > *:first-child,
  #dboardKpiQuality tr > *:first-child,
  #boardKpiQuality th[rowspan],
  #dboardKpiQuality th[rowspan],
  #boardKpiQuality tr td:first-child,
  #dboardKpiQuality tr td:first-child {
    position: static;
    box-shadow: none;
  }
  /* 手机端：质量得分表同样需要独立横向滚动，避免列头挤在一起 */
  .table-wrap:has(> #boardKpiScoreLeft),
  .table-wrap:has(> #dboardKpiScoreLeft),
  .table-wrap:has(> #boardKpiScoreRight),
  .table-wrap:has(> #dboardKpiScoreRight),
  .table-wrap:has(> #boardKpiRating),
  .table-wrap:has(> #dboardKpiRating) {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  #boardKpiScoreLeft,
  #dboardKpiScoreLeft {
    display: table;
    width: max-content !important;
    min-width: 1320px;
    touch-action: pan-x pan-y;
  }
  #boardKpiScoreRight,
  #dboardKpiScoreRight {
    display: table;
    width: max-content !important;
    min-width: 1180px;
    touch-action: pan-x pan-y;
  }
  #boardKpiScoreLeft tr > *:first-child,
  #dboardKpiScoreLeft tr > *:first-child,
  #boardKpiScoreRight tr > *:first-child,
  #dboardKpiScoreRight tr > *:first-child,
  #boardKpiScoreLeft th[rowspan],
  #dboardKpiScoreLeft th[rowspan],
  #boardKpiScoreRight th[rowspan],
  #dboardKpiScoreRight th[rowspan] {
    position: static;
    box-shadow: none;
  }
}


/* 装备点亮、血压测量和餐箱消毒的页头 */
.data-safety-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  margin-bottom: 14px;
}
.data-safety-title { flex: 1 1 260px; min-width: 0; }
.data-safety-title p { margin: 4px 0 0; }
.data-safety-actions {
  display: grid; grid-template-columns: minmax(0, 190px) auto auto;
  gap: 8px; margin-inline-start: auto; max-width: 100%;
}
.data-safety-actions select { min-width: 0; }
.data-safety-actions button { white-space: nowrap; }

/* 物资绑定：页面加宽、表头和筛选一行、租期不换行 */
body.wide-materials main { max-width: min(1880px, calc(100vw - 260px)); padding: 6px 12px 30px 4px; }
.data-materials-controls { flex-wrap: nowrap; margin: 10px 0 14px; }
.data-materials-controls .data-site { max-width: 190px; flex: 0 0 auto; }
#dataMaterialsFilter { max-width: 150px; flex: 0 0 auto; }
#view-data-materials .table-wrap { overflow-x: auto; }
#dataMaterialsTable { min-width: 1120px; }
#dataMaterialsTable th, #dataMaterialsTable td { white-space: nowrap; }


/* 物资绑定刷新按钮：不显示焦点外框，保持一行 */
#view-data-materials .data-materials-refresh { flex: 0 0 auto; white-space: nowrap; }
#view-data-materials .data-materials-refresh:focus,
#view-data-materials .data-materials-refresh:focus-visible { outline: none; box-shadow: none; }


/* 物资绑定：不要外层大卡片框；刷新加载提示不要占位卡片 */
#view-data-materials > .card { border: 0; box-shadow: none; background: transparent; padding: 0; }


/* 实时看板：保留各列宽度，窄屏在表格内横向滚动 */
body.wide-board main { max-width: min(1880px, calc(100vw - 260px)); }
#dboardTable { min-width: 1341px; }
#boardTable { min-width: 1450px; }


/* 实时看板表头锁定（纵向滚动时表头不动） */
#dboardTable th, #boardTable th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #f4f7fb;
  box-shadow: 0 1px 0 var(--line);
}
#dboardTable thead th, #boardTable thead th { background:#f4f7fb; }

#callrateSite { width: auto; min-width: 145px; max-width: 100%; }
.callrate-table-wrap, .station-warning-table, .slot-detail-scroll {
  max-height: max(220px, calc(100vh - 320px));
  overflow: auto;
}
.callrate-table-wrap, .station-warning-table {
  border: 1px solid var(--line);
  border-radius: 10px;
}
.callrate-table-wrap { margin-top: 12px; }
.health-certificate-header { align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.health-certificate-controls { flex-wrap: wrap; }
.health-certificate-controls input { width: min(210px, 100%); }
.health-certificate-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  margin: 0 0 12px; gap: 10px;
}
.health-certificate-summary > div {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px;
}
.health-certificate-summary dt { color: var(--muted); font-size: 12px; }
.health-certificate-summary dd { margin: 3px 0 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.health-certificate-valid { color: #14754f; }
.health-certificate-due { color: #935900; }
.health-certificate-table { border: 1px solid var(--line); border-radius: 10px; }
.health-certificate-table table { min-width: 880px; }
.health-certificate-hire-date, .health-certificate-employment-days { white-space: nowrap; }
.health-certificate-column { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.health-certificate-sort, .health-certificate-filter {
  display: inline-flex; align-items: center; min-height: 24px; border: 0; border-radius: 4px;
  padding: 2px 4px; color: inherit; background: transparent; font: inherit; white-space: nowrap;
}
.health-certificate-sort { gap: 4px; }
.health-certificate-filter::before {
  content: ""; width: 12px; height: 12px; background: currentColor;
  clip-path: polygon(0 10%, 100% 10%, 63% 52%, 63% 83%, 37% 98%, 37% 52%);
}
.health-certificate-column button:is(:hover, :focus-visible, .is-active),
.health-certificate-table th[aria-sort] .health-certificate-sort {
  color: #155fb9; background: #e8f1ff;
}
.health-certificate-column button:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.health-certificate-actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.health-certificate-actions button, .health-certificate-actions a { padding: 4px 8px; }
.health-certificate-actions a { color: var(--blue); }
.health-certificate-bulk {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 6px; color: var(--blue); text-decoration: none;
}
.health-certificate-bulk[aria-disabled="true"] { color: var(--muted); cursor: default; }
.health-certificate-preview-open {
  padding: 0; border: 0; background: transparent; color: var(--blue); font: inherit; cursor: pointer;
}
.health-certificate-preview-open:hover { text-decoration: underline; }
.health-certificate-preview-open:focus-visible, .health-certificate-bulk:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px;
}
.health-certificate-preview {
  width: min(900px, calc(100% - 24px)); max-height: calc(100dvh - 24px);
  padding: 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--text); overflow: auto;
}
.health-certificate-preview::backdrop { background: #17253673; }
.health-certificate-preview-header h2 { margin: 0; }
.health-certificate-preview-content { display: grid; place-items: center; }
.health-certificate-preview-content img {
  display: block; max-width: 100%; max-height: calc(100dvh - 106px); margin-top: 12px; object-fit: contain;
}
.health-certificate-alert { color: #b42318; }
.health-certificate-status-note { display: block; margin-top: 2px; font-size: 12px; }
#healthCertificateTransfer { margin: 4px 0 10px; }
@media (max-width: 640px) {
  .health-certificate-controls { width: 100%; }
}
#callrateTable, .station-warning-table > table, .slot-detail-scroll > table { border-collapse: separate; border-spacing: 0; }
#callrateTable { white-space: nowrap; }
#callrateTable th, .station-warning-table th { position: sticky; top: 0; z-index: 1; background: #f4f7fb; }
.slot-detail-scroll { margin-bottom: 6px; }
.slot-detail-scroll > table { font-size: 12px; }
.slot-detail-scroll th { position: sticky; top: 0; z-index: 1; }
.slot-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font: inherit;
}
.slot-sort-button:hover, .slot-sort-button:focus-visible { text-decoration: underline; }
.slot-detail-scroll .slot-duration { white-space: nowrap; font-variant-numeric: tabular-nums; }
.slot-achieved { margin: 8px 0; }
.slot-achieved > summary {
  padding: 7px 10px;
  border-radius: 6px;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.slot-achieved > .slot-detail-scroll { margin-top: 6px; }
.slot-achieved-empty { margin: 6px 10px; }
.slot-export .slot-detail-scroll { max-height: none; overflow: visible; }
.slot-export .slot-detail-scroll th { position: static; }
#callrateTable .callrate-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font-weight: inherit;
}
#callrateTable .callrate-sort:hover,
#callrateTable [aria-sort] .callrate-sort { color: var(--blue); }

/* 安全类运营看板 */
body.wide-safety main { max-width: 1480px; }
.safety-report {
  --safety-line: #edf0f5;
  --safety-soft: #f7f8fb;
  --safety-sub: #617084;
  --safety-red: #d8423b;
  --safety-shadow: 0 2px 12px rgba(29, 33, 41, .06);
  container-type: inline-size;
}
.safety-header, .safety-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.safety-header { justify-content: space-between; margin-bottom: 15px; }
.safety-header h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.safety-header h2::before {
  content: ""; width: 6px; height: 22px; border-radius: 4px;
  background: linear-gradient(180deg, #ff8327, #f1544d);
}
.safety-status, .safety-control { font-size: 12px; color: var(--safety-sub); }
.safety-control { display: flex; gap: 5px; align-items: center; }
.safety-control input, .safety-control select, .safety-toolbar button { padding: 7px 8px; border-radius: 8px; }
.safety-control input, .safety-control select { width: auto; min-width: 0; }
.safety-overview, .safety-kpis, .safety-panel-grid { display: grid; gap: 14px; margin-bottom: 16px; }
.safety-overview { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.safety-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.safety-panel-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.safety-panel-grid-bottom { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.safety-summary-card, .safety-kpi, .safety-panel {
  min-width: 0; background: #fff; border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--safety-shadow); border: 1px solid transparent;
}
.safety-summary-card { display: flex; align-items: center; gap: 10px; }
.safety-card-icon {
  width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 10px; font-size: 17px;
}
.safety-card-icon.blue { background: #eaf1ff; }
.safety-card-icon.orange { background: #fff3e8; }
.safety-card-icon.green { background: #e8ffea; }
.safety-card-icon.red { background: #ffece8; }
.safety-card-icon.purple { background: #f1edff; }
.safety-summary-value, .safety-kpi-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.safety-summary-value { font-size: 21px; line-height: 1.2; }
.safety-summary-label, .safety-kpi-foot, .safety-panel-note { font-size: 12px; color: var(--safety-sub); }
.safety-summary-label { margin-top: 3px; }
.safety-kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.safety-kpi-name { font-size: 13px; color: var(--safety-sub); }
.safety-kpi-value { margin: 8px 0 5px; font-size: 25px; line-height: 1.15; }
.safety-kpi.is-pending { border: 1px dashed #dce1ea; background: #fbfcfe; }
.safety-kpi.is-pending .safety-kpi-value { color: #8b97a7; }
.safety-panel h3 { margin: 0 0 5px; font-size: 15px; }
.safety-panel-note { margin: 4px 0 10px; }
.safety-chart-scroll, .safety-table-scroll { overflow-x: auto; }
.safety-canvas { display: block; height: 225px; }
.safety-chart-key { display: flex; flex-wrap: wrap; gap: 5px 12px; color: var(--safety-sub); font-size: 12px; }
.safety-warnings { display: grid; gap: 8px; max-height: 267px; overflow: auto; margin-top: 10px; padding-right: 3px; }
.safety-warning { display: flex; align-items: flex-start; gap: 9px; border: 1px solid var(--safety-line); border-radius: 9px; background: #fafbfc; padding: 9px; }
.safety-warning-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; margin-top: 6px; background: #f1544d; }
.safety-warning-title { font-weight: 600; }
.safety-health-warnings { margin-top: 14px; border-top: 1px solid var(--safety-line); padding-top: 12px; }
.safety-health-warnings h4 { margin: 0; font-size: 14px; }
.safety-health-warnings details { overflow: hidden; border: 1px solid var(--safety-line); border-radius: 8px; }
.safety-health-warnings details + details { margin-top: 6px; }
.safety-health-warnings summary { padding: 7px 9px; cursor: pointer; background: #fafbfc; font-weight: 600; }
.safety-health-warnings summary strong { margin-inline-start: 4px; font-variant-numeric: tabular-nums; }
#safetyHealthDue summary strong { color: #935900; }
#safetyHealthInvalid summary strong { color: #b42318; }
.safety-health-warnings ul { list-style: none; padding: 0 9px; margin: 0; max-height: 200px; overflow: auto; }
.safety-health-warnings li { padding: 6px 0; overflow-wrap: anywhere; }
.safety-health-warnings li + li { border-top: 1px solid var(--safety-line); }
.safety-health-warnings li small { display: block; color: var(--safety-sub); }
.safety-warning-detail, .safety-data-empty { color: var(--safety-sub); font-size: 12px; }
.safety-data-empty { min-height: 100px; display: grid; place-items: center; text-align: center; }
.safety-table-panel { margin-bottom: 16px; }
.safety-table-panel table { min-width: 880px; white-space: nowrap; }
.safety-table-panel tr > * { text-align: center; border-color: var(--safety-line); }
.safety-table-panel tr > :first-child { text-align: left; }
.safety-table-panel thead th { background: var(--safety-soft); color: var(--safety-sub); }
.safety-table-panel tbody th { color: inherit; }
.safety-cell-warning { color: var(--safety-red); font-weight: 600; }
.safety-cell-muted { color: var(--safety-sub); }
.safety-bp { min-height: 240px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: center; }
.safety-meter {
  width: 155px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%;
  background: conic-gradient(#19a85b var(--safety-meter-progress, 0%), #e9eef4 0);
}
.safety-meter-value { width: 78%; aspect-ratio: 1; border-radius: 50%; background: white; display: grid; place-items: center; font-size: 23px; font-weight: 700; }
.safety-meter-legend { display: grid; gap: 7px; color: var(--safety-sub); font-size: 13px; }
.safety-meter-legend strong { color: var(--text); margin-right: 4px; }
@container (max-width: 1030px) {
  .safety-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .safety-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .safety-panel-grid { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 520px) {
  .safety-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .safety-summary-card { padding: 10px; }
  .safety-kpis { grid-template-columns: minmax(0, 1fr); }
}

/* 服务商经营数据驾驶舱 */
main:has(> .ops-report:not([hidden])) { max-width: 1520px; }
.ops-report {
  --ops-surface: #0a1324;
  --ops-card: #142035;
  --ops-card-quiet: #17263d;
  --ops-line: #2c3a50;
  --ops-ink: #e8eef8;
  --ops-sub: #a9b7cd;
  --ops-blue: #78adff;
  --ops-cyan: #55e5d9;
  --ops-green: #65e5ad;
  --ops-orange: #ffc47c;
  --ops-purple: #b8a4ff;
  --ops-red: #ff9398;
  --ops-accent: var(--ops-blue);
  color-scheme: dark;
  color: var(--ops-ink);
  background: radial-gradient(ellipse at 75% 0%, #182a46 0, transparent 42%), var(--ops-surface);
  border: 1px solid #213049;
  border-radius: 16px;
  padding: clamp(12px, 2vw, 24px);
  container-type: inline-size;
}
.ops-topbar, .ops-toolbar, .ops-panel-header { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ops-topbar { justify-content: space-between; margin-bottom: 18px; }
.ops-topbar h2 { display: flex; align-items: center; gap: 11px; font-size: 22px; line-height: 1.35; }
.ops-topbar h2::before {
  content: ""; width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%;
  background: var(--ops-cyan); box-shadow: 0 0 14px rgba(85, 229, 217, .6);
}
.ops-toolbar { margin-left: auto; }
.ops-panel-header { justify-content: space-between; margin-bottom: 8px; }
.ops-status { flex-basis: 100%; margin: 0; color: var(--ops-sub); font-size: 12px; }
.ops-status:empty { display: none; }
.ops-control { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0; font-size: 12px; color: var(--ops-sub); }
.ops-control input, .ops-control select, .ops-refresh {
  width: auto; min-width: 0; max-width: 100%; padding: 7px 10px;
  border: 1px solid var(--ops-line); border-radius: 8px; background: var(--ops-card);
  color: var(--ops-ink); font: inherit;
}
.ops-refresh { font-size: 13px; }
.ops-refresh:hover, .ops-control input:hover, .ops-control select:hover { border-color: var(--ops-blue); }
.ops-report :focus-visible { outline: 2px solid var(--ops-blue); outline-offset: 2px; }
.ops-grid { display: grid; gap: 14px; }
.ops-grid:empty { display: none; }
.ops-overview { grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr)); }
.ops-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ops-quality, .ops-attendance { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ops-split { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.ops-report > :not(:last-child) { margin-bottom: 14px; }
.ops-card {
  min-width: 0;
  padding: 16px;
  background: var(--ops-card);
  border: 1px solid var(--ops-line);
  border-radius: 12px;
}
.ops-caption, .ops-label {
  display: flex; align-items: center; gap: 8px; margin: 0 0 8px;
  font-size: 13px; font-weight: 600; color: var(--ops-sub);
}
.ops-caption { color: var(--ops-ink); }
.ops-panel-header .ops-caption { margin: 0; }
.ops-caption::before, .ops-card > .ops-label::before {
  content: ""; width: 3px; height: 13px; flex: 0 0 3px; border-radius: 2px; background: var(--ops-accent);
}
.ops-value { color: var(--ops-accent); font-size: 25px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ops-core:first-child .ops-value {
  font-size: clamp(28px, 3.4vw, 44px); line-height: 1.12;
  background: linear-gradient(90deg, var(--ops-blue), var(--ops-cyan));
  background-clip: text; color: transparent;
}
.ops-note { margin: 6px 0 0; color: var(--ops-sub); font-size: 12px; line-height: 1.55; }
.ops-note:empty { display: none; }
.ops-quality .ops-card, .ops-attendance > * { text-align: center; }
.ops-quality .ops-label, .ops-attendance .ops-label { justify-content: center; }
.ops-quality-comparison {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px 10px;
  padding-top: 10px; margin: 10px 0 0; border-top: 1px solid var(--ops-line);
}
.ops-quality-comparison dt { color: var(--ops-sub); font-size: 11px; line-height: 1.45; }
.ops-quality-comparison dd { margin: 3px 0 0; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ops-quality-parts { display: flex; justify-content: center; flex-wrap: wrap; gap: 3px 12px; }
.ops-quality-parts strong { color: var(--ops-ink); }
.ops-quality .ops-quality-types {
  grid-column: 1 / -1; text-align: left; padding: 9px 12px; margin: 0;
}
.ops-quality-types summary { cursor: pointer; color: var(--ops-sub); font-size: 12px; font-weight: 600; }
.ops-quality-types[open] summary { margin-bottom: 8px; }
.ops-quality-type-table { min-width: 340px; }
.ops-quality-rule { grid-column: 1 / -1; margin: -7px 0 0; }
.ops-attendance > * { padding: 12px; background: var(--ops-card-quiet); border: 1px solid var(--ops-line); border-radius: 10px; }
.ops-ring {
  width: min(100%, 94px); aspect-ratio: 1; margin: 7px auto;
  display: grid; place-items: center; border-radius: 50%;
  background: conic-gradient(var(--ops-accent) var(--ops-progress, 0%), var(--ops-line) 0);
}
.ops-ring-value {
  width: 86%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%;
  background: var(--ops-card); color: var(--ops-ink); font-size: 17px; font-weight: 700;
}
.ops-ring + .ops-note { text-align: center; }
.ops-kpis .ops-ring { width: 70px; height: 70px; }
.ops-kpis .ops-ring-value { font-size: 14px; }
.ops-meter {
  display: inline-block; width: 90px; height: 6px; max-width: 100%;
  overflow: hidden; border-radius: 6px; background: var(--ops-line); vertical-align: middle;
}
.ops-meter > span, .ops-meter > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ops-purple), var(--ops-blue)); }
.ops-overview .ops-meter { width: 100%; margin-top: 8px; }
.ops-chart, .ops-table-scroll { min-width: 0; overflow-x: auto; }
.ops-chart { min-height: 200px; }
.ops-chart canvas { display: block; }
.ops-trend-canvas { width: 100%; height: auto; margin-top: 6px; }
.ops-trend-options { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 3px; color: var(--ops-ink); font-size: 12px; }
.ops-trend-options label { display: inline-flex; align-items: center; gap: 5px; min-height: 25px; cursor: pointer; white-space: nowrap; }
.ops-trend-options input { width: 13px; height: 13px; margin: 0; accent-color: var(--series-color); }
.ops-trend-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--series-color); }
.ops-trend-options label:has(input:not(:checked)) { color: var(--ops-sub); }
.ops-chart summary { margin: 4px 0 8px; color: var(--ops-sub); font-size: 12px; cursor: pointer; }
.ops-chart svg { display: block; width: 100%; height: auto; }
.ops-empty { display: grid; place-items: center; min-height: 100px; color: var(--ops-sub); text-align: center; font-size: 12px; }
.ops-rank-list { display: grid; gap: 12px; margin: 12px 0 0; padding: 0; list-style: none; }
.ops-rank-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(32px, 1fr) auto; align-items: center; gap: 8px; font-size: 12px; }
.ops-rank-row .ops-meter { width: 100%; }
.ops-rank-row small { display: block; margin-top: 2px; }
.ops-report table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.ops-report thead th { background: var(--ops-card-quiet); color: var(--ops-sub); }
.ops-report th, .ops-report td { padding: 10px 8px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--ops-line); }
.ops-report tbody th { color: var(--ops-ink); }
.ops-report tr > :first-child { text-align: left; }
.ops-report tbody tr:hover { background: var(--ops-card-quiet); }
.ops-accuracy-table { min-width: 880px; }
.ops-accuracy-source { display: block; margin-top: 2px; }
.ops-site-table { min-width: 1110px; }
.ops-site-table tr > :first-child { position: sticky; left: 0; background: var(--ops-card); z-index: 1; }
.ops-site-table thead tr > :first-child { background: var(--ops-card-quiet); }
.ops-muted { color: var(--ops-sub); }
.ops-warning { color: var(--ops-orange); }
.ops-danger { color: var(--ops-red); }
.ops-good { color: var(--ops-green); }
@container (max-width: 1050px) {
  .ops-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ops-split { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 670px) {
  .ops-toolbar { margin-left: 0; }
  .ops-overview, .ops-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-overview > :first-child { grid-column: 1 / -1; }
  .ops-topbar h2 { font-size: 19px; }
  .ops-card { padding: 11px; }
}
@container (max-width: 530px) {
  .ops-quality { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 360px) {
  .ops-attendance { grid-template-columns: minmax(0, 1fr); }
}
.log-controls { flex-wrap: wrap; align-items: end; }
.log-controls label { display: grid; gap: 4px; }
.log-controls label span { color: var(--muted); font-size: 12px; }
.log-table { max-height: 620px; overflow: auto; }
.log-table > table { border-collapse: separate; border-spacing: 0; }
.log-table thead th { position: sticky; top: 0; z-index: 1; background: #f4f7fb; white-space: nowrap; }
.log-table td { white-space: nowrap; }
.audit-log-table td:last-child { white-space: normal; overflow-wrap: anywhere; min-width: 175px; }
.access-log-table td:nth-child(6) { white-space: normal; overflow-wrap: anywhere; min-width: 150px; }
#accessAccount { max-width: 210px; }
.access-request summary { cursor: pointer; }
.access-request code { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.log-ip-trigger {
  padding: 3px 4px; color: inherit; font: inherit;
  background: transparent; border: 0;
}
.log-ip-trigger:hover, .log-ip-trigger[data-active] { color: var(--blue); }
.log-ip-filter {
  position: fixed; inset: auto; margin: 0; width: min(320px, calc(100vw - 16px));
  padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--text); box-shadow: 0 8px 28px #0f172a22; overflow: auto;
}
.log-ip-options { max-height: min(190px, 38vh); overflow: auto; margin: 8px 0; }
.log-ip-options label { display: flex; align-items: center; gap: 8px; padding: 5px 4px; cursor: pointer; }
.log-ip-options label span { overflow-wrap: anywhere; }
.log-ip-options input { width: auto; flex: none; }

.server-files-path { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 12px; }
.server-files-path button, .server-file-name {
  padding: 4px 2px; text-align: left; border: 0; background: transparent; color: var(--blue);
  overflow-wrap: anywhere;
}
.server-files-path button:hover, .server-file-name:hover { text-decoration: underline; }
.server-files-path [aria-current] { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.server-files-layout { display: grid; gap: 16px; }
.server-file-list { border: 1px solid var(--line); border-radius: 10px; }
.server-file-list td:first-child { white-space: normal; min-width: 140px; overflow-wrap: anywhere; }
.server-file-list tr[data-selected] { background: #eef4ff; }
.server-file-list .file-download { color: var(--blue); }
.server-file-preview { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.server-file-preview h3 { margin: 0; overflow-wrap: anywhere; }
.server-file-preview pre { margin-top: 8px; }
.phone-kpis { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; }
@media (min-width: 1200px) {
  .server-files-layout:has(.server-file-preview:not([hidden])) { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
}

@media (max-width: 860px) {
  main, body.wide-board main, body.wide-materials main, body.wide-safety main,
  main:has(> .ops-report:not([hidden])) { width: 100%; max-width: 100%; padding: 10px 12px 32px; }
  .content, main > .view, main > .view > .card, .row > *, .table-wrap { min-width: 0; max-width: 100%; }
  .row input:not([type="checkbox"]):not([type="radio"]) { min-width: min(120px, 100%); max-width: 100%; }
  .table-wrap, .slot-detail-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
  .view .table-wrap table:has(th:nth-child(5)), .slot-detail-scroll > table { min-width: 540px; }
  .board-tabs { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; }
  .board-tabs .board-tab { flex: none; min-height: 42px; padding: 9px 12px; white-space: nowrap; }
  .board-tabs .board-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
}

@media (max-width: 600px) {
  .card { padding: 12px; margin-bottom: 12px; }
  .login-wrap { padding: 14px; }
  .login-card { padding: 18px; }
  .grid, .phone-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .grid > * { min-width: 0; }
  .grid > .notice { grid-column: 1 / -1; }
  .stat { padding: 9px 10px; overflow-wrap: anywhere; }
  .att-kpis { gap: 6px; }
  .att-kpi { min-width: 0; padding: 7px 4px; }
  .att-kpi .k-value { font-size: 20px; }
  .view > .card .row > .muted { overflow-wrap: anywhere; }
  .data-safety-actions { width: 100%; grid-template-columns: minmax(0, 1fr) auto auto; }
  .slot-panel select { min-width: 0; max-width: 100%; }
  #view-data-materials #dataMaterialsTable { min-width: 1120px; }
  .data-materials-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .data-materials-controls .data-site { grid-column: 1 / -1; max-width: 100%; }
  .data-materials-controls #dataMaterialsFilter { max-width: 100%; }
  .field, .field.wide { grid-template-columns: minmax(0, 1fr); }
  .field input[type="text"], .field input[type="password"], .field input[type="number"], .field select { min-height: 40px; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea,
  .equip-row input, .equip-row select, .safety-toolbar input, .safety-toolbar select,
  .safety-panel select, .ops-control input, .ops-control select { font-size: 16px; }
  input[type="date"] { max-width: 100%; }
  .modal { padding: 10px; }
  .modal-card { min-width: 0; padding: 12px; max-height: calc(100dvh - 20px); overflow-y: auto; }
  .modal-card > .table-wrap { overflow-x: auto; }
  .modal-card > .table-wrap table:has(th:nth-child(4)) { min-width: 480px; }
  #map { min-height: min(380px, 55vh); height: 57vh; }
  #view-stats .table-wrap { max-height: max(220px, 55vh); }
  #phoneBody .phone-field { flex-wrap: wrap; gap: 4px !important; }
  #phoneBody .phone-connection-field { flex-direction: column; align-items: stretch !important; gap: 4px !important; }
  #phoneBody .phone-connection-field > :is(span, input) { width: 100% !important; max-width: 100% !important; flex: auto !important; }
  #phoneBody .phone-kpis > .card { margin: 0; overflow-wrap: anywhere; }
  #ph_infraLines { overflow-wrap: anywhere; }
  .log-controls { width: 100%; }
  .log-controls > label { min-width: min(100%, 120px); flex: 1 1 120px; }
  .server-files-layout { grid-template-columns: minmax(0, 1fr); }
  .safety-header h2 { font-size: 20px; }
  .safety-toolbar, .ops-toolbar { width: 100%; gap: 6px 8px; }
  .safety-toolbar .safety-status { flex-basis: 100%; }
  .safety-control, .ops-control { min-width: 0; margin: 0; }
  .safety-control select, .ops-control select { max-width: min(100%, 210px); }
  .safety-summary-card, .safety-kpi, .safety-panel { padding: 10px; }
  .safety-card-icon { width: 29px; height: 29px; }
  .safety-summary-value { font-size: 19px; }
  .safety-kpi-value { font-size: 22px; }
  .safety-overview, .safety-kpis, .safety-panel-grid, .ops-grid { gap: 8px; }
  .safety-panel-grid, .safety-table-panel { margin-bottom: 10px; }
}

@media (max-width: 380px) {
  .data-safety-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-safety-actions select { grid-column: 1 / -1; }
}

@media (max-width: 600px) and (min-width: 375px) {
  .safety-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.kpi-delta { margin-left: 4px; font-weight: 600; white-space: nowrap; }
.kpi-star-low { background: #fdecea !important; color: #b03a2e !important; font-weight: 700; }
.kpi-trend-rise { color: #155bc1; }
.kpi-rating-change { background: #f3f6fa; font-weight: 600; }
.kpi-trend-fall { color: #b91c1c; }

/* 安卓/非 iOS 手机：登录卡片顶部对齐，避免键盘弹出或浏览器工具栏挤压后显示不全 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (max-width: 600px) {
  .login-wrap {
    align-items: flex-start;
    padding-top: max(24px, 8vh);
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    min-height: 100vh;
    min-height: 100dvh;
  }
}
@supports (-webkit-touch-callout: none) {
  @media (max-width: 600px) {
    .login-wrap { align-items: center; padding-top: 24px; padding-bottom: 24px; }
  }
}

/* 安卓手机：强制内容区/卡片占满可视宽度，避免出现只占左侧一条的布局 */
@media (max-width: 860px) {
  #app, .content, main, main > .view, .view > .card { width: 100% !important; max-width: 100% !important; }
  main { padding-left: 12px; padding-right: 12px; }
  .view > .card, .grid > .card, .stat { width: 100%; min-width: 0; }
  .grid { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { overflow-wrap: anywhere; }
}

/* 异常骑手 */
.abnormal-board { min-width: 0; padding: 20px 22px; }
.abnormal-header, .abnormal-dialog-head, .abnormal-block-head {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
}
.abnormal-header h2, .abnormal-block-head h3, .abnormal-dialog-head h3 { margin: 0; }
.abnormal-header p { margin: 5px 0 0; }
.abnormal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.abnormal-statusbar {
  margin: 14px 0; padding: 9px 12px; border-radius: 8px;
  background: #f0f5fc; color: #405870; font-size: 13px; line-height: 1.55;
}
.abnormal-statusbar:empty { display: none; }
.abnormal-toolbar {
  display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0 0 14px;
}
.abnormal-toolbar label { display: grid; gap: 3px; min-width: 0; color: #405870; font-size: 13px; }
.abnormal-toolbar :is(select, input) { width: 100%; padding: 8px 10px; min-height: 38px; }
.abnormal-toolbar select { max-width: 250px; }
.abnormal-toolbar .abnormal-search { flex: 1 1 230px; max-width: 400px; }
.abnormal-summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); gap: 10px; margin-bottom: 16px;
}
.abnormal-board button.abnormal-summary {
  display: grid; gap: 6px; min-width: 0; padding: 10px 13px; text-align: left;
  border: 1px solid var(--line); border-top: 3px solid var(--abnormal-tone, #becbdd);
  border-radius: 9px; background: #fff; color: #364b64;
}
.abnormal-board button.abnormal-summary[aria-pressed="true"] {
  border-color: var(--abnormal-tone, #7994b3); background: #f6f9ff;
}
.abnormal-board .abnormal-summary strong { font-size: 22px; color: #20364e; }
.abnormal-board .abnormal-summary small { font-size: 12px; font-weight: 400; }
.abnormal-board .tone-total { --abnormal-tone: #577fae; }
.abnormal-board :is(.tone-attendance, .tag-attendance) { --abnormal-tone: #ce9b54; }
.abnormal-board .tone-shift { --abnormal-tone: #987bcc; }
.abnormal-board .tone-data { --abnormal-tone: #6b9fd5; }
.abnormal-board .tone-improved { --abnormal-tone: #52a685; }
.abnormal-board .tone-declined { --abnormal-tone: #d97978; }
.abnormal-block-head { margin: 0 0 9px; }
.abnormal-block-head h3 { font-size: 15px; }
.abnormal-switch { display: flex; gap: 4px; padding: 3px; background: #edf2f8; border-radius: 8px; }
.abnormal-board .abnormal-switch button {
  border: 0; padding: 6px 11px; background: transparent; color: #405870; border-radius: 6px;
}
.abnormal-board .abnormal-switch button[aria-pressed="true"] { background: #fff; color: #144c88; font-weight: 700; }
.abnormal-table-wrap {
  max-height: min(62vh, 760px); overflow: auto; border: 1px solid var(--line);
  border-radius: 10px; background: #fff;
}
.abnormal-table { min-width: 620px; border-collapse: separate; border-spacing: 0; }
#dataAbnormalOverviewTable { min-width: 820px; }
.abnormal-table thead th {
  position: sticky; top: 0; z-index: 1; padding: 10px 12px; white-space: nowrap;
  background: #eff4fa; color: #405870;
}
.abnormal-table tbody td { padding: 9px 12px; vertical-align: middle; color: #253a51; }
.abnormal-table tbody tr:nth-child(even) td { background: #f8fbff; }
.abnormal-table tbody tr:hover td { background: #f1f6fc; }
.abnormal-table tbody tr:last-child td { border-bottom: 0; }
.abnormal-identity { min-width: 136px; }
.abnormal-identity small, .abnormal-shift-riders small { display: block; font-size: 12px; color: #536981; }
.abnormal-reasons, .abnormal-dialog-body { display: grid; gap: 5px; }
.abnormal-reason { display: flex; align-items: baseline; gap: 7px; }
.abnormal-reason small { color: #60758b; white-space: nowrap; }
.abnormal-tag {
  display: inline-block; padding: 2px 8px; border-radius: 5px; white-space: nowrap;
  background: #eef3f8; color: #455c73; font-size: 12px; font-weight: 600;
}
.abnormal-tag.tag-attendance { background: #fff1da; color: #8a530a; }
.abnormal-tag.tag-shift { background: #f2ebff; color: #603ca0; }
.abnormal-tag.tag-data { background: #e8f2ff; color: #195b9c; }
.abnormal-tag.tag-improved { background: #e7f6ee; color: #146444; }
.abnormal-tag.tag-declined { background: #fcecec; color: #a72c2e; }
.abnormal-table .abnormal-link {
  appearance: none; border: 0; background: transparent; padding: 5px 0; color: #185d9f; white-space: nowrap;
}
.abnormal-table .abnormal-link:hover { text-decoration: underline; }
.abnormal-compare { display: inline-flex; gap: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.abnormal-improved { color: #146444; }
.abnormal-declined { color: #a72c2e; }
.abnormal-table .abnormal-empty { padding: 24px 12px; text-align: center; }
.abnormal-dialog {
  width: min(680px, calc(100% - 28px)); max-height: 84vh; max-height: 84dvh; padding: 0;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text);
}
.abnormal-dialog::backdrop { background: rgb(21 34 52 / 48%); }
.abnormal-dialog-head { position: sticky; top: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.abnormal-dialog-body { padding: 14px 16px 18px; }
.abnormal-dialog-meta { margin: 0 0 5px; }
.abnormal-dialog-body h4 { margin: 9px 0 3px; }
.abnormal-dialog-body ul { margin: 0; padding-left: 20px; }
.abnormal-dialog-body li + li { margin-top: 4px; }
.abnormal-dialog-body .abnormal-shift-riders { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 7px; padding: 0; list-style: none; }
.abnormal-dialog-body .abnormal-shift-riders li { padding: 7px 9px; margin: 0; background: #f2f6fb; border-radius: 6px; }
.abnormal-trend-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 6px 0; }
.abnormal-trend-metrics div { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; }
.abnormal-trend-metrics dd { margin: 2px 0 0; }
@media (max-width: 650px) {
  .abnormal-board { padding: 12px; }
  .abnormal-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .abnormal-toolbar .abnormal-search { max-width: none; }
  .abnormal-toolbar select { max-width: 220px; }
}

/* 排班达成：四/五班次占比列居中 */
th.reach-band, td.reach-band { text-align: center; white-space: nowrap; }


/* 排班达成：四/五班次占比列收窄，避免占满右侧空间 */
#dboardReachTable th.reach-band, #dboardReachTable td.reach-band { width: 1%; min-width: 76px; max-width: 96px; padding-left: 4px; padding-right: 4px; text-align: center; white-space: nowrap; }


/* 排班达成：列宽重新分配，左侧站点/班次收紧，右侧四/五班次加宽 */
#dboardReachTable, #boardReachTable { table-layout: fixed; }
#dboardReachTable th:first-child, #boardReachTable th:first-child { width: 10%; }
#dboardReachTable th:nth-child(n+2):nth-child(-n+10),
#boardReachTable th:nth-child(n+2):nth-child(-n+10) { width: 8.1%; }
#dboardReachTable th.reach-band, #dboardReachTable td.reach-band,
#boardReachTable th.reach-band, #boardReachTable td.reach-band {
  width: 8.55%; min-width: 100px; max-width: none; text-align: center; white-space: nowrap;
}


/* 异常骑手名单内嵌 KPI */
.abnormal-kpi-board { padding-bottom: 10px; }
.abnormal-kpi-frame {
  display: block; box-sizing: border-box; width: 100%; height: 460px;
  margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: #f4f7fb;
}

/* 实时看板：列标题排序，漏斗筛选。使用原生下拉保留键盘导航。 */
#dboardTable thead th { padding: 5px 4px; font-size: 12px; }
.board-column-head { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; }
#dboardTable .board-column-sort {
  display: inline-flex; align-items: center; gap: 3px;
  min-height: 24px; padding: 0; border: 0; background: transparent;
  font: inherit; color: inherit; white-space: nowrap;
}
.board-column-sort span { color: #617489; }
#dboardTable th[aria-sort] .board-column-sort span,
#dboardTable .board-column-sort:hover { color: #155fb9; }
#dboardTable .board-column-sort:focus-visible {
  outline: 2px solid #236cc2; outline-offset: -2px; border-radius: 4px;
}
.board-column-filter {
  display: inline-grid; place-items: center; position: relative; flex: none;
  width: 22px; height: 24px; border: 1px solid transparent; border-radius: 4px;
  color: #486684;
}
.board-column-filter::before {
  content: ""; width: 12px; height: 12px; background: currentColor;
  clip-path: polygon(0 8%, 100% 8%, 62% 53%, 62% 78%, 40% 94%, 40% 53%);
}
.board-column-filter:hover, .board-column-filter:focus-within {
  background: #e8f1fc; border-color: #94b7df;
}
.board-column-filter.is-active { color: #074f9e; background: #e0edff; border-color: #7cace3; }
.board-column-filter select {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; padding: 0; opacity: 0; cursor: pointer;
}

/* 实时看板：表格区域随视口拉高，填满下方空白 */
#dboardPaneMain .table-wrap { max-height: calc(100vh - 250px); }
@media (max-height: 760px) {
  #dboardPaneMain .table-wrap { max-height: calc(100vh - 210px); }
}

/* KPI 看板：整齐居中、低饱和表头、统一表格卡片 */
#dboardPaneKpi, #boardPaneKpi { --kpi-head:#eef3f8; --kpi-head-strong:#e5edf5; --kpi-line:#dfe8f1; --kpi-text:#31465b; }
#dboardPaneKpi .board-sub, #boardPaneKpi .board-sub { margin:20px 0 8px; font-size:15px; font-weight:700; color:#31465b; letter-spacing:.2px; }
#dboardPaneKpi .table-wrap, #boardPaneKpi .table-wrap {
  border:1px solid #e2eaf2 !important;
  border-radius:12px !important;
  background:#fff;
  box-shadow:0 1px 2px rgba(36,58,81,.04);
  margin-bottom:14px;
}
#dboardPaneKpi table, #boardPaneKpi table {
  border-collapse:separate;
  border-spacing:0;
  width:max-content;
  min-width:100%;
  font-variant-numeric:tabular-nums;
}
#dboardPaneKpi th, #dboardPaneKpi td,
#boardPaneKpi th, #boardPaneKpi td {
  text-align:center !important;
  vertical-align:middle;
  white-space:nowrap;
  padding:10px 12px;
  border-bottom:1px solid #edf2f7;
  color:var(--kpi-text);
  font-size:12.5px;
}
#dboardPaneKpi thead th, #boardPaneKpi thead th {
  background:linear-gradient(180deg,#f2f6fa,#e9f0f6);
  color:#3b5268;
  font-weight:700;
  border-bottom:1px solid var(--kpi-line);
  letter-spacing:.2px;
}
#dboardPaneKpi thead tr:first-child th, #boardPaneKpi thead tr:first-child th {
  background:linear-gradient(180deg,#edf3f8,#e3ebf3);
  color:#354c62;
  font-weight:700;
}
#dboardPaneKpi tbody td, #boardPaneKpi tbody td { font-weight:500; }
#dboardPaneKpi tbody tr:nth-child(even), #boardPaneKpi tbody tr:nth-child(even) { background:#fbfcfe; }
#dboardPaneKpi tbody tr:hover, #boardPaneKpi tbody tr:hover { background:#f5f9fc; }
#dboardPaneKpi tbody tr:last-child td, #boardPaneKpi tbody tr:last-child td { border-bottom:0; }
#dboardPaneKpi tr > *:first-child, #boardPaneKpi tr > *:first-child {
  text-align:center !important;
  font-weight:600;
}
#dboardPaneKpi #dboardKpiRating th, #dboardPaneKpi #dboardKpiRating td,
#boardPaneKpi #boardKpiRating th, #boardPaneKpi #boardKpiRating td { padding:9px 12px; }

/* KPI 表格实际用 tbody 包表头，按行选择器统一表头底色 */
#dboardPaneKpi tr:first-child > th,
#boardPaneKpi tr:first-child > th {
  background: linear-gradient(180deg,#edf3f8,#e3ebf3) !important;
  color:#354c62 !important;
  font-weight:700 !important;
  border-bottom:1px solid #d8e3ee !important;
}
#dboardPaneKpi tr:nth-child(2) > th,
#boardPaneKpi tr:nth-child(2) > th {
  background: linear-gradient(180deg,#f3f7fb,#eaf1f7) !important;
  color:#3b5268 !important;
  font-weight:700 !important;
  border-bottom:1px solid #d8e3ee !important;
}

/* KPI 看板：保留涨跌箭头颜色，统一列间距 */
#dboardPaneKpi th, #dboardPaneKpi td,
#boardPaneKpi th, #boardPaneKpi td {
  padding:10px 14px !important;
  line-height:1.5;
}
#dboardPaneKpi td.kpi-trend-rise, #boardPaneKpi td.kpi-trend-rise {
  color:#155bc1 !important;
  background:#f4f8ff;
  font-weight:600;
}
#dboardPaneKpi td.kpi-trend-fall, #boardPaneKpi td.kpi-trend-fall {
  color:#b91c1c !important;
  background:#fff7f6;
  font-weight:600;
}
#dboardPaneKpi td.kpi-rating-change, #boardPaneKpi td.kpi-rating-change {
  color:#7a5a13 !important;
  background:#fbf8ef;
  font-weight:600;
}
#dboardPaneKpi .kpi-trend-rise span, #dboardPaneKpi .kpi-trend-fall span,
#boardPaneKpi .kpi-trend-rise span, #boardPaneKpi .kpi-trend-fall span {
  font-weight:700;
}

/* KPI 右侧星级表：名称列固定，其余每列等宽，避免星级初始被撑宽 */
#dboardPaneKpi #dboardKpiScoreRight,
#boardPaneKpi #boardKpiScoreRight {
  table-layout: fixed;
  width: 100% !important;
}
#dboardPaneKpi #dboardKpiScoreRight tr:first-child > th:first-child,
#boardPaneKpi #boardKpiScoreRight tr:first-child > th:first-child {
  width: 280px;
}
#dboardPaneKpi #dboardKpiScoreRight tr:nth-child(2) > th:first-child,
#boardPaneKpi #boardKpiScoreRight tr:nth-child(2) > th:first-child {
  width: auto !important;
  min-width: 0 !important;
  text-align: center !important;
}
#dboardPaneKpi #dboardKpiScoreRight td:first-child,
#boardPaneKpi #boardKpiScoreRight td:first-child {
  width: 280px;
  text-align: center !important;
}

/* 手机端覆盖 KPI 右表的 fixed 布局，否则 10 列被压进手机宽度，表头文字叠在一起 */
@media (max-width: 860px) {
  #dboardPaneKpi #dboardKpiScoreRight,
  #boardPaneKpi #boardKpiScoreRight {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 1180px !important;
  }
  #dboardPaneKpi #dboardKpiScoreRight tr:first-child > th:first-child,
  #boardPaneKpi #boardKpiScoreRight tr:first-child > th:first-child {
    width: auto !important;
    min-width: 220px !important;
  }
  #dboardPaneKpi #dboardKpiScoreRight tr:nth-child(2) > th:first-child,
  #boardPaneKpi #boardKpiScoreRight tr:nth-child(2) > th:first-child {
    width: auto !important;
    min-width: 0 !important;
  }
  #dboardPaneKpi #dboardKpiScoreRight td:first-child,
  #boardPaneKpi #boardKpiScoreRight td:first-child {
    width: auto !important;
    min-width: 220px !important;
    text-align: left !important;
  }
}

/* KPI 运营评级看板：内容少，字号放大 */
#dboardPaneKpi #dboardKpiRating th,
#dboardPaneKpi #dboardKpiRating td,
#boardPaneKpi #boardKpiRating th,
#boardPaneKpi #boardKpiRating td {
  font-size: 14px !important;
  padding: 12px 16px !important;
}

/* 2026-12-06 排班未上线明细：未背单（否）标红 */
.att-no-order { color: #c0392b; font-weight: 700; }
