.digital-work-records {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
}

.work-records-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.8fr);
  align-items: start;
  gap: 16px;
}

.work-records-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
}

.work-records-head p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
}

.work-records-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  justify-self: end;
  width: min(100%, 480px);
}

.work-record-kpi {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #dfe7ef;
  border-radius: 4px;
  background: #fff;
}

.work-record-kpi span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.work-record-kpi strong {
  display: block;
  margin-top: 6px;
  color: #0f172a;
  font-size: 22px;
  line-height: 1;
}

.work-record-kpi.success strong {
  color: var(--success-active);
}

.work-record-kpi.danger strong {
  color: #dc2626;
}

.work-records-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 13px;
}

.work-records-toolbar button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid #d8e1eb;
  border-radius: 4px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.work-records-toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.work-records-table-wrap {
  min-height: 400px;
  overflow: auto;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  background: linear-gradient(180deg, #fcfefd 0%, #f4f8f6 100%);
}

.work-records-table-wrap.is-empty {
  display: grid;
  align-items: center;
  justify-content: center;
}

.digital-work-records-table {
  width: 100%;
  min-width: 1180px;
  table-layout: fixed;
  border-collapse: collapse;
}

.digital-work-records-table .col-time { width: 14%; }

.digital-work-records-table .col-module { width: 12%; }

.digital-work-records-table .col-source { width: 10%; }

.digital-work-records-table .col-status { width: 17%; }

.digital-work-records-table .col-summary { width: 31%; }

.digital-work-records-table .col-trace { width: 16%; }

.digital-work-records-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 13px 12px;
  border-bottom: 1px solid #edf2f7;
  background: #f7fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
}

.digital-work-records-table tbody td {
  padding: 13px 12px;
  border-bottom: 1px solid #edf2f7;
  color: #24324a;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  vertical-align: middle;
}

.digital-work-records-table tbody tr {
  cursor: pointer;
  outline: none;
}

.digital-work-records-table tbody tr:hover,
.digital-work-records-table tbody tr:focus-visible {
  background: linear-gradient(90deg, rgba(58, 124, 165, .08), rgba(58, 124, 165, .03));
}

.digital-work-records-table tbody tr:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(58, 124, 165, .28);
}

.digital-work-records-table tbody tr:last-child td {
  border-bottom: 0;
}

.work-record-status-stack {
  display: grid;
  gap: 5px;
  justify-items: center;
}

.work-record-status-stack > span:last-child {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.work-record-summary-cell {
  text-align: left !important;
}

.work-record-summary-cell strong,
.work-record-summary-cell span,
.work-record-summary-cell em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-record-summary-cell strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.work-record-summary-cell span {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
  white-space: nowrap;
}

.work-record-summary-cell em {
  margin-top: 6px;
  color: #94a3b8;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.work-record-trace-cell {
  color: #2563eb !important;
  word-break: break-all;
}

.status-pill {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.status-pill.success {
  border-color: var(--success-line);
  background: var(--success-soft);
  color: var(--success-active);
}

.status-pill.warning {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #f97316;
}

.status-pill.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.status-pill.info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
}

.status-pill.muted {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.table-state,
.work-records-empty {
  width: 100%;
  min-height: 260px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 28px 20px;
  color: #64748b;
  font-size: 13px;
  text-align: center;
}

.table-state.error {
  background: linear-gradient(180deg, #fffdfd 0%, #fff6f6 100%);
}

.table-state.error .mdi {
  color: #ef4444;
  font-size: 28px;
}

.table-state.error strong {
  color: #0f172a;
  font-size: 15px;
}

.table-state.error p {
  margin: 0;
}

.work-record-detail-mask {
  position: fixed;
  inset: 0;
  z-index: 2800;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, .28);
}

.work-record-detail-panel {
  width: min(720px, calc(100vw - 32px));
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-left: 1px solid #dfe7ef;
  background: #fff;
  box-shadow: -18px 0 42px rgba(15, 23, 42, .18);
}

.work-record-detail-head {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid #edf2f7;
}

.work-record-detail-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.work-record-detail-head h3 {
  margin: 5px 0 0;
  color: #0f172a;
  font-size: 17px;
  line-height: 1.35;
}

.work-record-detail-head button {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #d8e1eb;
  border-radius: 4px;
  background: #fff;
  color: #64748b;
}

.work-record-detail-head button:hover {
  color: var(--theme-primary-active);
}

.work-record-detail-body {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px 18px 22px;
  overflow-y: auto;
  background: #f8fafc;
}

.work-record-detail-section,
.work-record-detail-state {
  border: 1px solid #e5edf5;
  border-radius: 6px;
  background: #fff;
}

.work-record-detail-section {
  padding: 14px;
}

.work-record-detail-state {
  min-height: 100%;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 30px 18px;
  color: #64748b;
  text-align: center;
}

.work-record-detail-state.error .mdi {
  color: #dc2626;
  font-size: 30px;
}

.work-record-detail-state.error strong {
  color: #0f172a;
}

.work-record-detail-state.error p {
  margin: 0;
}

.work-record-detail-state.error button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #fecaca;
  border-radius: 4px;
  background: #fff;
  color: #dc2626;
  font-weight: 750;
}

.work-record-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.work-record-section-head h4 {
  margin: 0;
  color: #0f172a;
  font-size: 15px;
}

.work-record-section-head > span:not(.status-pill) {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 750;
}

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

.work-record-info-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #edf2f7;
  border-radius: 4px;
  background: #f8fafc;
}

.work-record-info-grid span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.work-record-info-grid strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 13px;
}

.work-record-result-text,
.work-record-error-text,
.work-record-inline-empty {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.65;
}

.work-record-error-text {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 4px;
  background: #fef2f2;
  color: #b91c1c;
}

.work-record-tool-list {
  display: grid;
  gap: 8px;
}

.work-record-tool-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #edf2f7;
  border-radius: 4px;
  background: #f8fafc;
}

.work-record-tool-list strong {
  color: #0f172a;
  font-size: 13px;
}

.work-record-tool-list span {
  color: #64748b;
  font-size: 12px;
}

.work-record-code-block {
  max-height: 320px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.55;
}

.work-record-detail-enter-active,
.work-record-detail-leave-active {
  transition: opacity 180ms ease;
}

.work-record-detail-enter-active .work-record-detail-panel,
.work-record-detail-leave-active .work-record-detail-panel {
  transition: transform 220ms ease;
}

.work-record-detail-enter-from,
.work-record-detail-leave-to {
  opacity: 0;
}

.work-record-detail-enter-from .work-record-detail-panel,
.work-record-detail-leave-to .work-record-detail-panel {
  transform: translateX(24px);
}

@media (max-width: 980px) {
  .work-records-head {
    grid-template-columns: 1fr;
  }

  .work-records-kpis {
    justify-self: stretch;
    width: 100%;
  }

  .work-record-info-grid {
    grid-template-columns: 1fr;
  }
}
