:root {
  color-scheme: dark;
  --bg: #071014;
  --panel: #101b20;
  --panel-2: #14242b;
  --line: #273940;
  --text: #e7f2f3;
  --muted: #93a8ad;
  --green: #38d889;
  --amber: #f0b84f;
  --red: #ff5f66;
  --cyan: #48c7e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  overflow: auto;
}

button,
input {
  font: inherit;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 22px;
  background: radial-gradient(circle at 30% 20%, #0d2c3d 0, #071014 42%);
}

.login-screen.is-hidden,
.app-shell.is-locked {
  display: none;
}

.login-card {
  display: grid;
  width: min(430px, 100%);
  gap: 18px;
  border: 1px solid var(--line);
  background: #081317;
  padding: 24px;
}

.login-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.login-card input {
  min-height: 42px;
  border: 1px solid var(--line);
  background: #0e1a1f;
  color: var(--text);
  padding: 0 12px;
}

.login-brand {
  padding-bottom: 6px;
}

.login-error {
  min-height: 20px;
  color: var(--red);
  font-size: 14px;
}

.primary-button {
  min-height: 42px;
  border: 1px solid var(--cyan);
  background: #0e3242;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  height: auto;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  border-right: 1px solid var(--line);
  background: #081317;
  padding: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #2d4a52;
  background: #12252b;
  color: var(--cyan);
  font-weight: 800;
}

.brand small,
.eyebrow,
.panel p,
.muted,
.sidebar-footer {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item,
.secondary-button,
.icon-button {
  border: 1px solid var(--line);
  background: #0e1a1f;
  color: var(--text);
  cursor: pointer;
}

.nav-item {
  padding: 11px 12px;
  text-align: left;
}

.nav-item.is-active,
.secondary-button:hover,
.icon-button:not(:disabled):hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.content {
  min-width: 0;
  min-height: 0;
  overflow: visible;
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.topbar,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
}

.eyebrow {
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
}

.icon-button {
  min-width: 56px;
  height: 40px;
  padding: 0 12px;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.view {
  display: none;
  min-height: 0;
  overflow: auto;
}

.view.is-visible {
  display: block;
}

#upload.view.is-visible {
  display: grid;
  align-content: start;
  gap: 14px;
  flex: 1;
  overflow: visible;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(340px, 1fr);
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 16px;
}

.upload-panel,
.settings-panel {
  display: grid;
  gap: 16px;
}

.upload-panel-head,
.upload-actions,
.upload-summary {
  display: flex;
  align-items: center;
}

.upload-panel-head {
  justify-content: space-between;
  gap: 14px;
}

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

.upload-summary {
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  background: #0c161b;
  padding: 10px 14px;
}

.upload-summary strong,
.upload-summary small {
  display: block;
}

.upload-summary {
  flex-direction: column;
  align-items: flex-start;
}

.upload-panel-body {
  display: grid;
  gap: 14px;
}

.upload-panel.is-collapsed .upload-panel-body {
  display: none;
}

.omit-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  background: #0c161b;
  padding: 14px;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}

.toggle-field input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--cyan);
}

.omit-panel label:not(.toggle-field) {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.omit-panel select,
.omit-panel input[type="text"] {
  min-height: 42px;
  border: 1px solid var(--line);
  background: #0e1a1f;
  color: var(--text);
  padding: 0 12px;
}

.omit-list-wrap {
  display: grid;
  gap: 10px;
}

.omit-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.omit-list {
  min-height: 132px;
  max-height: 220px;
  border: 1px solid var(--line);
  background: #0e1a1f;
  color: var(--text);
  padding: 10px 12px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.omit-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .02);
}

.omit-list-item input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--cyan);
}

.omit-list-item label {
  flex: 1;
  cursor: pointer;
  font-size: 14px;
}

.omit-list-empty {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.omit-panel .clear-filter-button {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.omit-panel select:disabled,
.omit-panel input[type="text"]:disabled {
  opacity: .55;
}

.field-hint {
  font-size: 13px;
  line-height: 1.45;
}

.dropzone {
  display: grid;
  min-height: 124px;
  place-items: center;
  gap: 6px;
  border: 1px dashed #41606a;
  background: var(--panel-2);
  cursor: pointer;
  text-align: center;
}

.dropzone input {
  display: none;
}

.dropzone.is-dragging {
  border-color: var(--green);
}

.drop-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--green);
  font-size: 30px;
}

.process-state {
  border-left: 3px solid var(--cyan);
  background: #0b181d;
  padding: 10px 12px;
  color: var(--muted);
}

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

.validation-list li {
  border: 1px solid var(--line);
  padding: 10px;
}

.validation-list .ok {
  border-color: rgba(56, 216, 137, .45);
}

.validation-list .warn {
  border-color: rgba(240, 184, 79, .55);
}

.validation-list .bad {
  border-color: rgba(255, 95, 102, .55);
}

.dashboard-frame {
  border: 1px solid var(--line);
  background: #050b0e;
  padding: 12px;
  min-height: 0;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

canvas {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 220px);
  min-width: 0;
  height: auto;
}

.report-view-state {
  display: none;
  border: 1px solid var(--line);
  background: #09161d;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 14px;
}

.report-view-state.is-visible {
  display: block;
}

.report-view-state.is-history {
  border-color: rgba(72, 199, 232, .55);
  color: var(--cyan);
}

.report-view-state.is-current {
  border-color: rgba(56, 216, 137, .4);
  color: var(--green);
}

.report-view-state.is-warn {
  border-color: rgba(255, 95, 102, .45);
  color: var(--red);
}

.report-view-state.is-idle {
  border-color: rgba(147, 168, 173, .35);
}

.secondary-button {
  min-height: 36px;
  padding: 0 12px;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.history-row {
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.history-row:hover,
.history-row:focus-visible {
  background: #10212b;
  outline: none;
}

.history-row.is-selected {
  background: rgba(72, 199, 232, .12);
}

code {
  display: block;
  border: 1px solid var(--line);
  background: #081317;
  padding: 12px;
  color: var(--cyan);
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content {
    overflow: visible;
  }

  .work-grid,
  .topbar,
  .section-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .upload-panel-head {
    align-items: flex-start;
  }

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

  #upload.view.is-visible {
    display: block;
    overflow: visible;
  }

  .dashboard-frame {
    min-height: unset;
  }

  canvas {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: calc(100vh - 220px);
    min-width: 0;
    height: auto;
  }
}
