:root {
  color-scheme: light;
  --ink: #21352d;
  --muted: #65766d;
  --line: #d9e2dc;
  --canvas: #f3f6f3;
  --paper: #ffffff;
  --green: #17664c;
  --green-soft: #edf7f0;
  --blue: #285c91;
  --blue-soft: #eef5fb;
  --red: #a63d32;
  --red-soft: #fff1ef;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.55 "Segoe UI", "Microsoft YaHei", sans-serif;
}
button { font: inherit; }
.shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 26px 0 44px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 22px; }
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: 12px; }
h1 { margin: 0; font-size: 25px; line-height: 1.25; }
.service-state { display: flex; align-items: center; gap: 9px; color: var(--green); font-weight: 650; }
.state-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #398b66; }
.service-state.stopped { color: var(--red); }
.service-state.stopped .state-dot { background: var(--red); }
.worker-strip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0; padding: 13px 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.worker-strip div { min-width: 0; padding: 0 12px; border-right: 1px solid var(--line); }
.worker-strip div:first-child { padding-left: 0; }
.worker-strip div:last-child { padding-right: 0; border-right: 0; }
.worker-strip span, .worker-strip strong { display: block; overflow-wrap: anywhere; }
.worker-strip span { color: var(--muted); font-size: 12px; }
.worker-strip strong { margin-top: 3px; font-size: 14px; font-weight: 650; }
.coverage-line { display: flex; justify-content: space-between; gap: 14px; margin-top: 12px; padding: 11px 14px; border-left: 3px solid #b17820; background: #fff8e9; }
.coverage-line strong { font-size: 13px; }
.coverage-line span { color: #735315; font-size: 13px; overflow-wrap: anywhere; }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.category { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; align-items: end; min-width: 0; min-height: 122px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); text-align: left; cursor: pointer; }
.category:hover { border-color: #9db8a8; }
.category.selected { outline: 2px solid currentColor; outline-offset: 1px; }
.category.accepted { color: var(--green); background: var(--green-soft); }
.category.pending { color: var(--blue); background: var(--blue-soft); }
.category.rejected { color: var(--red); background: var(--red-soft); }
.category-label { grid-column: 1 / 2; font-size: 15px; font-weight: 700; }
.category-count { grid-column: 2 / 3; grid-row: 1 / 3; color: var(--ink); font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.category-unit { grid-column: 1 / 2; margin-top: 12px; color: var(--muted); font-size: 12px; }
.material-link { display: inline-flex; align-items: center; min-height: 34px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--blue); text-decoration: none; }
.material-link:hover { border-color: var(--blue); background: var(--blue-soft); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.list-section { margin-top: 23px; }
.list-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.list-controls { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.list-controls select { min-width: 150px; height: 36px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); font: inherit; }
h2 { margin: 0; font-size: 18px; }
.list-heading p, #updated-at { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.item-list { display: grid; }
.item { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr) minmax(220px, 2fr) auto; gap: 16px; align-items: center; padding: 12px 3px; border-bottom: 1px solid var(--line); }
.item-title { min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.item-meta, .item-detail { min-width: 0; overflow-wrap: anywhere; color: var(--muted); font-size: 13px; }
.item-actions { display: flex; flex: 0 0 auto; gap: 6px; }
.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin: 10px 0; }
.pagination[hidden] { display: none; }
.pagination-pages, .page-numbers, .pagination-jump { display: flex; align-items: center; gap: 5px; }
.page-button { display: inline-flex; justify-content: center; align-items: center; min-width: 36px; min-height: 36px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); font: inherit; cursor: pointer; }
.page-button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.page-button.current { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.page-button:disabled { cursor: default; opacity: .5; }
.page-ellipsis { min-width: 20px; color: var(--muted); text-align: center; }
.pagination-jump { color: var(--muted); font-size: 13px; }
.pagination-jump input { width: 58px; height: 36px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); font: inherit; }
.pagination-error { width: 100%; color: var(--red); font-size: 12px; text-align: right; }
.empty-state { padding: 34px 0; color: var(--muted); text-align: center; }
footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
@media (max-width: 1000px) and (min-width: 761px) {
  .worker-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 13px; }
  .worker-strip div:nth-child(4n) { border-right: 0; }
  .worker-strip div:nth-child(5) { padding-left: 0; }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 28px); max-width: 620px; padding-top: 18px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .worker-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 13px; }
  .worker-strip div:nth-child(2n) { border-right: 0; }
  .worker-strip div:nth-child(odd) { padding-left: 0; }
  .coverage-line { flex-direction: column; gap: 3px; }
  .category-grid { grid-template-columns: 1fr; gap: 6px; }
  .category { grid-template-columns: 1fr auto; grid-template-rows: auto; align-items: center; min-height: 54px; padding: 8px 12px; }
  .category-label { grid-column: 1; grid-row: 1; font-size: 13px; }
  .category-count { grid-column: 2; grid-row: 1; justify-self: end; font-size: 22px; }
  .category-unit { display: none; }
  .list-heading { align-items: flex-start; flex-direction: column; }
  .list-controls { width: 100%; flex-wrap: wrap; }
  .list-controls select { flex: 1 1 170px; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .pagination-pages { width: 100%; gap: 3px; }
  .page-button { min-width: 32px; min-height: 34px; padding: 4px 6px; font-size: 13px; }
  .pagination-jump { align-self: flex-end; }
  .item { grid-template-columns: 1fr; gap: 3px; padding: 11px 0; }
  .item-actions { margin-top: 5px; }
  footer { flex-direction: column; gap: 4px; }
}
