:root {
  color-scheme: dark;
  --bg: #071016;
  --panel: #101b24;
  --panel-2: #132331;
  --surface: #172938;
  --surface-2: #203746;
  --text: #eef6fb;
  --muted: #9fb0bd;
  --line: #294354;
  --line-strong: #3d6174;
  --accent: #23a6d5;
  --accent-strong: #43c6f0;
  --accent-soft: rgba(35, 166, 213, 0.14);
  --ok: #55d88a;
  --warn: #f3c766;
  --error: #ff7b72;
  --shadow: rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 15% 0%, rgba(35, 166, 213, 0.22), transparent 30%),
    linear-gradient(135deg, #071016 0%, #0b1720 45%, #10151d 100%);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  width: min(1480px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
}

.shell.wide {
  width: min(1540px, calc(100% - 40px));
}

.panel {
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: rgba(16, 27, 36, 0.94);
  border: 1px solid rgba(87, 130, 153, 0.28);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 24px 80px var(--shadow);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

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

.status {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
  border: 1px solid;
}

.status.ok {
  color: var(--ok);
  background: rgba(85, 216, 138, 0.12);
  border-color: rgba(85, 216, 138, 0.32);
}

.status.warn {
  color: var(--warn);
  background: rgba(243, 199, 102, 0.12);
  border-color: rgba(243, 199, 102, 0.32);
}

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

.top-actions form {
  margin: 0;
}

.nav-button,
button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: #041018;
  cursor: pointer;
  font-weight: 700;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.nav-button:hover,
button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

button.secondary,
.nav-button {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid rgba(143, 172, 190, 0.16);
}

button.secondary:hover,
.nav-button:hover {
  background: #2a4657;
}

.compact {
  min-height: 38px;
  padding: 0 12px;
  font-size: 14px;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1;
  min-height: clamp(520px, 68vh, 820px);
  padding: 44px;
  border: 2px dashed var(--line-strong);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(35, 166, 213, 0.08), transparent 55%),
    var(--panel-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.dropzone::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(143, 172, 190, 0.12);
  border-radius: 10px;
  pointer-events: none;
}

.dropzone.dragging {
  border-color: var(--accent-strong);
  background:
    linear-gradient(180deg, rgba(35, 166, 213, 0.18), rgba(35, 166, 213, 0.06)),
    var(--panel-2);
  box-shadow: inset 0 0 0 1px rgba(67, 198, 240, 0.4), 0 18px 70px rgba(35, 166, 213, 0.16);
  transform: translateY(-1px);
}

.dropzone.busy {
  cursor: wait;
  opacity: 0.86;
}

.file-input,
input[type="file"].file-input {
  display: none !important;
}

.drop-main {
  width: min(740px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.drop-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid rgba(67, 198, 240, 0.28);
  font-size: 46px;
  line-height: 1;
  font-weight: 300;
}

.dropzone strong,
.dropzone span {
  display: block;
}

.dropzone strong {
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
}

.dropzone span {
  color: var(--muted);
  max-width: 680px;
  font-size: 18px;
  line-height: 1.45;
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(87, 130, 153, 0.24);
  border-radius: 12px;
  background: rgba(19, 35, 49, 0.6);
}

.workspace-head div {
  display: grid;
  gap: 4px;
}

.workspace-head strong {
  font-size: 18px;
}

.workspace-head span,
.queue-note {
  color: var(--muted);
  font-size: 14px;
}

.queue-note {
  text-align: right;
}

.upload-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.upload-slot {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
  padding: 16px;
  border: 1px solid rgba(87, 130, 153, 0.24);
  border-radius: 12px;
  background: rgba(11, 22, 32, 0.48);
}

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

.slot-head div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.slot-head strong {
  font-size: 18px;
}

.slot-head span:not(.slot-state) {
  color: var(--muted);
  font-size: 13px;
}

.slot-state {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(32, 55, 70, 0.72);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.slot-state.queued,
.slot-state.sending {
  color: var(--accent-strong);
  border-color: rgba(67, 198, 240, 0.34);
  background: rgba(35, 166, 213, 0.12);
}

.slot-state.review {
  color: var(--warn);
  border-color: rgba(243, 199, 102, 0.34);
  background: rgba(243, 199, 102, 0.1);
}

.slot-state.done {
  color: var(--ok);
  border-color: rgba(85, 216, 138, 0.34);
  background: rgba(85, 216, 138, 0.11);
}

.slot-state.failed {
  color: var(--error);
  border-color: rgba(255, 123, 114, 0.34);
  background: rgba(255, 123, 114, 0.1);
}

.upload-slot .dropzone {
  flex: initial;
  min-height: clamp(360px, 48vh, 620px);
  padding: 28px;
}

.upload-slot .dropzone::before {
  inset: 12px;
}

.upload-slot .drop-main {
  gap: 14px;
}

.upload-slot .drop-icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  font-size: 38px;
}

.upload-slot .dropzone strong {
  font-size: clamp(24px, 2.2vw, 36px);
}

.upload-slot .dropzone span {
  font-size: 15px;
}

.upload-slot .review {
  margin-top: 0;
}

.upload-slot .project-list {
  grid-template-columns: 1fr;
  max-height: min(520px, 52vh);
  overflow: auto;
  padding-right: 4px;
}

.upload-slot .project-card {
  padding: 14px;
}

.upload-slot .project-card-head,
.upload-slot li {
  grid-template-columns: 1fr;
}

.upload-slot li {
  gap: 6px;
}

.upload-slot li small {
  white-space: normal;
}

.review {
  margin-top: 22px;
  display: grid;
  gap: 18px;
}

.batch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(19, 35, 49, 0.76);
}

.batch-head strong {
  font-size: 18px;
}

.batch-head span {
  color: var(--muted);
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.project-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(11, 22, 32, 0.76);
}

.project-card.ready {
  border-color: rgba(85, 216, 138, 0.35);
}

.project-card.needs-review {
  border-color: rgba(243, 199, 102, 0.42);
}

.project-card.skipped {
  border-color: rgba(159, 176, 189, 0.22);
  background: rgba(11, 22, 32, 0.48);
}

.project-card.skipped .project-card-head,
.project-card.skipped .project-fields,
.project-card.skipped .files-box {
  opacity: 0.66;
}

.project-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-card-head strong {
  font-size: 18px;
}

.project-count {
  color: var(--muted);
  white-space: nowrap;
}

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

.project-warnings {
  color: var(--warn);
  font-size: 13px;
  line-height: 1.4;
}

.project-card.ready .project-warnings {
  color: var(--ok);
}

.project-skip-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(143, 172, 190, 0.16);
  border-radius: 8px;
  color: var(--text);
  background: rgba(32, 55, 70, 0.42);
  font-size: 14px;
  cursor: pointer;
}

