:root {
  --c1: #364652;
  --c2: #071108;
  --c3: #bfb1c1;
  --c4: #b5bec6;
  --c5: #c7dbe6;
  --bg: var(--c2);
  --panel: rgba(54, 70, 82, 0.62);
  --panel-strong: rgba(54, 70, 82, 0.76);
  --line: rgba(199, 219, 230, 0.28);
  --text: #f1f5f8;
  --muted: var(--c4);
  --accent: var(--c5);
  --accent-2: var(--c3);
  --ok: #9fe0bc;
  --error: #f0a6a6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(155deg, #071108 0%, #132028 48%, #364652 100%);
  position: relative;
}

.ambient {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  filter: blur(40px);
  opacity: 0.55;
}

.ambient-left {
  top: -60px;
  left: -120px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(191, 177, 193, 0.75) 0%, rgba(191, 177, 193, 0) 70%);
}

.ambient-right {
  right: -100px;
  bottom: -80px;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(199, 219, 230, 0.75) 0%, rgba(199, 219, 230, 0) 70%);
}

.page {
  max-width: 1180px;
  margin: 28px auto;
  padding: 0 16px 28px;
  position: relative;
  z-index: 1;
}

.shell {
  display: grid;
  grid-template-columns: 64px 1.35fr 1fr;
  gap: 16px;
  align-items: start;
}

.dock {
  background: rgba(54, 70, 82, 0.45);
  border: 1px solid rgba(199, 219, 230, 0.24);
  border-radius: 20px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  backdrop-filter: blur(12px);
  min-height: 360px;
}

.dock-logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--c5), var(--c3));
  color: #102028;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.dock-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(199, 219, 230, 0.55);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--c5);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 600;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.hero-chip {
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(107, 195, 255, 0.16);
  color: #ccecff;
  border: 1px solid rgba(107, 195, 255, 0.45);
  white-space: nowrap;
}

.sub {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 48ch;
}

.upload {
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 0.84rem;
  margin-bottom: 8px;
  color: var(--c5);
  font-weight: 400;
}

.field-help {
  display: block;
  margin: 4px 0 7px;
  color: var(--c4);
  font-size: 0.75rem;
  line-height: 1.35;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(199, 219, 230, 0.28);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 0.92rem;
  color: var(--text);
  background: rgba(7, 17, 8, 0.62);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus,
select:focus {
  border-color: rgba(199, 219, 230, 0.85);
  box-shadow: 0 0 0 3px rgba(199, 219, 230, 0.22);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.two-col {
  margin-bottom: 10px;
}

.block-title {
  margin: 18px 0 10px;
  color: var(--c5);
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  border: 0;
  border-radius: 11px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  color: #0c171e;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.btn-secondary {
  color: #0f1827;
  background: linear-gradient(135deg, var(--c4), var(--c5));
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  border: 1px solid rgba(199, 219, 230, 0.35);
  border-radius: 11px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  color: var(--c5);
  background: rgba(54, 70, 82, 0.35);
}

.btn-row-delete {
  border: 1px solid rgba(255, 139, 139, 0.45);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffd9d9;
  background: rgba(255, 139, 139, 0.12);
  cursor: pointer;
}

.btn-row-delete:hover {
  background: rgba(255, 139, 139, 0.2);
}

#submitBtn[disabled] {
  opacity: 0.7;
  cursor: wait;
}

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

.btn-secondary:disabled,
.btn-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.panel-results h2 {
  margin-bottom: 8px;
}

.panel-span {
  grid-column: 2 / 4;
}

#totalCount {
  color: var(--c5);
  margin-top: 0;
}

.tableWrap {
  overflow-x: auto;
  margin-top: 14px;
  border: 1px solid rgba(199, 219, 230, 0.2);
  border-radius: 12px;
}

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

th,
td {
  text-align: left;
  border-bottom: 1px solid rgba(199, 219, 230, 0.13);
  padding: 10px 8px;
  font-size: 0.89rem;
}

th {
  color: var(--c5);
  background: rgba(54, 70, 82, 0.25);
}

.status-ok {
  color: var(--ok);
  font-weight: 600;
}

.error {
  color: var(--error);
  min-height: 1.2rem;
}

.hidden {
  display: none;
}

.panel-preview {
  position: sticky;
  top: 18px;
}

.preview-sub {
  margin: 6px 0 10px;
  color: var(--c5);
  font-size: 0.9rem;
}

.canvas-wrap {
  width: 100%;
  border: 1px solid rgba(199, 219, 230, 0.18);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(7, 17, 8, 0.55);
}

#previewCanvas {
  width: 100%;
  display: block;
  min-height: 180px;
}

.preview-hint {
  margin: 10px 0 10px;
  color: var(--c4);
  font-size: 0.84rem;
}

.file-list {
  display: grid;
  gap: 8px;
}

.file-item {
  border: 1px solid rgba(199, 219, 230, 0.2);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(54, 70, 82, 0.22);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-size: 0.86rem;
}

.file-item.active {
  border-color: rgba(199, 219, 230, 0.85);
  box-shadow: 0 0 0 2px rgba(199, 219, 230, 0.2) inset;
}

.file-meta {
  display: block;
  margin-top: 3px;
  color: var(--c4);
  font-size: 0.78rem;
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .dock {
    min-height: auto;
    flex-direction: row;
    justify-content: center;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .panel-span {
    grid-column: auto;
  }

  .panel-preview {
    position: static;
  }
}

.page-footer {
  max-width: 1180px;
  margin: 4px auto 24px;
  padding: 0 16px;
  color: var(--c4);
  font-size: 0.84rem;
  text-align: center;
}

.page-footer a {
  color: var(--c5);
  text-decoration: none;
  border-bottom: 1px solid rgba(199, 219, 230, 0.45);
}
