* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #18212f;
  background: #f6f8fb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 32px auto;
}

.toolbar,
.input-grid,
.table-wrap,
.admin-panel,
.status-panel {
  background: #ffffff;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
}

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

h1 {
  margin: 0 0 4px;
  font-size: 24px;
}

p {
  margin: 0;
  color: #637083;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 650;
}

input,
textarea,
select,
button {
  border: 1px solid #c9d3df;
  border-radius: 6px;
  font: inherit;
}

input,
textarea,
select {
  padding: 10px 12px;
  background: #ffffff;
}

textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
}

button {
  padding: 10px 14px;
  color: #ffffff;
  background: #2563eb;
  cursor: pointer;
}

button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

button.secondary {
  color: #1f2937;
  background: #e5e7eb;
}

button.danger {
  background: #dc2626;
}

.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.input-grid.single {
  grid-template-columns: minmax(280px, 460px);
}

.panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.account {
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 650;
}

.language-select {
  min-width: 110px;
}

.status-panel {
  padding: 16px 20px;
  margin-bottom: 16px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-weight: 700;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  background: #e5e7eb;
  border-radius: 999px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: #2563eb;
  border-radius: inherit;
  transition: width 180ms ease;
}

.progress-bar.indeterminate {
  animation: progress-slide 1.1s ease-in-out infinite;
}

.status-panel.error .progress-bar {
  background: #dc2626;
}

@keyframes progress-slide {
  0% {
    transform: translateX(-120%);
  }
  50% {
    transform: translateX(90%);
  }
  100% {
    transform: translateX(260%);
  }
}

.table-wrap {
  overflow: auto;
  margin-bottom: 16px;
}

.section-heading {
  padding: 20px 20px 0;
}

.section-heading h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.user-form,
.history-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 20px;
}

#userMessage,
#historyMessage {
  padding: 0 20px 14px;
}

.history-form input,
.history-form select {
  min-width: 140px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid #e6ebf2;
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef3f8;
  font-size: 13px;
}

.ok {
  color: #047857;
  font-weight: 700;
}

.bad {
  color: #b91c1c;
  font-weight: 700;
}

@media (max-width: 760px) {
  .toolbar,
  .input-grid {
    grid-template-columns: 1fr;
    display: grid;
  }
}
