:root {
  --wits-blue: #002d72;
  --true-blue: #009ade;
  --aqua: #48c1bb;
  --apple: #3dae2b;
  --violet: #8347ad;
  --ruby: #e81f76;
  --lime: #f2e505;
  --white: #ffffff;
  --ink: #071323;
  --muted: #5b677a;
  --line: #dce5ef;
  --surface: #ffffff;
  --surface-soft: #f7fbff;
  --shadow: 0 18px 55px rgba(0, 45, 114, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(0, 45, 114, 0.06) 0%, rgba(0, 154, 222, 0.04) 36%, rgba(72, 193, 187, 0.06) 100%),
    var(--white);
}


a { color: var(--wits-blue); text-decoration: none; font-weight: 700; }
a:hover { color: var(--true-blue); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 45, 114, 0.12);
}

.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 52px; gap: 16px; }

.brand {
  display: inline-flex;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--wits-blue);
  letter-spacing: -0.01em;
}

.nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav a, .link-button {
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  color: var(--wits-blue);
}
.nav a:hover, .link-button:hover { background: rgba(0, 154, 222, 0.1); text-decoration: none; }

.content { padding-top: 28px; padding-bottom: 52px; }

.hero, .panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 45, 114, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 26px;
  border-left: 6px solid var(--true-blue);
}

.panel { padding: 22px; }
.hero h1 { margin: 0 0 8px; color: var(--wits-blue); font-size: 2rem; line-height: 1.1; letter-spacing: 0; }
.hero p { max-width: 760px; }
.panel h2 { margin-top: 0; color: var(--wits-blue); }

.button, .button.primary, .link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid rgba(0, 45, 114, 0.14);
  padding: 0.72rem 0.95rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: var(--white);
  color: var(--wits-blue);
  text-decoration: none;
  min-height: 42px;
}

.button.primary {
  background: linear-gradient(135deg, var(--wits-blue), var(--true-blue));
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(0, 45, 114, 0.22);
}

.button.success {
  background: linear-gradient(135deg, #1a7a4a, #24a96a);
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(26, 122, 74, 0.22);
}
.button:hover { transform: translateY(-1px); text-decoration: none; border-color: var(--true-blue); }
.button.primary:hover { color: var(--white); }
.button.success:hover { color: var(--white); border-color: transparent; }
.link-button { background: transparent; padding: 0.55rem 0.75rem; border: 0; box-shadow: none; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }

.filters, .upload-form, .login-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.filters label { display: flex; flex-direction: column; gap: 6px; min-width: 170px; font-size: 0.9rem; color: var(--wits-blue); font-weight: 800; }

input[type="text"], input[type="password"], input[type="file"], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  font: inherit;
  background: var(--white);
  color: var(--ink);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--true-blue);
  box-shadow: 0 0 0 4px rgba(0, 154, 222, 0.14);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(0, 45, 114, 0.1);
  border-radius: 8px;
}

table { width: 100%; border-collapse: collapse; min-width: 820px; background: var(--white); }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th {
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wits-blue);
  background: linear-gradient(180deg, #f7fbff, #eef7ff);
}
tbody tr:hover { background: rgba(72, 193, 187, 0.08); }
tr:last-child td { border-bottom: none; }
.empty { text-align: center; color: var(--muted); padding: 28px; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-complete, .badge.complete { background: rgba(61, 174, 43, 0.14); color: #237318; }
.status-needs_review, .badge.needs_review { background: rgba(242, 229, 5, 0.26); color: #685f00; }
.status-failed, .badge.failed { background: rgba(232, 31, 118, 0.12); color: var(--ruby); }
.status-processing, .badge.processing { background: rgba(0, 154, 222, 0.14); color: var(--wits-blue); }
.status-uploaded, .badge.uploaded { background: rgba(131, 71, 173, 0.12); color: var(--violet); }

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; margin: 0; }
.danger-link { color: var(--ruby); border: 0; background: transparent; font: inherit; font-weight: 800; cursor: pointer; padding: 0; }
.danger-link:hover { color: #b01259; }

.record-frame {
  width: 100%;
  min-height: 82vh;
  border: 1px solid rgba(0, 45, 114, 0.12);
  border-radius: 8px;
  background: var(--white);
}

.warning {
  border-left-color: var(--ruby);
  background: linear-gradient(135deg, rgba(232, 31, 118, 0.08), rgba(242, 229, 5, 0.12), var(--white));
}

.error-text { color: var(--ruby); font-weight: 800; }
.center { text-align: center; }

.logs { display: grid; gap: 10px; }
.log-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.log-level { text-transform: uppercase; font-size: 0.76rem; font-weight: 900; color: var(--true-blue); }
textarea { resize: vertical; min-width: 220px; }
code { color: var(--wits-blue); background: rgba(0, 154, 222, 0.08); padding: 0.1rem 0.25rem; border-radius: 4px; }

@media (max-width: 800px) {
  .wrap { padding: 0 14px; }
  .hero { padding: 18px; }
  .hero h1 { font-size: 1.6rem; }
  .topbar-inner { flex-direction: column; align-items: flex-start; padding: 12px 0; }
  .log-row { grid-template-columns: 1fr; }
  .filters label, .filters .button, .upload-form .button, .login-form .button { width: 100%; }
}
