:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-soft: #0b1b31;
  --panel: rgba(13, 30, 53, 0.88);
  --panel-strong: #10243d;
  --text: #ecf4ff;
  --muted: #a9bad0;
  --line: rgba(157, 177, 203, 0.24);
  --primary: #57a6ff;
  --primary-dark: #2f7ddd;
  --accent: #76e4f7;
  --danger: #ff8b82;
  --warning: #ffd37a;
  --success: #7ee2a8;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: relative;
}

body::before,
body::after {
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

body::before {
  background-image:
    linear-gradient(rgba(87, 166, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87, 166, 255, 0.1) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 50% 18%, black 0, black 32rem, transparent 58rem);
}

body::after {
  background-image:
    url("data:image/svg+xml,%3Csvg width='1200' height='900' viewBox='0 0 1200 900' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%2357a6ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='.34'%3E%3Cpath d='M226 226h96l52 54h82l48-46h84l38 38h96l42 42h96'/%3E%3Cpath d='M280 420h108l48-48h92l44 44h76l54-54h118l58 58h86'/%3E%3Cpath d='M224 632h124l62-62h102l48 50h96l58-58h110l72 72h92'/%3E%3Cpath d='M410 164v86M560 280v102M704 312v86M836 420v108M490 570v92M690 560v94'/%3E%3Ccircle cx='226' cy='226' r='6'/%3E%3Ccircle cx='456' cy='280' r='6'/%3E%3Ccircle cx='588' cy='234' r='6'/%3E%3Ccircle cx='860' cy='314' r='6'/%3E%3Ccircle cx='280' cy='420' r='6'/%3E%3Ccircle cx='528' cy='372' r='6'/%3E%3Ccircle cx='820' cy='362' r='6'/%3E%3Ccircle cx='964' cy='420' r='6'/%3E%3Ccircle cx='224' cy='632' r='6'/%3E%3Ccircle cx='512' cy='570' r='6'/%3E%3Ccircle cx='824' cy='562' r='6'/%3E%3Ccircle cx='988' cy='634' r='6'/%3E%3C/g%3E%3Cg fill='%2376e4f7' opacity='.42'%3E%3Ccircle cx='410' cy='164' r='4'/%3E%3Ccircle cx='560' cy='382' r='4'/%3E%3Ccircle cx='704' cy='398' r='4'/%3E%3Ccircle cx='836' cy='528' r='4'/%3E%3Ccircle cx='490' cy='662' r='4'/%3E%3Ccircle cx='690' cy='654' r='4'/%3E%3C/g%3E%3Cg fill='none' stroke='%2376e4f7' stroke-width='1.5' opacity='.22'%3E%3Cpath d='M392 222c54-74 158-82 218-22 74-50 184-2 188 88 74 20 110 110 64 174 38 76-16 168-102 170-44 76-160 86-218 18-78 40-174-12-182-100-80-26-116-124-58-190-28-52 4-120 90-138Z'/%3E%3Cpath d='M458 292c48-28 104-20 140 18 54-18 112 18 124 72 46 20 64 78 38 122 16 50-22 102-76 108-38 44-110 44-148 2-58 18-116-20-130-78-50-22-68-88-32-132-16-48 24-100 84-112Z'/%3E%3C/g%3E%3C/svg%3E");
  background-position: center 38px;
  background-repeat: no-repeat;
  background-size: min(1180px, 120vw) auto;
  opacity: 0.72;
}

a {
  color: inherit;
}

.topbar {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(5, 13, 25, 0.72);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 clamp(18px, 4vw, 44px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.brand::before {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 10px;
  margin-right: 10px;
  width: 10px;
}

.nav {
  align-items: center;
  display: flex;
  gap: 18px;
}

.nav a,
.link-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.nav a:hover,
.link-button:hover {
  color: var(--text);
}

.shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: clamp(28px, 6vw, 64px) 22px 72px;
}

.page-head {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin: 0 auto 24px;
  max-width: 920px;
  text-align: center;
}

.page-head > div {
  flex: 1;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  color: #fff;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.02;
  margin-bottom: 14px;
}

h2 {
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.run-form,
.section,
.history-card,
.login-panel,
.notice,
.empty {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.run-form {
  display: grid;
  gap: 16px;
  margin: 0 auto;
  max-width: 760px;
  padding: clamp(22px, 4vw, 34px);
}

label {
  color: #d8e8fb;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

select,
input[type="password"],
input[type="search"] {
  background: rgba(2, 9, 19, 0.62);
  border: 1px solid rgba(169, 186, 208, 0.36);
  border-radius: 9px;
  color: var(--text);
  font: inherit;
  min-height: 46px;
  padding: 10px 12px;
  width: 100%;
}

select:focus,
input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(87, 166, 255, 0.18);
  outline: none;
}

button,
.primary-button,
.secondary-button {
  align-items: center;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  text-decoration: none;
}

button,
.primary-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

button:hover,
.primary-button:hover {
  filter: brightness(1.08);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  color: #d8e8fb;
}

.secondary-button:hover {
  border-color: rgba(118, 228, 247, 0.55);
}

.drop-zone {
  align-items: center;
  background: rgba(2, 9, 19, 0.38);
  border: 2px dashed rgba(118, 228, 247, 0.36);
  border-radius: 14px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  min-height: 210px;
  position: relative;
  text-align: center;
}

.drop-zone strong {
  color: #fff;
  font-size: 20px;
}

.drop-zone.is-over {
  background: rgba(87, 166, 255, 0.12);
  border-color: var(--accent);
}

.drop-zone input {
  cursor: pointer;
  inset: 0;
  opacity: 0;
  position: absolute;
}

.file-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-list li {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #dceafe;
  padding: 10px 12px;
}

.file-list.static {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.section {
  margin-top: 24px;
  padding: 22px;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 20px auto;
}

.status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
  white-space: nowrap;
}

.pass {
  background: rgba(126, 226, 168, 0.15);
  color: var(--success);
}

.warning,
.data_stale {
  background: rgba(255, 211, 122, 0.16);
  color: var(--warning);
}

.fail,
.error,
.data_gap {
  background: rgba(255, 139, 130, 0.16);
  color: var(--danger);
}

.skip {
  background: rgba(169, 186, 208, 0.16);
  color: #cbd8e7;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: rgba(255, 255, 255, 0.06);
  color: #d7e8fc;
  font-size: 12px;
  text-transform: uppercase;
}

td {
  color: #d2deee;
}

.table-tools {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.table-tools input {
  max-width: 420px;
}

.history-list,
.run-list {
  display: grid;
  gap: 12px;
}

.history-card {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.run-row {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1.4fr 1fr auto;
  padding: 15px;
  text-decoration: none;
}

.run-row:hover {
  border-color: rgba(118, 228, 247, 0.48);
}

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

.notice,
.empty {
  margin: 0 auto 18px;
  max-width: 760px;
  padding: 16px;
}

.notice.error,
.error-text {
  color: var(--danger);
}

.login-body {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  max-width: 430px;
  padding: 32px;
  text-align: center;
  width: 100%;
}

.login-panel h1 {
  font-size: 34px;
}

.stack {
  display: grid;
  gap: 13px;
  text-align: left;
}

@media (max-width: 760px) {
  .topbar,
  .page-head,
  .table-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .page-head {
    text-align: left;
  }

  .nav {
    flex-wrap: wrap;
  }

  .run-row {
    grid-template-columns: 1fr;
  }

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