:root {
  color-scheme: light;
  --bg: #f7f2eb;
  --bg-strong: #efe3d4;
  --panel: rgba(255, 255, 255, 0.92);
  --ink: #0c1517;
  --muted: #4b5b61;
  --accent: #ff7a45;
  --accent-dark: #e6571d;
  --teal: #2cb7a1;
  --shadow: 0 18px 45px rgba(16, 24, 40, 0.12);
  --radius: 18px;
  --grid: minmax(0, 1fr);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", "Noto Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #f9f7f4 0%, #f3eadc 45%, #f1f6f5 100%);
  min-height: 100vh;
}

.backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(0);
  opacity: 0.7;
  animation: drift 18s ease-in-out infinite;
}

.orb--one {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle at 30% 30%, #ffe3d3 0%, #ff9e73 65%, transparent 100%);
  top: -120px;
  left: -80px;
}

.orb--two {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle at 70% 40%, #d2f4f0 0%, #59d1c1 60%, transparent 100%);
  top: 20%;
  right: -140px;
  animation-delay: -6s;
}

.orb--three {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle at 40% 50%, #fff2c5 0%, #f7b955 65%, transparent 100%);
  bottom: -120px;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: -12s;
}

.gridlines {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(12, 21, 23, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(12, 21, 23, 0.05) 1px, transparent 1px);
  background-size: 120px 120px;
  mix-blend-mode: multiply;
  opacity: 0.15;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(2, var(--grid));
  gap: 28px;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

h1 {
  font-size: clamp(32px, 5vw, 52px);
  margin: 0 0 8px;
}

.subtitle {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
  max-width: 480px;
}

.hero__meta {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.stat {
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  border-radius: 14px;
  min-width: 240px;
}

.stat__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.stat__value {
  font-size: 20px;
  font-weight: 600;
  display: block;
  margin-top: 6px;
}

.stat__hint {
  font-size: 12px;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tab {
  border: 1px solid rgba(12, 21, 23, 0.2);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.tab.is-active {
  background: linear-gradient(120deg, var(--accent), #ffb13d);
  border-color: transparent;
  color: #1d0f0a;
  box-shadow: 0 12px 25px rgba(255, 122, 69, 0.2);
}

.tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.12);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.panel__header h2 {
  margin: 0;
  font-size: 22px;
}

.panel__header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.panel__tools {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.panel__section {
  margin-top: 24px;
}

.panel__section h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.panel__section .muted {
  margin: 0 0 12px;
}

.panel__section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

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

.form {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form--catalog {
  margin-bottom: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.field input,
.field select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(12, 21, 23, 0.12);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

.field--row {
  align-items: center;
  flex-direction: row;
  justify-content: flex-start;
  gap: 12px;
  grid-column: span 2;
  padding: 8px 0;
}

.field--row input {
  width: auto;
  margin: 0;
}

.form__actions {
  grid-column: span 2;
  display: flex;
  gap: 12px;
}

.form__status {
  grid-column: span 2;
  min-height: 22px;
  font-size: 13px;
  color: var(--muted);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.btn--primary {
  background: linear-gradient(120deg, var(--accent), #ffb13d);
  color: #1d0f0a;
  box-shadow: 0 12px 25px rgba(255, 122, 69, 0.25);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(12, 21, 23, 0.2);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.12);
}

.table {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.table__head,
.table__row {
  display: grid;
  grid-template-columns: 70px 1.2fr 0.8fr 0.8fr 0.9fr 1.4fr 0.9fr;
  gap: 12px;
  align-items: center;
}

.table__head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.table__row {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(12, 21, 23, 0.08);
  font-size: 13px;
  cursor: default;
  overflow-wrap: anywhere;
}

.table--jobs .table__row {
  cursor: pointer;
  transition: background 0.2s ease;
}

.table--jobs .table__row:hover {
  background: rgba(255, 255, 255, 0.9);
}

.table--catalog .table__row {
  cursor: default;
}

.table--catalog .table__head,
.table--catalog .table__row {
  grid-template-columns: 70px 1fr 1.4fr 0.6fr 1.6fr 1fr;
}

.table--jobs .table__head,
.table--jobs .table__row {
  grid-template-columns: 70px 1.1fr 0.6fr 0.6fr 0.8fr 0.9fr 1.3fr 0.8fr 1.6fr 0.6fr;
}

.table--outbox .table__head,
.table--outbox .table__row {
  grid-template-columns: 1.2fr 1fr 0.7fr 0.5fr 0.8fr 0.8fr 0.8fr 1.4fr 0.6fr;
}

.table--outbox-failed .table__head,
.table--outbox-failed .table__row {
  grid-template-columns: 1fr 1fr 1fr 0.6fr 1.6fr 0.9fr 0.7fr;
}

.tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(44, 183, 161, 0.16);
  color: #0d3a35;
  font-size: 12px;
  font-weight: 600;
}

.tag--warn {
  background: rgba(255, 122, 69, 0.16);
  color: #7c2d12;
}

.tag--muted {
  background: rgba(12, 21, 23, 0.08);
  color: var(--muted);
}

.job-error {
  color: #9b1c1c;
  font-size: 12px;
  line-height: 1.3;
}

.job-error--empty {
  color: var(--muted);
}

.job-step {
  font-size: 12px;
  color: var(--muted);
}

.job-actions {
  display: flex;
  align-items: center;
}

.job-actions button {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(12, 21, 23, 0.2);
  background: transparent;
  cursor: pointer;
  color: var(--ink);
}

.job-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.outbox-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

.outbox-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.outbox-actions button {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(12, 21, 23, 0.2);
  background: transparent;
  cursor: pointer;
  color: var(--ink);
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(12, 21, 23, 0.08);
  overflow: hidden;
  margin-top: 6px;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(120deg, var(--teal), #7de3c9);
  width: 0%;
}

.files {
  display: grid;
  gap: 20px;
  margin-top: 18px;
}

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

.files__group {
  border-radius: 14px;
  padding: 18px;
  border: 1px solid rgba(12, 21, 23, 0.08);
  background: rgba(255, 255, 255, 0.8);
}

.files__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.files__list {
  display: grid;
  gap: 10px;
}

.file-row {
  display: grid;
  grid-template-columns: 1.2fr 0.4fr 0.6fr 0.8fr 1fr 0.6fr;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.file-row__name {
  font-weight: 600;
  color: var(--ink);
}

.file-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.muted {
  font-size: 12px;
  color: var(--muted);
}

.file-actions a,
.file-actions button {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(12, 21, 23, 0.2);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
}

.empty {
  font-size: 13px;
  color: var(--muted);
  padding: 12px 0;
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(20px);
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .form {
    grid-template-columns: 1fr;
  }
  .field--row,
  .form__actions,
  .form__status {
    grid-column: span 1;
  }
  .table__head,
  .table__row {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
  }
  .table__head span:nth-child(n + 3),
  .table__row span:nth-child(n + 3) {
    display: none;
  }
  .table--catalog .table__head,
  .table--catalog .table__row {
    grid-template-columns: 1fr 1fr;
  }
  .file-row {
    grid-template-columns: 1fr 0.5fr 0.6fr;
  }
  .file-row span:nth-child(n + 4) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb {
    animation: none;
  }
  .btn {
    transition: none;
  }
}