.project-skip-line input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  accent-color: var(--warn);
}

.project-card.skipped .project-skip-line {
  border-color: rgba(243, 199, 102, 0.34);
  background: rgba(243, 199, 102, 0.1);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: #0b1620;
}

input,
select {
  min-height: 44px;
}

textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.4;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(35, 166, 213, 0.28);
  border-color: var(--accent);
}

.files-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #0b1620;
}

.box-title {
  padding: 12px 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

li:last-child {
  border-bottom: 0;
}

li span {
  overflow-wrap: anywhere;
}

li small {
  color: var(--muted);
  white-space: nowrap;
}

.file-meta {
  color: var(--accent-strong);
}

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

.message {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid;
}

.message.info {
  color: var(--accent-strong);
  background: rgba(35, 166, 213, 0.1);
  border-color: rgba(67, 198, 240, 0.28);
}

.message.success {
  color: var(--ok);
  background: rgba(85, 216, 138, 0.12);
  border-color: rgba(85, 216, 138, 0.32);
}

.message.warn {
  color: var(--warn);
  background: rgba(243, 199, 102, 0.12);
  border-color: rgba(243, 199, 102, 0.32);
}

.message.error {
  color: var(--error);
  background: rgba(255, 123, 114, 0.1);
  border-color: rgba(255, 123, 114, 0.32);
}

.message-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.message-list li {
  display: block;
  padding: 8px 0 0;
  border-color: rgba(255, 123, 114, 0.22);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.hidden {
  display: none;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(460px, 100%);
  background: rgba(16, 27, 36, 0.96);
  border: 1px solid rgba(87, 130, 153, 0.28);
  border-radius: 14px;
  padding: 30px;
  box-shadow: 0 24px 80px var(--shadow);
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.settings-form {
  display: grid;
  gap: 28px;
  margin-top: 22px;
}

.settings-section {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(87, 130, 153, 0.24);
  border-radius: 12px;
  background: rgba(19, 35, 49, 0.72);
}

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

.settings-grid .full {
  grid-column: 1 / -1;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
}

.check-line input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  padding: 14px 0 0;
  background: linear-gradient(180deg, rgba(16, 27, 36, 0), rgba(16, 27, 36, 0.96) 35%);
}

@media (max-width: 1180px) {
  .upload-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .shell,
  .shell.wide {
    width: min(100% - 20px, 1480px);
    padding: 10px 0;
  }

  .panel {
    min-height: calc(100vh - 20px);
    padding: 18px;
  }

  .topbar {
    display: grid;
  }

  .topbar,
  .review-grid,
  .project-fields,
  .settings-grid,
  .workspace-head,
  .upload-grid,
  li {
    grid-template-columns: 1fr;
  }

  .workspace-head,
  .queue-note {
    text-align: left;
  }

  .workspace-head {
    display: grid;
  }

  .dropzone {
    min-height: 520px;
    padding: 24px;
  }

  .upload-slot .dropzone {
    min-height: 430px;
  }

  .actions {
    display: grid;
  }

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

@media (max-width: 520px) {
  .dropzone {
    min-height: 430px;
  }

  .drop-icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    font-size: 38px;
  }

  .dropzone span {
    font-size: 16px;
  }
}
