:root {
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: #0b1f33;
  background-color: #f7f9fc;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header,
footer {
  background: linear-gradient(135deg, #0f62fe 0%, #409eff 100%);
  color: #ffffff;
  padding: 1.5rem 2rem;
}

header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
}

header p {
  margin: 0;
  max-width: 48rem;
  opacity: 0.85;
}

footer {
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.9;
}

main {
  flex: 1;
  width: min(1100px, 95vw);
  margin: 2rem auto;
  display: grid;
  gap: 1.5rem;
}

.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(15, 98, 254, 0.08);
  border: 1px solid rgba(15, 98, 254, 0.08);
}

.hint {
  font-size: 0.95rem;
  color: #425466;
}

.upload-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 620px) {
  .upload-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.upload-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 600;
  color: #0b1f33;
  padding: 1rem;
  border: 2px dashed rgba(15, 98, 254, 0.35);
  border-radius: 12px;
  background: rgba(15, 98, 254, 0.06);
}

.upload-field input {
  padding: 0.5rem;
  border: 1px solid rgba(11, 31, 51, 0.2);
  border-radius: 6px;
  font-size: 1rem;
}

.status {
  margin-top: 1rem;
  font-weight: 600;
  color: #0b6d2b;
}

.status.error {
  color: #c92a2a;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

button {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.3s ease;
  background: #e1e8f5;
  color: #0b1f33;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(15, 98, 254, 0.16);
}

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

.hidden {
  display: none !important;
}

.primary {
  background: #0f62fe;
  color: #ffffff;
}

.secondary {
  background: #ffffff;
  color: #0f62fe;
  border: 1px solid rgba(15, 98, 254, 0.5);
}

.data-view.hidden {
  display: none;
}

.meta {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
  color: #425466;
  font-weight: 600;
  justify-content: space-between;
  flex-wrap: wrap;
}

.meta-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.table-filter {
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(11, 31, 51, 0.2);
  border-radius: 8px;
  font-size: 0.95rem;
  background: #ffffff;
  color: #0b1f33;
  min-width: min(260px, 100%);
  box-shadow: inset 0 1px 2px rgba(15, 98, 254, 0.05);
}

.table-filter:focus {
  outline: 2px solid rgba(15, 98, 254, 0.35);
  border-color: rgba(15, 98, 254, 0.45);
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(66, 84, 102, 0.2);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 480px;
}

th,
td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(66, 84, 102, 0.15);
  text-align: left;
  vertical-align: top;
}

thead tr {
  background: rgba(15, 98, 254, 0.08);
}

tbody tr:nth-child(2n) {
  background: rgba(15, 98, 254, 0.04);
}

tbody tr:hover {
  background: rgba(15, 98, 254, 0.12);
}

td.empty {
  text-align: center;
  font-style: italic;
  color: #66788a;
}

.truncate-note {
  text-align: center;
  font-size: 0.85rem;
  color: #66788a;
  padding-top: 0.5rem;
}

code {
  padding: 0.2rem 0.4rem;
  background: rgba(11, 31, 51, 0.08);
  border-radius: 4px;
  font-size: 0.9rem;
}

small {
  font-weight: 400;
  color: #66788a;
}

.history-list {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.history-empty {
  margin: 1.5rem 0;
  color: #66788a;
  font-style: italic;
}

.history-item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(15, 98, 254, 0.15);
  border-radius: 12px;
  background: rgba(15, 98, 254, 0.06);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.history-item.active {
  border-color: rgba(15, 98, 254, 0.45);
  background: rgba(15, 98, 254, 0.12);
}

.history-item__summary h3 {
  margin: 0;
  font-size: 1.05rem;
}

.history-item__summary p {
  margin: 0.25rem 0 0;
  color: #425466;
  font-weight: 500;
}

.history-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.history-title {
  margin: 0;
  font-weight: 600;
  color: #0b1f33;
}

.history-table {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
