:root {
  --bg-primary: #0b0d12;
  --bg-secondary: #111520;
  --bg-card: #161b28;
  --bg-card-hover: #1c2235;
  --bg-input: #0e1119;
  --border: #252d40;
  --border-focus: #3d6bff;
  --text-1: #e4e9f2;
  --text-2: #8892a8;
  --text-3: #505a6e;
  --blue: #3d6bff;
  --blue-dim: #2a4db3;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --purple: #a855f7;
  --cyan: #06b6d4;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-1);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 40px;
}

.header {
  margin-bottom: 32px;
}

.header-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.header-sub {
  font-size: 14px;
  color: var(--text-2);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 12px 18px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: var(--text-1);
}

.tab-btn.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ── Card ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ── Form controls ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-1);
  font-size: 13px;
  font-family: 'DM Sans', system-ui, sans-serif;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.form-textarea {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  min-height: 300px;
  resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(61, 107, 255, 0.15);
}

.form-input[type="file"] { padding: 7px 14px; }

/* ── Buttons ── */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: all .15s;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover { background: var(--blue-dim); }

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
  background: rgba(34, 197, 94, 0.25);
}

.btn.full-width { width: 100%; padding: 11px 16px; }

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ── Status ── */
.status {
  margin-top: 16px;
  min-height: 20px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.5;
}

.status.success { color: var(--green); }
.status.error { color: var(--red); }
.status.info { color: var(--blue); }

/* ── File list ── */
.file-list {
  display: grid;
  gap: 12px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.15s;
}

.file-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.file-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  word-break: break-all;
  margin-bottom: 4px;
}

.file-size {
  font-size: 11px;
  color: var(--text-3);
}

.file-actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ── Category selector ── */
.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.category-tab {
  padding: 8px 16px;
  background: var(--bg-input);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}

.category-tab:hover {
  border-color: var(--border-focus);
}

.category-tab.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-3);
  font-size: 14px;
}

/* ── Multiple select ── */
.multi-file-input-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.multi-file-input-label {
  display: block;
  padding: 16px;
  background: var(--bg-input);
  border: 2px dashed var(--border);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
  color: var(--text-2);
}

.multi-file-input-label:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.multi-file-input-label.dragover {
  border-color: var(--blue);
  background: rgba(61, 107, 255, 0.1);
}

#multiFileInput {
  display: none;
}

.selected-files {
  margin-top: 12px;
  padding: 12px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 6px;
  color: var(--green);
  font-size: 13px;
}

.selected-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(61, 107, 255, 0.1);
  border: 1px solid rgba(61, 107, 255, 0.3);
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 12px;
  font-family: 'Space Mono', monospace;
}

.selected-file-item:last-child {
  margin-bottom: 0;
}

.selected-file-name {
  flex: 1;
  word-break: break-all;
  margin-right: 8px;
}

.selected-file-remove {
  background: rgba(239, 68, 68, 0.2);
  color: var(--red);
  border: none;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
  flex-shrink: 0;
}

.selected-file-remove:hover {
  background: rgba(239, 68, 68, 0.4);
}

@media (max-width: 768px) {
  .container { padding: 20px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .tabs { flex-wrap: wrap; }
}
