/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:        #1a1b26;
  --bg-2:      #1f2335;
  --bg-3:      #24283b;
  --bg-4:      #2f3549;
  --border:    #3b4261;
  --text:      #c0caf5;
  --text-dim:  #7982a9;
  --accent:    #e0af68;
  --accent-bg: rgba(224, 175, 104, 0.12);
  --green:     #9ece6a;
  --green-bg:  rgba(158, 206, 106, 0.12);
  --red:       #f7768e;
  --red-bg:    rgba(247, 118, 142, 0.12);
  --blue:      #7aa2f7;
  --blue-bg:   rgba(122, 162, 247, 0.12);
  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.18s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-3);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-bg);
}

.nav-separator {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 6px;
}

.nav-link--doc {
  font-size: 12px;
  opacity: 0.7;
}

.nav-link--doc:hover {
  opacity: 1;
}

/* ===== MAIN LAYOUT ===== */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* ===== SECTION ===== */
.section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-desc {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: -8px;
}

/* ===== PREVIOUS UPLOAD BANNER ===== */
.previous-upload-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--green-bg);
  border: 1px solid var(--green);
  border-radius: var(--radius-lg);
}

.banner-icon {
  color: var(--green);
  flex-shrink: 0;
}

.banner-text {
  font-size: 13px;
  color: var(--text);
}

/* ===== ARCHIVE UPLOAD ===== */
.archive-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.archive-drop {
  width: 100%;
  max-width: 500px;
  min-height: 120px;
  border: 2px dashed var(--accent);
  background: var(--accent-bg);
}

.archive-drop.has-file {
  border-color: var(--green);
  background: var(--green-bg);
}

.upload-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: var(--text-dim);
  font-size: 13px;
}

.upload-divider::before,
.upload-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== UPLOAD GRID ===== */
.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.file-card {
  position: relative;
}

.file-input {
  display: none;
}

.file-drop-zone {
  background: var(--bg-2);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  min-height: 160px;
  justify-content: center;
}

.file-drop-zone:hover,
.file-card:hover .file-drop-zone {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: 0 0 0 1px var(--accent);
}

.file-drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow);
}

.file-drop-zone.has-file {
  border-color: var(--green);
  background: var(--green-bg);
  border-style: solid;
}

.drop-icon {
  color: var(--text-dim);
  transition: color var(--transition);
}

.file-drop-zone.has-file .drop-icon {
  color: var(--green);
}

.file-drop-zone:hover .drop-icon,
.file-card:hover .file-drop-zone .drop-icon {
  color: var(--accent);
}

.drop-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.drop-hint {
  font-size: 11px;
  color: var(--text-dim);
}

.drop-filename {
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
  word-break: break-all;
  max-width: 100%;
}

/* ===== UPLOAD ACTIONS ===== */
.upload-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.cutoff-date-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cutoff-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}

.cutoff-input {
  padding: 4px 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  color-scheme: dark;
}

.cutoff-input:focus {
  border-color: var(--blue);
}

.cutoff-hint {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ===== UPLOAD PROGRESS ===== */
.upload-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.progress-bar-wrap {
  height: 8px;
  background: var(--bg-4);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 13px;
  color: var(--text);
  font-family: 'Consolas', 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
  min-height: 1.4em;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition), transform var(--transition);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:not(:disabled):active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--bg-4);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-primary:not(:disabled):hover {
  background: var(--bg-3);
  border-color: var(--text-dim);
}

.btn-accent {
  background: var(--accent);
  color: #1a1b26;
}

.btn-accent:not(:disabled):hover {
  background: #d4a060;
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color var(--transition);
}

.stat-card:hover {
  border-color: var(--text-dim);
}

