.changelog-shell {
  padding: 24px;
}

.changelog-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  background: linear-gradient(135deg, #102033 0%, #24506f 52%, #0f766e 100%);
  color: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
  margin-bottom: 22px;
}

.changelog-hero h2 {
  margin: 0 0 8px;
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: 0;
}

.changelog-hero p {
  margin: 0;
  color: rgba(255,255,255,0.8);
  max-width: 780px;
}

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

.changelog-refresh-btn,
.changelog-clear-btn,
.changelog-page-btn {
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.13);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.changelog-refresh-btn:hover {
  background: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

.changelog-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.changelog-summary-card,
.changelog-mini-counts,
.changelog-entry {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.changelog-summary-card {
  padding: 16px;
}

.changelog-summary-card .label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 900;
  margin-bottom: 8px;
}

.changelog-summary-card .value {
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 950;
  color: #0f172a;
}

.changelog-summary-card .sub {
  margin-top: 8px;
  font-size: 0.78rem;
  color: #64748b;
}

.changelog-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(150px, 1fr)) minmax(160px, 1fr) repeat(2, 138px) 110px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.changelog-toolbar input,
.changelog-toolbar select {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.86rem;
  background: #fff;
  min-height: 42px;
  width: 100%;
}

.changelog-clear-btn {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
  justify-content: center;
}

.changelog-clear-btn:hover {
  background: #e2e8f0;
}

.changelog-counts-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.changelog-mini-counts {
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.changelog-mini-title {
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #475569;
  margin-right: 3px;
}

.changelog-mini-chip {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 700;
}

.changelog-mini-chip strong {
  color: #0f172a;
  margin-left: 4px;
}

.changelog-mini-chip.muted {
  color: #94a3b8;
}

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

.changelog-list-head {
  display: grid;
  grid-template-columns: 160px minmax(260px, 1.8fr) minmax(180px, 0.9fr) 150px;
  gap: 14px;
  padding: 0 14px;
  color: #64748b;
  font-size: 0.67rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.changelog-entry {
  display: grid;
  grid-template-columns: 160px minmax(260px, 1.8fr) minmax(180px, 0.9fr) 150px;
  gap: 14px;
  padding: 14px;
  align-items: start;
}

.changelog-time strong,
.changelog-entity strong {
  display: block;
  color: #0f172a;
  font-size: 0.83rem;
}

.changelog-time span,
.changelog-entity span,
.changelog-actor {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.4;
}

.changelog-entity code {
  display: inline-block;
  margin-top: 5px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #075985;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 7px;
  padding: 3px 6px;
  font-size: 0.66rem;
}

.changelog-entry-top {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.changelog-action,
.changelog-run {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 950;
  white-space: nowrap;
}

.changelog-action.create { background: #dcfce7; color: #166534; }
.changelog-action.update { background: #dbeafe; color: #1d4ed8; }
.changelog-action.delete { background: #fee2e2; color: #991b1b; }
.changelog-action.import,
.changelog-action.export { background: #fef3c7; color: #92400e; }
.changelog-action.publish { background: #ede9fe; color: #6d28d9; }
.changelog-action.archive { background: #e2e8f0; color: #334155; }
.changelog-action.automation_run { background: #ccfbf1; color: #0f766e; }

.changelog-run {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
  text-transform: none;
  letter-spacing: 0;
}

.changelog-summary {
  color: #0f172a;
  font-size: 0.86rem;
  line-height: 1.45;
  font-weight: 700;
}

.changelog-diff {
  margin-top: 8px;
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto minmax(80px, 1fr);
  gap: 7px;
  align-items: center;
  color: #475569;
  font-size: 0.75rem;
}

.changelog-diff span {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.changelog-diff em {
  color: #94a3b8;
  font-style: normal;
}

.changelog-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 0 4px;
  color: #64748b;
  font-size: 0.82rem;
}

.changelog-pager > div {
  display: flex;
  gap: 8px;
}

.changelog-page-btn {
  background: #fff;
  border-color: #cbd5e1;
  color: #334155;
}

.changelog-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.changelog-empty,
.changelog-loading,
.changelog-error {
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 34px;
  text-align: center;
  color: #64748b;
}

.changelog-loading.compact {
  padding: 18px;
}

.changelog-error {
  border-color: #fecaca;
  color: #991b1b;
  background: #fff7f7;
}

@media (max-width: 1200px) {
  .changelog-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 950px) {
  .changelog-hero {
    flex-direction: column;
  }

  .changelog-summary-grid,
  .changelog-counts-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .changelog-list-head {
    display: none;
  }

  .changelog-entry {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .changelog-shell {
    padding: 14px;
  }

  .changelog-summary-grid,
  .changelog-counts-row,
  .changelog-toolbar {
    grid-template-columns: 1fr;
  }

  .changelog-hero-actions,
  .changelog-pager {
    align-items: stretch;
    flex-direction: column;
  }

  .changelog-diff {
    grid-template-columns: 1fr;
  }

  .changelog-diff i {
    display: none;
  }
}
