:root {
  --nav: #0a2748;
  --nav-2: #103d6d;
  --accent: #0868b8;
  --accent-2: #177a58;
  --warn: #a76118;
  --danger: #c4182d;
  --ok: #16724f;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --soft: #eaf1f8;
  --line: #dbe4ee;
  --line-dark: #8293a6;
  --text: #12233a;
  --muted: #64748a;
  --shadow: 0 5px 18px rgba(20, 49, 83, 0.06);
  --radius: 8px;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body:not(.print-body) {
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 7px 11px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  font-weight: 650;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #f7fbff;
  box-shadow: 0 3px 10px rgba(8, 68, 120, 0.08);
}

button:active { transform: translateY(1px); }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(8, 104, 184, 0.18);
  outline-offset: 1px;
  border-color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.primary:hover,
button.success:hover {
  color: #fff;
  filter: brightness(0.96);
}

button.success {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}

button.danger {
  border-color: #e8b5b5;
  color: var(--danger);
}

button.small {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

button.icon-only,
.icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 9px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 82px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inline-check-control {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.inline-check-control input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.field-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.probation-end-date {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.warning-notice {
  border-left-color: #d6323e;
  background: #fff5f5;
  color: #7b2730;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 204px minmax(0, 1fr);
}

.sidebar {
  background: var(--nav);
  color: #fff;
  padding: 16px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid #173e69;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 6px 8px;
}

.brand-symbol,
.login-brand-symbol {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.brand-symbol .ui-icon,
.login-brand-symbol .ui-icon { width: 20px; height: 20px; }

.system-logo-mark {
  position: relative;
  display: inline-block;
  overflow: hidden;
  background: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.system-logo-mark .logo-stem,
.system-logo-mark .logo-bridge,
.system-logo-mark .logo-accent {
  position: absolute;
  display: block;
  border-radius: 1px;
}

.system-logo-mark .logo-stem {
  top: 9px;
  width: 6px;
  height: 21px;
  background: #0a315c;
}

.system-logo-mark .logo-stem-left { left: 9px; }
.system-logo-mark .logo-stem-right { right: 9px; }
.system-logo-mark .logo-bridge { left: 13px; top: 17px; width: 13px; height: 6px; background: #0868b8; }
.system-logo-mark .logo-accent { right: 5px; top: 5px; width: 11px; height: 4px; background: #e31c2b; transform: skew(-24deg); }

.brand-mark {
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 4px;
  flex: 0 0 auto;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand strong {
  display: block;
  font-size: 15px;
}

.brand span {
  display: block;
  color: #b8c8d8;
  font-size: 11px;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav button {
  border: 0;
  color: #c9daec;
  background: transparent;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 7px;
  text-align: left;
  font-weight: 600;
}

.nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

.nav button.active {
  background: #1166ad;
  color: #fff;
  box-shadow: inset 3px 0 0 #e31c2b, 0 5px 14px rgba(0, 0, 0, 0.14);
}

.nav .icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.nav .icon .ui-icon { width: 18px; height: 18px; }

.content {
  min-width: 0;
  display: grid;
  grid-template-rows: 60px 1fr;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 22px;
  box-shadow: 0 1px 0 rgba(15, 39, 70, 0.02);
}

.topbar h1 {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

.topbar .meta {
  color: var(--muted);
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 12px;
}

.language-selector {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #24517f;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.language-selector select {
  width: 118px;
  min-width: 0;
  height: 28px;
  padding: 3px 24px 3px 7px;
  color: var(--ink);
  background-color: #f7fafc;
}

.login-language {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -4px;
}

.page {
  padding: 16px 22px 24px;
  overflow: auto;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar input,
.toolbar select {
  width: auto;
  min-width: 170px;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  background: #fcfdff;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
}

.panel-body {
  padding: 14px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  border-top: 3px solid var(--accent);
}

.stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stat strong {
  display: block;
  font-size: 23px;
  margin-top: 6px;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.chart-total {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compact-chart {
  display: grid;
  gap: 10px;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(80px, 1fr) 28px;
  align-items: center;
  gap: 8px;
}

.chart-row > span {
  overflow: hidden;
  color: #3c5068;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-row > strong {
  color: var(--text);
  font-size: 12px;
  text-align: right;
}

.chart-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #e7edf4;
}

.chart-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #005bac;
}

.chart-track i.green {
  background: #177a58;
}

.chart-track i.contract {
  background: #bd6b1f;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 11px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #3c5068;
  background: #f5f8fc;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

tr:hover td {
  background: #f6faff;
}

.workorder-panel-header {
  gap: 12px;
}

.workorder-result-count {
  min-width: 48px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f1fa;
  color: #31506f;
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.workorder-print-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.workorder-filter-controls,
.workorder-print-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
}

.workorder-filter-controls label:not(.workorder-select-all) {
  min-width: 168px;
}

.workorder-select-all {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.workorder-checkbox,
.workorder-select-all input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.selection-summary {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid #d7e2ed;
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.selection-summary strong {
  color: var(--accent);
  font-size: 14px;
}

.workorder-check-cell {
  width: 42px;
  min-width: 42px;
  padding-right: 8px;
  padding-left: 12px;
  text-align: center;
}

.workorder-row-selected td,
.workorder-row-selected:hover td {
  background: #edf6ff;
}

.workorder-table td:nth-child(5) {
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .workorder-print-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workorder-print-actions {
    justify-content: flex-end;
  }
}

/* Keep row actions readable across employee, team, workorder and payroll tables. */
.page table td > button {
  vertical-align: middle;
  white-space: nowrap;
}

.page table td > button + button {
  margin-inline-start: 8px;
}

.page table td:has(> button + button) {
  min-width: 116px;
  white-space: nowrap;
}

.worker-cell {
  display: flex;
  gap: 10px;
  align-items: center;
}

.worker-probation-cell {
  display: grid;
  justify-items: start;
  gap: 4px;
  min-width: 112px;
  white-space: nowrap;
}

.worker-probation-cell strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.worker-probation-cell small,
.muted-text {
  color: var(--muted);
  font-size: 11px;
}

.employee-link {
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  padding: 3px 5px 3px 3px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.employee-link:hover {
  border-color: transparent;
  background: #eaf4fd;
  color: var(--accent);
  box-shadow: none;
}

.employee-link-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  flex: 1;
}

.employee-link-copy strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-link-copy small { color: var(--muted); font-size: 11px; }
.employee-link-arrow { width: 14px; height: 14px; opacity: 0; transform: translateX(-3px); transition: 0.15s ease; }
.employee-link:hover .employee-link-arrow { opacity: 1; transform: translateX(0); }

.avatar {
  width: 36px;
  height: 48px;
  border-radius: 6px;
  border: 0;
  object-fit: cover;
  background: var(--soft);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 800;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
  background: #e9f7ef;
  color: var(--ok);
}

.status.warn {
  background: #fff4df;
  color: var(--warn);
}

.status.danger {
  background: #ffe8e8;
  color: var(--danger);
}

.side-list {
  display: grid;
  gap: 10px;
}

.side-item {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px;
  display: grid;
  gap: 6px;
  background: #fff;
}

.side-item strong {
  font-size: 14px;
}

.side-item span {
  color: var(--muted);
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.ai-config {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #b7c6d6;
  border-radius: 8px;
  background: #f7fafc;
}

.ai-config-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #173d6a;
}

.ai-config-heading span,
.ai-config small {
  color: #5b6876;
  font-size: 12px;
}

.ai-config > label {
  display: grid;
  gap: 6px;
  max-width: 520px;
}

.ai-config .form-actions {
  margin-top: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 20, 34, 0.42);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 20;
}

.modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(5, 18, 32, 0.28);
  width: min(920px, 100%);
  max-height: 88vh;
  overflow: auto;
}

.modal:has(.warning-letter-editor) {
  width: min(1120px, 100%);
}

.dropzone {
  border: 2px dashed #a8b8c8;
  border-radius: 6px;
  background: #f8fbfd;
  padding: 28px;
  text-align: center;
}

.dropzone input {
  max-width: 420px;
  margin: 12px auto 0;
}

.review-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 14px;
  align-items: start;
}

.toolbar-title {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
}

.toolbar-subtitle {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.review-detail-toolbar .toolbar-left {
  align-items: center;
}

.review-queue-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}

.review-queue-summary > div {
  min-height: 70px;
  padding: 13px 16px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: center;
  gap: 4px;
}

.review-queue-summary > div:last-child { border-right: 0; }
.review-queue-summary span { font-size: 12px; color: var(--muted); }
.review-queue-summary strong { font-size: 23px; color: #075b9c; }

.review-queue-list { display: grid; }

.review-queue-item {
  display: grid;
  grid-template-columns: 48px minmax(170px, 1.2fr) minmax(110px, 0.7fr) minmax(200px, 1.15fr) minmax(190px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.review-queue-item:last-child { border-bottom: 0; }

.review-queue-index {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e7f1f8;
  color: #075b9c;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
}

.review-queue-worker,
.review-queue-meta,
.review-queue-action { display: grid; gap: 3px; }
.review-queue-worker strong { color: var(--ink); }
.review-queue-worker span,
.review-queue-meta span,
.review-queue-meta small { font-size: 12px; color: var(--muted); }
.review-queue-meta strong { font-size: 13px; font-weight: 650; }
.review-queue-action { justify-items: end; gap: 8px; }

.review-queue-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.review-timesheet {
  border: 1px solid #141414;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  color: #101820;
}

.review-timesheet-title {
  min-height: 72px;
  padding: 11px 13px 9px;
  border-bottom: 2px solid #075b9c;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.review-timesheet-title h3 {
  margin: 0;
  color: #075b9c;
  font-size: 19px;
  line-height: 1.05;
}

.review-timesheet-title p {
  margin: 2px 0 4px;
  color: #075b9c;
  font-size: 10px;
  font-weight: 700;
}

.review-timesheet-title span { font-size: 10px; color: #263947; }

.review-timesheet-id {
  display: grid;
  gap: 3px;
  text-align: right;
  font-size: 12px;
}

.review-timesheet-id span { color: #52606d; }

.review-timesheet-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid #141414;
}

.review-timesheet-meta span {
  min-height: 34px;
  padding: 8px;
  border-right: 1px solid #141414;
  font-size: 11px;
}

.review-timesheet-meta span:last-child { border-right: 0; }

.review-timesheet-table-frame {
  padding: 8px;
}

.review-attendance-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 10px;
}

.review-attendance-table th,
.review-attendance-table td {
  height: 27px;
  padding: 2px;
  border: 1px solid #141414;
  text-align: center;
  vertical-align: middle;
}

.review-attendance-table th {
  height: 43px;
  background: #e7f1f8;
  color: #063e6c;
  font-size: 9px;
  line-height: 1.2;
}

.review-attendance-table th:nth-child(1) { width: 10%; }
.review-attendance-table th:nth-child(2),
.review-attendance-table th:nth-child(3),
.review-attendance-table th:nth-child(4) { width: 13%; }
.review-attendance-table th:nth-child(5),
.review-attendance-table th:nth-child(6) { width: 25.5%; }

.review-attendance-table-wide th:nth-child(1),
.review-attendance-table-wide th:nth-child(7) { width: 4%; }

.review-attendance-table-wide th:nth-child(2),
.review-attendance-table-wide th:nth-child(3),
.review-attendance-table-wide th:nth-child(4),
.review-attendance-table-wide th:nth-child(8),
.review-attendance-table-wide th:nth-child(9),
.review-attendance-table-wide th:nth-child(10) { width: 6%; }

.review-attendance-table-wide th:nth-child(5),
.review-attendance-table-wide th:nth-child(6),
.review-attendance-table-wide th:nth-child(11),
.review-attendance-table-wide th:nth-child(12) { width: 14%; }

.review-attendance-table .sunday-cell { background: #fde8e6; }
.review-attendance-table .review-day { font-size: 11px; }

.review-hour-input {
  width: 100%;
  min-width: 0;
  height: 22px;
  padding: 1px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-size: 11px;
  color: #101820;
}

.review-hour-input:focus {
  outline: 2px solid #0f5f9b;
  outline-offset: -2px;
  background: #fff;
}

.review-timesheet-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #141414;
}

.review-timesheet-summary span {
  min-height: 38px;
  padding: 8px;
  border-right: 1px solid #141414;
  font-size: 11px;
}

.review-timesheet-summary span:last-child { border-right: 0; }

.scan-preview {
  min-height: 560px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.scan-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.attendance-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.day-box {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px;
  background: #fff;
  display: grid;
  gap: 6px;
  min-height: 116px;
}

.day-box strong {
  font-size: 16px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.check-row input {
  width: auto;
}

.day-box input[type="number"] {
  padding: 5px;
  font-size: 12px;
}

.notice {
  border: 1px solid #ecd0a8;
  color: #8a4d12;
  background: #fff8ed;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.success-notice {
  margin: 0 0 14px;
  border-color: #afd4bc;
  color: #1e6539;
  background: #eef9f1;
}

.danger-notice {
  border-color: #e3a3a8;
  color: #8f1d24;
  background: #fff1f2;
}

.recognition-raw {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 9px 11px;
  color: var(--muted);
  font-size: 12px;
}

.recognition-raw summary { cursor: pointer; }

.recognition-raw pre {
  margin: 9px 0 0;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--ink);
  font: 12px/1.45 Consolas, "Courier New", monospace;
}

.empty {
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  background: #f2f5f9;
}

.login-brand {
  background: var(--nav);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 40px;
}

.login-brand-symbol {
  width: 58px;
  height: 58px;
}

.login-brand-symbol .ui-icon { width: 28px; height: 28px; }
.login-brand-symbol .logo-stem { top: 14px; width: 8px; height: 30px; }
.login-brand-symbol .logo-stem-left { left: 14px; }
.login-brand-symbol .logo-stem-right { right: 14px; }
.login-brand-symbol .logo-bridge { left: 20px; top: 25px; width: 20px; height: 8px; }
.login-brand-symbol .logo-accent { right: 8px; top: 8px; width: 15px; height: 5px; }

.login-brand img {
  width: 88px;
  height: 88px;
  border-radius: 8px;
  object-fit: cover;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  font-size: 25px;
  line-height: 1.28;
}

.login-brand span {
  margin-top: 6px;
  color: #c8d8ea;
  font-size: 14px;
}

.login-panel {
  width: min(390px, calc(100% - 48px));
  align-self: center;
  justify-self: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(20, 49, 83, 0.09);
  padding: 28px;
  display: grid;
  gap: 16px;
}

.login-panel h1,
.login-panel p {
  margin: 0;
}

.login-panel h1 {
  font-size: 22px;
}

.login-panel p {
  color: var(--muted);
  font-size: 13px;
}

.login-submit {
  width: 100%;
  margin-top: 2px;
}

.login-secondary {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  padding: 6px;
}

.user-role,
.role-badge,
.toolbar-caption {
  color: #24517f;
  font-size: 12px;
  font-weight: 700;
}

.role-badge {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 4px;
  color: #005bac;
  background: #e8f1fa;
}

.logout-button {
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
}

.permission-panel {
  margin-top: 12px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.permission-role {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 12px;
  background: #fbfcfe;
}

.permission-role > strong {
  display: block;
  color: #173b70;
  font-size: 13px;
  margin-bottom: 9px;
}

.permission-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
}

.permission-options label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
}

.permission-options input {
  width: auto;
  margin: 0;
}

.archive-list-panel,
.record-ledger-panel,
.archive-section {
  margin-top: 12px;
}

.archive-overview {
  margin-top: 12px;
}

.archive-basic-layout {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.archive-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  height: 100%;
  min-height: 218px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: #edf3f9;
  color: #005bac;
  display: grid;
  place-content: center;
  text-align: center;
}

.archive-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.archive-photo span {
  font-size: 34px;
  font-weight: 800;
}

.archive-photo .archive-photo-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: #55728f;
}

.archive-photo-placeholder .ui-icon {
  width: 34px;
  height: 34px;
}

.archive-photo-placeholder strong {
  font-size: 18px;
}

.archive-photo small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.archive-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.archive-info-grid div {
  min-height: 54px;
  padding: 9px 11px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.archive-info-grid div:nth-child(3n) {
  border-right: 0;
}

.archive-info-grid div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.archive-info-grid span,
.archive-info-grid strong {
  display: block;
}

.archive-info-grid span {
  color: var(--muted);
  font-size: 11px;
}

.archive-info-grid strong {
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
}

.archive-title {
  color: #173b70;
  font-size: 14px;
  font-weight: 800;
}

.record-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 10px;
}

.record-filters select {
  width: auto;
  min-width: 160px;
}

.record-kind {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #08704e;
  background: #e6f5ed;
}

.record-kind.discipline {
  color: #b02032;
  background: #fce9eb;
}

.record-document-link {
  min-height: 26px !important;
  padding: 2px 5px !important;
  border: 0 !important;
  background: transparent !important;
  color: #075fa8 !important;
  box-shadow: none !important;
}

.record-core-fields,
.record-extra-fields {
  margin-bottom: 12px;
}

.record-extra-fields[hidden],
.warning-letter-editor[hidden] {
  display: none !important;
}

.form-span-two {
  grid-column: 1 / -1;
}

.warning-letter-editor {
  margin-top: 4px;
}

.warning-letter-form {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.warning-preview-card {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.warning-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #f5f8fc;
}

.warning-letter-preview {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 24px 24px;
  color: #17212b;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 11px;
  line-height: 1.48;
}

.warning-letterhead {
  padding-bottom: 8px;
  border-bottom: 3px solid #0a5ca8;
}

.warning-letterhead-logos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}

.warning-letterhead-logos img { max-width: 135px; max-height: 42px; object-fit: contain; }
.warning-letterhead-logos img:last-child { max-width: 70px; }
.warning-letterhead-title { margin-top: -38px; text-align: center; }
.warning-letterhead-title strong,
.warning-letterhead-title span,
.warning-letterhead-contact span { display: block; }
.warning-letterhead-title strong { color: #143a6d; font-size: 13px; }
.warning-letterhead-title span { color: #405974; font-size: 9px; }
.warning-letterhead-contact { display: grid; gap: 1px; margin-top: 30px; color: #344b63; text-align: center; font-size: 8px; }
.warning-letterhead-bar { display: block; width: 100%; height: 6px; margin-top: 6px; object-fit: fill; }
.warning-letterhead-ref { display: flex; justify-content: space-between; margin-top: 5px; font-size: 9px; }
.warning-project-title { margin: 8px 0 12px; text-align: center; text-decoration: underline; font-size: 8px; font-weight: 700; }
.warning-letter-preview h1 { margin: 12px 0; text-align: center; text-decoration: underline; font-size: 15px; }
.warning-letter-preview p { margin: 7px 0; text-align: justify; }
.warning-reason { padding-left: 18px; }
.warning-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-top: 38px; }
.warning-signatures > div { min-height: 54px; padding-top: 5px; border-top: 1px solid #111; text-align: center; }
.warning-signatures strong,
.warning-signatures span { display: block; }
.warning-signatures span { margin-top: 3px; color: #64748a; font-size: 9px; }

.warning-record-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.warning-record-summary > span {
  min-height: 58px;
  padding: 9px 11px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.warning-record-summary > span:last-child { border-right: 0; }
.warning-record-summary strong { display: block; margin-top: 5px; color: var(--text); font-size: 12px; }

.attachment-link {
  color: #005bac;
  font-weight: 700;
  text-decoration: none;
}

.attachment-link:hover {
  text-decoration: underline;
}

.attachment-tip {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.print-body {
  background: #fff;
}

.print-actions {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px 18px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.print-scale-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.print-scale-control input[type="range"] {
  width: 150px;
  accent-color: #0f5f9b;
}

.print-scale-control input[type="number"] {
  width: 54px;
  padding: 4px 5px;
  text-align: right;
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.print-scale-control span:last-child {
  color: #0f5f9b;
  font-variant-numeric: tabular-nums;
}

.work-card {
  width: 210mm;
  height: 148.5mm;
  margin: 0 auto;
  padding: 4mm 6mm;
  background: #fff;
  color: #151c25;
  overflow: hidden;
}

.wo-frame {
  border: 1.5px solid #52606d;
  padding: 2.5mm;
  height: 140.5mm;
  position: relative;
  overflow: hidden;
}

.wo-title {
  text-align: center;
  margin-bottom: 2mm;
}

.wo-title h1 {
  margin: 0;
  font-size: 13pt;
}

.wo-title p {
  margin: 0.5mm 0 0;
  color: #52606d;
  font-weight: 700;
  font-size: 6.5pt;
}

.wo-id {
  display: grid;
  grid-template-columns: 21mm 19mm 1fr;
  gap: 3mm;
  border: 1.2px solid #52606d;
  padding: 1.5mm;
  margin-bottom: 2mm;
}

.fake-qr {
  width: 30mm;
  height: 30mm;
  border: 1px solid #111;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  gap: 1px;
  padding: 2px;
  background: #fff;
}

.fake-qr i {
  background: #111;
}

.real-qr {
  display: block;
  border: 1px solid #111;
  background: #fff;
}

.photo-box {
  width: 19mm;
  height: 26mm;
  border: 1px solid #52606d;
  display: grid;
  place-items: center;
  color: #6f7a86;
  font-weight: 800;
  font-size: 6pt;
}

.wo-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5mm;
}

.wo-field {
  border-bottom: 1px solid #6c7884;
  min-height: 7.5mm;
  font-size: 6.5pt;
}

.wo-field strong {
  display: block;
  color: #52606d;
  font-size: 5.5pt;
}

.wo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 5.5pt;
}

.wo-table th,
.wo-table td {
  border: 1px solid #9aa7b2;
  padding: 0.5mm 0.7mm;
  text-align: center;
  height: 4.4mm;
}

.wo-table th {
  background: #eef3f7;
}

.box {
  display: inline-block;
  width: 2.7mm;
  height: 2.7mm;
  border: 1px solid #24313e;
}

.wo-summary {
  border: 1.2px solid #52606d;
  margin-top: 2mm;
  padding: 1.5mm;
}

.wo-summary h2 {
  margin: 0 0 1.5mm;
  font-size: 7.5pt;
  color: #0f5f9b;
}

.wo-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5mm 3mm;
}

.wo-note {
  position: absolute;
  left: 2.5mm;
  right: 2.5mm;
  bottom: 2.5mm;
  border-top: 1px solid #d3a25d;
  padding-top: 1mm;
  color: #9b5518;
  font-size: 5.5pt;
}

/* A4 landscape: two independent A5 portrait work orders. */
.print-sheet {
  width: 297mm;
  height: 210mm;
  display: flex;
  align-items: flex-start;
  background: #fff;
  position: relative;
}

.work-card-a5 {
  width: 148.5mm;
  height: 210mm;
  margin: 0;
  padding: 2.5mm;
}

.work-card-a5 + .work-card-a5 {
  border-left: 1px dashed #7d8790;
}

/* Each A5 card scales about the center of its own A4 half, not the page center. */
.print-sheet .work-card-a5 {
  transform: scale(var(--print-scale, 1));
  transform-origin: center center;
}

.print-sheet .work-card-a5 + .work-card-a5 {
  border-left: 0;
}

.print-sheet::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 1px dashed #7d8790;
  pointer-events: none;
}

.wo-frame-a5 {
  height: 205mm;
  padding: 2mm;
  border-radius: 1.5mm;
}

.wo-title-a5 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  margin-bottom: 0.3mm;
}

.wo-title-copy {
  min-width: 0;
  min-height: 22mm;
  display: flex;
  flex-direction: column;
}

.wo-title-a5 h1 {
  color: #0f5f9b;
  font-size: 15pt;
}

.wo-title-a5 p {
  margin: 0;
  color: #0f5f9b;
  font-size: 8.2pt;
}

.wo-title-qr {
  flex: 0 0 auto;
  margin-top: 0.2mm;
  text-align: center;
}

.wo-title-qr .real-qr {
  width: 21mm;
  height: 21mm;
}

.wo-title-qr small {
  display: block;
  margin-top: 0;
  font-size: 3.9pt;
  color: #52606d;
}

.wo-project {
  margin: auto 0 0;
  padding-bottom: 0;
  border-bottom: 0;
  font: 700 6pt Georgia, serif;
}

.wo-title-a5 .wo-project {
  font: 700 6pt Georgia, serif;
}

.wo-meta {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 6.4pt;
}

.wo-meta td {
  height: 6.7mm;
  padding: 1mm;
  border: 1px solid #52606d;
  vertical-align: top;
}

.wo-meta .wo-identity {
  width: 27mm;
  padding: 1mm;
  text-align: center;
  vertical-align: middle;
}

.work-card-a5 .photo-box {
  width: 20mm;
  height: 23mm;
  margin: 0 auto;
  font-size: 5.8pt;
}

.work-card-a5 .photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wo-table-a5 {
  table-layout: fixed;
  font-size: 5.1pt;
}

.wo-module-frame {
  overflow: hidden;
  border: 1px solid #52606d;
  border-radius: 1.2mm;
}

.wo-module-frame-meta {
  margin-bottom: 1.5mm;
}

.wo-module-frame-attendance {
  border-color: #9aa7b2;
}

/* The rounded frame owns the outer edge; table cells retain every inner grid line. */
.wo-module-frame-meta .wo-meta tr:first-child td { border-top: 0; }
.wo-module-frame-meta .wo-meta tr:last-child td { border-bottom: 0; }
.wo-module-frame-meta .wo-meta tr td:last-child { border-right: 0; }
.wo-module-frame-meta .wo-meta .wo-identity { border-left: 0; border-bottom: 0; }

.wo-module-frame-attendance .wo-table tr:first-child th { border-top: 0; }
.wo-module-frame-attendance .wo-table tr:last-child td { border-bottom: 0; }
.wo-module-frame-attendance .wo-table th:first-child,
.wo-module-frame-attendance .wo-table td:first-child { border-left: 0; }
.wo-module-frame-attendance .wo-table th:last-child,
.wo-module-frame-attendance .wo-table td:last-child { border-right: 0; }

.wo-table-a5 th,
.wo-table-a5 td {
  height: 6.9mm;
  padding: 0.5mm 0.35mm;
  overflow: hidden;
}

.wo-table-a5 th {
  height: 11mm;
  font-size: 4.8pt;
}

.wo-table-a5 th:nth-child(1),
.wo-table-a5 th:nth-child(7) { width: 4%; }

.wo-table-a5 th:nth-child(2),
.wo-table-a5 th:nth-child(3),
.wo-table-a5 th:nth-child(4),
.wo-table-a5 th:nth-child(8),
.wo-table-a5 th:nth-child(9),
.wo-table-a5 th:nth-child(10) { width: 6%; }

.wo-table-a5 th:nth-child(5),
.wo-table-a5 th:nth-child(6),
.wo-table-a5 th:nth-child(11),
.wo-table-a5 th:nth-child(12) { width: 14%; }

.wo-table-a5 td:nth-child(1),
.wo-table-a5 td:nth-child(7) { font-size: 6.4pt; }

.wo-table-a5 .sunday-cell {
  background: #fff2dc;
}

.wo-table-a5 .sunday-cell:first-child {
  font-weight: 800;
}

.wo-summary-a5 {
  margin-top: 1mm;
  padding: 0;
  border-radius: 1.2mm;
  overflow: hidden;
}

.wo-summary-a5 .wo-summary-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.wo-summary-a5 .wo-summary-grid div {
  min-height: 7.2mm;
  padding: 1.1mm;
  border-right: 1px solid #52606d;
  border-bottom: 1px solid #52606d;
  font-size: 6.2pt;
}

.wo-summary-a5 .wo-summary-grid div:nth-child(2n) { border-right: 0; }
.wo-summary-a5 .wo-summary-grid div:nth-child(n + 3) { border-bottom: 0; }

.wo-note-a5 {
  position: static;
  margin: 0.7mm 0 0;
  padding: 0;
  border: 0;
  color: #52606d;
  font-size: 5.1pt;
  line-height: 1.13;
}

.wo-note-a5 span {
  display: block;
}

.wo-note-a5 span + span {
  margin-top: 0.35mm;
}

.work-card-a5 .photo-box {
  border-radius: 1mm;
  overflow: hidden;
}

/* CIEC print palette: deep navy structure, brand blue hierarchy, restrained red accents. */
.print-sheet .wo-frame-a5,
.print-sheet .wo-module-frame-meta,
.print-sheet .wo-summary-a5 {
  border-color: #000;
}

.print-sheet .wo-title-a5 h1,
.print-sheet .wo-title-a5 p {
  color: #005bac;
}

.print-sheet .wo-project {
  border-bottom-color: #173b70;
  color: #173b70;
}

.print-sheet .wo-meta td,
.print-sheet .wo-summary-a5 .wo-summary-grid div,
.print-sheet .photo-box {
  border-color: #000;
}

.print-sheet .wo-module-frame-attendance {
  border-color: #000;
}

.print-sheet .wo-table-a5 th,
.print-sheet .wo-table-a5 td {
  border-color: #000;
}

.print-sheet .wo-table-a5 th {
  background: #dfeaf6;
  color: #173b70;
}

.print-sheet .wo-table-a5 .sunday-cell {
  background: #f7d1d1;
}

.print-sheet .wo-note-a5,
.print-sheet .wo-title-qr small {
  color: #3e5675;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .grid.two,
  .review-layout,
  .form-grid,
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .stat-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-charts {
    grid-template-columns: 1fr;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    padding: 28px;
  }

  .permission-grid {
    grid-template-columns: 1fr;
  }

  .record-filters select {
    width: 100%;
  }

  .archive-basic-layout {
    grid-template-columns: 1fr;
  }

  .archive-photo {
    width: 112px;
    height: auto;
    min-height: 0;
    aspect-ratio: 3 / 4;
  }

  .archive-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-info-grid div:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .archive-info-grid div:nth-child(2n) {
    border-right: 0;
  }

  .archive-info-grid div:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .archive-info-grid div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .review-queue-item {
    grid-template-columns: 42px minmax(180px, 1fr) auto;
  }

  .review-queue-item .review-queue-meta { display: none; }

}

@media (max-width: 680px) {
  .sidebar {
    padding: 14px 10px;
    gap: 12px;
  }

  .brand {
    padding-bottom: 4px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav button {
    min-width: 0;
    white-space: normal;
    align-items: flex-start;
    font-size: 12px;
    line-height: 1.35;
  }

  .content {
    grid-template-rows: auto 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .topbar .meta {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .page {
    padding: 12px;
  }

  .toolbar,
  .panel-header {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
  }

  .toolbar input,
  .toolbar select {
    flex: 1 1 160px;
    min-width: 0;
  }

  .warning-record-summary {
    grid-template-columns: 1fr;
  }

  .warning-record-summary > span {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .warning-record-summary > span:last-child { border-bottom: 0; }

  .warning-letter-preview {
    padding: 14px;
  }

  .review-queue-summary,
  .review-timesheet-summary { grid-template-columns: 1fr; }

  .review-queue-summary > div,
  .review-timesheet-summary span {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .review-queue-summary > div:last-child,
  .review-timesheet-summary span:last-child { border-bottom: 0; }

  .review-queue-item { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
  .review-queue-action { grid-column: 2; justify-items: start; }
  .review-queue-buttons { justify-content: flex-start; }
  .review-timesheet-meta { grid-template-columns: 1fr; }
  .review-timesheet-meta span { border-right: 0; border-bottom: 1px solid #141414; }
  .review-timesheet-meta span:last-child { border-bottom: 0; }
  .review-timesheet-title { min-height: 0; }
}

.scan-action-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.scan-queue {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.scan-queue-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 8px;
  color: var(--ink-soft);
  font-size: 13px;
}

.scan-queue-empty {
  padding: 18px 2px;
  color: var(--ink-soft);
  font-size: 13px;
}

.scan-queue-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 0;
  border-top: 1px solid #dce2e7;
}

.scan-file-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 5px;
  background: #e6edf3;
  color: #0b4f84;
  font-size: 10px;
  font-weight: 800;
}

.scan-file-meta {
  min-width: 0;
}

.scan-file-meta strong,
.scan-file-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-file-meta strong {
  font-size: 13px;
}

.scan-file-meta small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 11px;
}

.scan-stage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
}

.scan-stage.working { color: #0b4f84; font-weight: 700; }
.scan-stage.done { color: #177347; font-weight: 700; }
.scan-stage.failed { color: #b42318; font-weight: 700; }

.scan-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid #b8c8d6;
  border-top-color: #0b4f84;
  border-radius: 50%;
  animation: scan-spin .85s linear infinite;
}

@keyframes scan-spin {
  to { transform: rotate(360deg); }
}

.scan-queue-item.is-working {
  background: #f2f7fb;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  .print-actions {
    display: none;
  }

  .work-card {
    margin: 0;
    box-shadow: none;
  }

  .work-card-a5 {
    width: 148.5mm;
    height: 210mm;
    box-shadow: none;
  }

  .print-sheet {
    width: 297mm;
    height: 210mm;
    break-after: page;
    page-break-after: always;
  }

  .print-sheet:last-child {
    break-after: auto;
    page-break-after: auto;
  }
}
