:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #071523;
  color: #eef5f7;
  --blue: #0E3253;
  --blue-dark: #081d31;
  --blue-panel: #0d2a45;
  --green: #4D7046;
  --green-bright: #6f965f;
  --gold: #D6A12B;
  --text-muted: #b7c7cf;
  --line: rgba(214, 161, 43, 0.28);
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #071523 0%, #0A2035 54%, #071523 100%);
}

body.history-page {
  background: #071523;
}

a {
  color: #f0c65b;
}

a:hover {
  color: #ffe09a;
}

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 18px 60px;
}

header {
  padding: 18px 20px;
  background: var(--blue);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

h1 {
  margin: 0 0 10px;
  font-size: 32px;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 16px;
  font-size: 20px;
  letter-spacing: 0;
}

section {
  margin-top: 20px;
  padding: 20px;
  background: var(--blue-panel);
  border: 1px solid rgba(238, 245, 247, 0.12);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: #f5fbfc;
}

input,
select,
textarea,
button {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid rgba(238, 245, 247, 0.2);
  font: inherit;
}

input,
select,
textarea {
  padding: 0 10px;
  background: var(--blue-dark);
  color: #f8fbfc;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(214, 161, 43, 0.72);
  outline-offset: 1px;
}

textarea {
  padding-top: 10px;
  resize: vertical;
}

fieldset {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid rgba(238, 245, 247, 0.16);
  border-radius: 6px;
}

legend {
  color: #ffe3a3;
  font-weight: 700;
}

.search-area-options {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.search-area-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.helper-text {
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
}

button {
  margin-top: 16px;
  padding: 0 18px;
  background: var(--green);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--green-bright);
}

button.secondary {
  background: var(--blue-dark);
  border-color: rgba(214, 161, 43, 0.4);
}

button.danger {
  background: #5a1f27;
  border-color: rgba(214, 161, 43, 0.55);
}

button.danger:hover {
  background: #79303b;
}

.button-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 6px;
  border: 1px solid rgba(238, 245, 247, 0.2);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.button-link.primary-action {
  background: var(--blue);
  border-color: rgba(214, 161, 43, 0.45);
}

.button-link.primary-action:hover {
  background: #16466f;
  color: #fff;
}

.checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.checks label,
.confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.checks input,
.confirm input {
  min-height: auto;
  accent-color: var(--green);
}

.notice,
.setup {
  padding: 12px;
  border-left: 4px solid var(--gold);
  background: rgba(214, 161, 43, 0.12);
  color: #ffe3a3;
}

.summary {
  display: grid;
  grid-template-columns: minmax(220px, 330px) 1fr;
  gap: 8px 16px;
}

dt {
  font-weight: 700;
  color: #ffffff;
}

dd {
  margin: 0;
  color: var(--text-muted);
}

.files {
  word-break: break-all;
}

.back {
  display: inline-block;
  margin-top: 20px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.topnav a {
  padding: 8px 10px;
  background: rgba(8, 29, 49, 0.8);
  border: 1px solid rgba(238, 245, 247, 0.12);
  border-radius: 6px;
  color: #eef5f7;
  text-decoration: none;
}

.topnav a:hover {
  border-color: var(--gold);
}

.topnav form,
.actions form {
  margin: 0;
}

.topnav button,
.actions button {
  margin-top: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid rgba(238, 245, 247, 0.12);
  text-align: left;
  vertical-align: top;
}

th {
  color: #ffe3a3;
}

.sort-link {
  color: #ffe3a3;
  text-decoration: none;
  border-bottom: 1px dotted rgba(214, 161, 43, 0.65);
}

.sort-link:hover,
.sort-link.active {
  color: #fff0c3;
  border-bottom-color: var(--gold);
}

.sort-indicator {
  color: var(--gold);
  font-weight: 700;
}

td {
  color: #dce8ec;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.progress-wrap {
  margin-top: 16px;
}

.progress-bar {
  width: 100%;
  height: 18px;
  background: #071523;
  border: 1px solid rgba(238, 245, 247, 0.16);
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--green);
  transition: width 0.2s ease;
}

.history-shell {
  max-width: 1320px;
}

.history-card {
  background: var(--blue-panel);
  border: 1px solid rgba(238, 245, 247, 0.12);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.history-table-wrap {
  overflow-x: auto;
}

.history-table {
  table-layout: fixed;
  font-size: 13px;
}

.history-table th,
.history-table td {
  padding: 8px 7px;
}

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

.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: 118px;
}

.history-table th:nth-child(4),
.history-table td:nth-child(4),
.history-table th:nth-child(7),
.history-table td:nth-child(7),
.history-table th:nth-child(8),
.history-table td:nth-child(8),
.history-table th:nth-child(9),
.history-table td:nth-child(9),
.history-table th:nth-child(10),
.history-table td:nth-child(10) {
  width: 78px;
}

.compact-list {
  max-width: 170px;
}

.run-id {
  font-family: Consolas, "Courier New", monospace;
}

.compact-button {
  min-height: 34px;
  padding: 0 10px;
}

.bulk-actions {
  align-items: center;
}

.bulk-actions form,
.bulk-actions button {
  margin-top: 0;
}
