.history-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 20px auto 36px;
}

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

.history-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.history-topbar h1 {
  font-size: 24px;
  margin-bottom: 6px;
}

.history-topbar p,
.history-search span {
  color: var(--muted);
  font-size: 13px;
}

.history-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

body:not(.is-admin) .history-table tbody td:first-child,
body:not(.is-admin) .history-table tbody td:last-child {
  display: none;
}

.history-panel {
  padding: 16px;
}

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

.history-search {
  width: min(420px, 100%);
  display: grid;
  gap: 6px;
}

.history-table {
  min-width: 980px;
  table-layout: fixed;
}

.history-table th,
.history-table td {
  padding: 10px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) {
  width: 34px;
  text-align: center;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2),
.history-table th:nth-child(3),
.history-table td:nth-child(3) {
  width: 13%;
}

.history-table th:nth-child(4),
.history-table td:nth-child(4),
.history-table th:nth-child(5),
.history-table td:nth-child(5) {
  width: 9%;
}

.history-table th:nth-child(6),
.history-table td:nth-child(6) {
  width: 15%;
}

.history-table th:nth-child(7),
.history-table td:nth-child(7) {
  width: 64px;
  text-align: center;
}

.history-table th:nth-child(8),
.history-table td:nth-child(8) {
  width: 168px;
}

.history-table th:nth-child(9),
.history-table td:nth-child(9) {
  width: 152px;
  text-align: center;
}

.history-table input[type="checkbox"] {
  width: 12px;
  height: 12px;
  min-height: auto;
  padding: 0;
  margin: 0;
}

.history-row-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.history-row-actions .btn {
  min-height: 32px;
  padding: 0 10px;
}

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

@media (max-width: 720px) {
  .history-shell {
    width: min(100% - 18px, 1180px);
    margin-top: 12px;
  }

  .history-topbar,
  .history-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .history-actions {
    justify-content: flex-start;
  }
}