.stat-card.accent {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.stat-card.accent .stat-value {
  color: var(--accent);
}

.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== TABLE TOOLBAR (filter + pagination) ===== */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.table-filter {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  padding: 8px 14px 8px 36px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

.table-filter:focus {
  border-color: var(--blue);
}

.table-filter::placeholder {
  color: var(--text-dim);
}

.filter-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.filter-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.filter-wrap .table-filter {
  width: 100%;
}

.table-select {
  padding: 8px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.table-select:focus {
  border-color: var(--blue);
}

.table-count {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.pagination .btn-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.pagination .btn-page:hover:not(:disabled) {
  background: var(--bg-4);
  color: var(--text);
  border-color: var(--text-dim);
}

.pagination .btn-page:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination .btn-page.active {
  background: var(--blue-bg);
  border-color: var(--blue);
  color: var(--blue);
}

.pagination .page-info {
  font-size: 12px;
  color: var(--text-dim);
  padding: 0 8px;
}

/* ===== SORTABLE HEADERS ===== */
.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 20px;
}

.data-table th.sortable:hover {
  color: var(--text);
}

.data-table th.sortable::after {
  content: '\21C5';
  position: absolute;
  right: 4px;
  opacity: 0.3;
  font-size: 10px;
}

.data-table th.sortable.sort-asc::after {
  content: '\25B2';
  opacity: 0.8;
  color: var(--blue);
}

.data-table th.sortable.sort-desc::after {
  content: '\25BC';
  opacity: 0.8;
  color: var(--blue);
}

/* ===== TABLES ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-2);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead {
  background: var(--bg-3);
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover td {
  background: var(--bg-3);
}

.data-table .mono {
  font-family: 'Consolas', 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--blue);
}

.data-table td:first-child {
  white-space: nowrap;
}

.data-table .skipped-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.badge-green {
  background: var(--green-bg);
  color: var(--green);
}

.badge-red {
  background: var(--red-bg);
  color: var(--red);
}

.badge-blue {
  background: var(--blue-bg);
  color: var(--blue);
}

.badge-accent {
  background: rgba(224,175,104,0.15);
  color: #e0af68;
}

.badge-dim {
  background: var(--bg-4);
  color: var(--text-dim);
}

.badge-yellow {
  background: rgba(224, 175, 104, 0.15);
  color: var(--accent);
}

/* ===== WARNINGS ===== */
.warnings-box {
  background: rgba(247, 118, 142, 0.08);
  border: 1px solid rgba(247, 118, 142, 0.25);
  border-radius: 8px;
  padding: 16px 20px;
  margin-top: 20px;
}

.warnings-title {
  color: var(--red);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.warnings-box ul {
  list-style: none;
  padding: 0;
}

.warnings-box li {
  color: var(--text);
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(247, 118, 142, 0.1);
}

.warnings-box li:last-child {
  border-bottom: none;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 24px;
  color: var(--text-dim);
  text-align: center;
}

.empty-state svg {
  opacity: 0.4;
}

.empty-state p {
  font-size: 14px;
  line-height: 1.7;
}

/* ===== EXPORT CARD ===== */
.export-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.export-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.export-info {
  flex: 1;
  min-width: 200px;
}

.export-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
}

.export-desc {
  color: var(--text-dim);
  font-size: 13px;
}

/* ===== TOAST NOTIFICATIONS ===== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  pointer-events: all;
  animation: toast-in 0.25s ease forwards;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.toast-success {
  border-color: var(--green);
  background: var(--green-bg);
  color: var(--green);
}

.toast.toast-error {
  border-color: var(--red);
  background: var(--red-bg);
  color: var(--red);
}

.toast.toast-info {
  border-color: var(--blue);
  background: var(--blue-bg);
  color: var(--blue);
}

.toast.toast-out {
  animation: toast-out 0.25s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(12px); }
}

/* ===== LOGIC CARDS ===== */
.logic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  align-items: start;
}

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

.logic-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.logic-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logic-card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.logic-icon {
  font-size: 18px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.logic-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.logic-list li {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  padding-left: 14px;
  position: relative;
}

.logic-list li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--text-dim);
}

.logic-list-numbered {
  counter-reset: logic-step;
}

.logic-list-numbered li {
  padding-left: 24px;
}

.logic-list-numbered li::before {
  content: counter(logic-step);
  counter-increment: logic-step;
  position: absolute;
  left: 0;
  width: 18px;
  height: 18px;
  background: var(--bg-4);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  top: 3px;
}

.logic-list li .badge {
  vertical-align: middle;
  margin-right: 6px;
}

.logic-card-wide {
  grid-column: 1 / -1;
}

.logic-simple-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== PIPELINE TAB ===== */
.pipeline-phase {
  margin-bottom: 28px;
}

.pipeline-phase-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.pipeline-phase-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.pipeline-phase-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(192, 202, 245, 0.08);
  color: var(--text-dim);
}

