:root {
  --tblr-primary: #206bc4;
  --tblr-font-sans-serif:
    "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --tblr-body-bg: #f6f8fb;
  --tblr-body-color: #182433;
}
.legacy-panel h3 {
  margin-top: 24px;
}
.legacy-panel form > label,
.legacy-panel #legacy-images,
.legacy-panel #legacy-text {
  margin-top: 14px;
}
.legacy-items {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.legacy-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid #e1e6ed;
  border-radius: 6px;
  padding: 14px;
}
.legacy-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 76px;
  background: #f6f8fb;
  border-radius: 4px;
  color: #52677d;
  font-size: 12px;
}
.legacy-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.legacy-item-body {
  min-width: 0;
}
.legacy-filename,
.legacy-item-status,
#legacy-notice,
#legacy-summary {
  overflow-wrap: anywhere;
}
.legacy-filename {
  display: block;
  margin-bottom: 9px;
  color: #52677d;
}
.legacy-item-status {
  margin: 9px 0 0;
}
.legacy-actions {
  flex-wrap: wrap;
}
.match-correction #match-query-form,
.match-correction #match-edit-form,
.match-correction #match-outcome:not(:empty) {
  margin-top: 20px;
}
.match-correction .filter > label {
  flex: 1 1 320px;
  min-width: 0;
}
.match-correction .filter {
  align-items: end;
}
.match-correction td,
.match-correction p,
.match-correction .notice,
.match-correction #match-selection {
  overflow-wrap: anywhere;
}
.match-correction .actions {
  flex-wrap: wrap;
}
.match-preview.card {
  margin-top: 18px;
  padding: 18px;
  border-color: #c7d8ef;
  background: #f6f9fd;
}
.match-preview h3 {
  margin-bottom: 14px;
}
.match-preview details {
  margin: 14px 0;
}
.match-preview .table-wrap {
  margin-top: 10px;
}
.monthly-correction > summary {
  font-size: 17px;
  font-weight: 600;
}
.monthly-correction > p,
.monthly-correction form,
.monthly-report,
.monthly-correction #monthly-history {
  margin-top: 18px;
}
.monthly-correction .filter {
  align-items: end;
}
.monthly-correction .actions {
  flex-wrap: wrap;
}
.monthly-correction textarea {
  margin-top: 8px;
}
.monthly-correction td,
.monthly-correction p,
.monthly-correction .notice,
.monthly-correction h4 {
  overflow-wrap: anywhere;
}
.monthly-report {
  border-top: 1px solid #d7e4f6;
  padding-top: 20px;
}
.monthly-employees {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.monthly-employee.card {
  padding: 16px;
  min-width: 0;
  background: #f6f9fd;
}
.monthly-employee h4 {
  margin: 0 0 10px;
}
.monthly-pay {
  width: 100%;
  table-layout: fixed;
  font-size: 13px;
}
.monthly-pay td,
.monthly-pay th {
  padding: 8px 5px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.monthly-pay td:not(:first-child),
.monthly-pay th:not(:first-child) {
  text-align: right;
}
.monthly-pending {
  padding: 10px;
  background: #fff8e8;
  border-radius: 5px;
}
.monthly-pending p:last-child {
  margin-bottom: 0;
}
.monthly-history-list article {
  padding: 14px 0;
  border-bottom: 1px solid #e1e6ed;
}
@media (max-width: 600px) {
  .legacy-item {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }
  .legacy-thumb {
    height: 52px;
  }
  .legacy-actions button {
    width: 100%;
    white-space: normal;
  }
  .match-correction .filter,
  .match-correction .actions {
    flex-direction: column;
    align-items: stretch;
  }
  .match-correction .filter > label {
    flex: 1 1 auto;
  }
  .match-correction button {
    white-space: normal;
    max-width: 100%;
  }
  .match-preview.card {
    padding: 14px;
  }
  .monthly-employees {
    grid-template-columns: minmax(0, 1fr);
  }
  .monthly-correction .filter,
  .monthly-correction .actions {
    flex-direction: column;
    align-items: stretch;
  }
  .monthly-correction button {
    white-space: normal;
    max-width: 100%;
  }
}
[hidden] {
  display: none !important;
}
body {
  font-family: var(--tblr-font-sans-serif);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button.btn {
  min-height: 40px;
}
input.form-control,
select.form-select {
  min-height: 42px;
}
textarea {
  min-height: 90px;
}
label.form-label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-weight: 500;
  margin-bottom: 0;
}
h1 {
  font-size: 26px;
  line-height: 1.35;
  margin: 0 0 8px;
  font-weight: 650;
}
h2 {
  font-size: 17px;
  margin: 0 0 18px;
  font-weight: 600;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
p {
  line-height: 1.65;
}
small,
.muted {
  color: #52677d;
}
.layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: white;
  border-right: 1px solid #e1e6ed;
  padding: 32px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 2;
}
.brand {
  font-size: 22px;
  letter-spacing: 1px;
  font-weight: 700;
  padding: 0 16px 6px;
  color: #182433;
}
.brand-sub {
  font-size: 12px;
  color: #52677d;
  padding: 0 16px 32px;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar nav button {
  justify-content: flex-start;
  text-align: left;
  color: #465a70;
  border: 0;
  border-radius: 6px;
  padding: 12px 16px;
  background: transparent;
  box-shadow: none;
  font-weight: 500;
}
.sidebar nav button.active {
  background: #e9f1fc;
  color: #206bc4;
  font-weight: 650;
  border-left: 3px solid #206bc4;
}
.sidebar footer {
  position: absolute;
  bottom: 28px;
  padding: 12px;
  color: #52677d;
  font-size: 11px;
  line-height: 1.8;
}
.main.page-wrapper {
  display: block;
  min-width: 0;
  margin: 0;
}
header.navbar {
  height: 74px;
  background: white;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #e1e6ed;
  box-shadow: none;
}
header strong {
  font-size: 14px;
}
header button {
  margin-left: 6px;
}
main {
  padding: 28px 32px;
  max-width: 1520px;
  margin: auto;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
}
.heading p {
  margin: 0;
}
.section-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #52677d;
  font-weight: 600;
  margin-bottom: 8px;
}
.panel.card {
  padding: 24px;
  margin-bottom: 24px;
  border-radius: 8px;
  box-shadow: 0 1px 2px #18243303;
}
.hero.card {
  background: #edf3fc;
  border-color: #d7e4f6;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.hero h2 {
  font-size: 22px;
  margin-bottom: 8px;
}
.hero p {
  margin-bottom: 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat.card {
  padding: 20px;
}
.stat b {
  display: block;
  font-size: 28px;
  margin: 8px 0;
  line-height: 1.3;
  color: #182433;
}
.cols {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-grid + label {
  margin-top: 16px;
}
form > label + label {
  margin-top: 16px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.badge {
  font-weight: 500;
  padding: 6px 9px;
  font-size: 12px;
  letter-spacing: 0;
}
.badge.bg-green-lt {
  color: #216747 !important;
}
.badge.bg-yellow-lt {
  color: #805c0e !important;
}
.notice {
  padding: 14px 16px;
  background: #fff6dc;
  color: #78580c;
  border: 1px solid #f1e2b5;
  border-radius: 6px;
  line-height: 1.6;
  margin: 14px 0;
}
.table-wrap {
  overflow: auto;
}
.table {
  font-size: 14px;
  margin: 0;
}
.table th {
  font-size: 11px;
  letter-spacing: 0.3px;
  color: #52677d;
  background: #f6f8fb;
  font-weight: 600;
  padding: 13px 12px;
}
.table td {
  padding: 14px 12px;
}
.table td.code {
  overflow-wrap: anywhere;
  max-width: 340px;
}
.batch-list .table {
  table-layout: fixed;
  width: 100%;
}
.batch-list .table th,
.batch-list .table td,
.batch-list .batch-state {
  white-space: normal;
  overflow-wrap: anywhere;
}
.batch-list .batch-meta {
  display: block;
  color: #66788a;
  margin-top: 6px;
}
.batch-list .batch-state {
  display: inline-block;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
}
.batch-state-included {
  background: #e8f5ed;
  color: #216747;
}
.batch-state-inactive {
  background: #eef1f5;
  color: #52677d;
}
.batch-state-pending {
  background: #fff6dc;
  color: #805c0e;
}
.table td img,
.thumb {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: #f2f5f8;
  border-radius: 6px;
}
.table td button.btn {
  padding: 5px 11px;
  min-height: 32px;
}
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 18px;
  font-size: 12px;
}
.page-number {
  padding: 8px 12px;
}
.empty {
  text-align: center;
  padding: 40px !important;
  color: #52677d;
}
.login {
  max-width: 440px;
  margin: 10vh auto;
  padding: 36px !important;
}
.login label {
  margin: 18px 0;
}
.login button {
  width: 100%;
}
.login .section-label {
  color: #206bc4;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #182433;
  color: white;
  padding: 14px 22px;
  border-radius: 8px;
  max-width: 90%;
  display: none;
  z-index: 20;
  box-shadow: 0 4px 20px #18243333;
}
.clock {
  font-size: 44px;
  font-weight: 600;
  margin: 24px 0;
  line-height: 1.3;
}
.clock-buttons {
  display: flex;
  gap: 16px;
}
.clock-buttons button {
  flex: 1;
  min-height: 72px !important;
  font-size: 20px;
}
.detail {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  line-height: 1.7;
  margin: 24px 0;
}
.detail dt {
  color: #52677d;
  font-weight: 500;
}
.detail dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.list-row {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #edf0f4;
}
.list-row > div {
  flex: 1;
}
.list-row p {
  margin: 6px 0 0;
}
.money {
  font-size: 34px;
  font-weight: 650;
  color: #182433;
  white-space: nowrap;
}
.payroll-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.split {
  display: flex;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid #edf0f4;
}
details {
  margin: 12px 0;
}
details.panel.card {
  display: block;
}
summary {
  cursor: pointer;
  padding: 10px 0;
  font-weight: 600;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.filter {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.filter > * {
  flex: 1;
  min-width: 0;
}
progress {
  width: 100%;
  accent-color: #206bc4;
  height: 8px;
}
.mobile-only {
  display: none;
}
.sku-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.sku-tile {
  padding: 16px;
}
.sku-tile img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: #f6f8fb;
  border-radius: 5px;
  margin-bottom: 14px;
}
.sku-tile strong {
  display: block;
  overflow-wrap: anywhere;
  margin-bottom: 8px;
}
.sku-tile .btn {
  margin-top: 12px;
}
.gallery-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
@media (max-width: 1000px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cols {
    grid-template-columns: 1fr;
  }
  .layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .sidebar {
    padding: 24px 10px;
  }
  main {
    padding: 24px 20px;
  }
  header.navbar {
    padding: 16px 20px;
  }
  .sku-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .payroll-summary {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  button.btn {
    min-height: 44px;
  }
  .responsive td button.btn {
    min-height: 44px;
  }
  .layout {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid #e1e6ed;
  }
  .brand {
    font-size: 19px;
    display: inline;
    padding: 0;
  }
  .brand-sub,
  .sidebar footer {
    display: none;
  }
  .sidebar nav {
    flex-direction: row;
    overflow: auto;
    margin-top: 14px;
    gap: 5px;
  }
  .sidebar nav button {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 9px 12px;
    min-height: 42px !important;
  }
  .sidebar nav button.active {
    border-left: 0;
    border-bottom: 2px solid #206bc4;
  }
  .sidebar nav.nav {
    flex-wrap: nowrap;
  }
  header.navbar {
    height: auto;
    padding: 12px 16px;
    font-size: 11px;
    flex-wrap: wrap;
  }
  header.navbar button {
    font-size: 11px;
    padding: 6px;
    min-height: 32px;
  }
  .main.page-wrapper {
    min-height: auto;
  }
  main {
    padding: 24px 16px;
  }
  .heading {
    display: block;
  }
  .heading button {
    margin-top: 12px;
  }
  h1 {
    font-size: 24px;
  }
  .hero.card {
    display: block;
    padding: 22px;
  }
  .hero button {
    margin-top: 16px;
  }
  .panel.card {
    padding: 18px;
  }
  .stat.card {
    padding: 16px;
  }
  .stat b {
    font-size: 25px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  input.form-control,
  select.form-select,
  textarea.form-control {
    font-size: 16px;
  }
  .filter {
    flex-wrap: wrap;
  }
  .filter > * {
    flex: 1 1 40%;
  }
  .detail {
    grid-template-columns: 100px 1fr;
  }
  .login {
    margin: 6vh 16px;
  }
  .clock {
    font-size: 36px;
  }
  .mobile-only {
    display: block;
  }
  .responsive thead {
    display: none;
  }
  .responsive tr {
    display: block;
    border-bottom: 1px solid #e1e6ed;
    padding: 12px 0;
  }
  .responsive td {
    display: block;
    border: 0;
    padding: 5px;
    max-width: 100%;
  }
  .responsive td:before {
    content: attr(data-label);
    color: #52677d;
    font-size: 12px;
    margin-right: 12px;
  }
  .table-footer {
    flex-wrap: wrap;
  }
  .sku-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sku-tile {
    padding: 12px;
  }
  .sku-tile img {
    height: 110px;
  }
  .grid {
    gap: 12px;
  }
}

.query-state {
  min-height: 150px;
  padding: 32px 20px;
  border: 1px solid #e1e6ed;
  border-radius: 6px;
  background: #f6f8fb;
  color: #52677d;
  text-align: center;
  overflow-wrap: anywhere;
}
.query-state p {
  margin: 0 0 14px;
}
.query-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}
.query-error {
  background: #fff6ed;
  border-color: #efd6ba;
  color: #7b4f1c;
}

.audit-table {
  table-layout: fixed;
  width: 100%;
}
.audit-table th:nth-child(1) {
  width: 22%;
}
.audit-table th:nth-child(2) {
  width: 16%;
}
.audit-table th:nth-child(3) {
  width: 25%;
}
.audit-table td,
.audit-table pre {
  white-space: normal;
  overflow-wrap: anywhere;
}
.audit-table td {
  vertical-align: top;
}
.audit-table details {
  margin: 0;
  min-width: 0;
}
.audit-table summary {
  padding: 0;
}
.audit-table pre {
  white-space: pre-wrap;
  max-width: 100%;
  margin-top: 12px;
}
#audit-workspace .table-footer {
  align-items: flex-start;
}
#audit-workspace .table-footer button {
  flex: 0 0 auto;
}