.pipeline-block {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  transition: border-color .15s, background .15s;
}

.pipeline-block:hover {
  border-color: var(--bg-4);
}

.pipeline-block-highlight {
  border-left: 3px solid var(--accent);
}

.pipeline-block-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-4);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pipeline-block-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.pipeline-block-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.pipeline-block-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
}

.pipeline-block-desc code {
  font-size: 12px;
  background: var(--bg-1);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text);
}

.pipeline-io {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.pipeline-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
}

.pipeline-pill-in {
  background: rgba(122, 162, 247, 0.1);
  color: var(--blue);
  border: 1px solid rgba(122, 162, 247, 0.25);
}

.pipeline-pill-out {
  background: rgba(158, 206, 106, 0.1);
  color: var(--green);
  border: 1px solid rgba(158, 206, 106, 0.25);
}

.pipeline-src {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.pipeline-src code {
  background: transparent;
  font-family: var(--font-mono, monospace);
}

.pipeline-phase-disabled .pipeline-block,
.pipeline-block-disabled {
  opacity: 0.45;
  background: var(--bg-1);
}

.pipeline-phase-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(247, 118, 142, 0.15);
  color: #f7768e;
  border: 1px solid rgba(247, 118, 142, 0.35);
  margin-left: auto;
}

.pipeline-disabled-note {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
  background: rgba(247, 118, 142, 0.06);
  border: 1px dashed rgba(247, 118, 142, 0.3);
  border-radius: var(--radius-md, 6px);
  padding: 10px 14px;
  margin-bottom: 10px;
}

.pipeline-disabled-note code {
  font-size: 12px;
  background: var(--bg-1);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text);
}

.pipeline-block-active-now {
  border-left: 3px solid var(--green);
}

.pipeline-active-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(158, 206, 106, 0.15);
  color: var(--green);
  margin-left: 8px;
  vertical-align: middle;
}

.flow-container {
  overflow-x: auto;
  padding: 4px 0;
}

.flow-diagram {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== DEPENDENCY CHAIN ===== */
.chain-toggle {
  cursor: pointer;
  color: var(--blue);
  user-select: none;
}

.chain-toggle:hover {
  color: var(--accent);
}

.chain-detail {
  margin-top: 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11px;
}

.chain-node {
  padding: 2px 7px;
  background: var(--bg-4);
  border-radius: 4px;
  color: var(--text-dim);
  font-family: 'Consolas', 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.chain-node-current {
  background: var(--blue-bg);
  color: var(--blue);
  font-weight: 600;
}

.chain-arrow {
  color: var(--text-dim);
  font-size: 10px;
}

/* ===== UTILITIES ===== */
.hidden {
  display: none !important;
}

/* ===== RESPONSIVE ===== */
/* ── Logic Tabs ── */
.logic-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}

.logic-tab {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}

.logic-tab:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.logic-tab.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.logic-tab-content {
  display: none;
}

.logic-tab-content.active {
  display: block;
}

.logic-intro {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 720px;
}

@media (max-width: 768px) {
  .header-inner {
    padding: 0 16px;
    gap: 16px;
  }

  .header-logo span {
    display: none;
  }

  .main {
    padding: 20px 16px 48px;
    gap: 36px;
  }

  .upload-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .export-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .upload-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}
