.batch-upload-modal {
  position: fixed;
  z-index: 96;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(2, 5, 9, .82);
  backdrop-filter: blur(10px);
}

.batch-upload-modal.open { display: flex; }

.batch-upload-shell {
  width: min(1180px, calc(100vw - 44px));
  height: min(820px, calc(100vh - 44px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line2);
  border-radius: 18px;
  background: #101216;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .55);
}

.batch-upload-head {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
}

.batch-upload-title { min-width: 0; }
.batch-upload-title h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.batch-upload-title p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.batch-upload-head .batch-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
}
.batch-upload-head .batch-close:hover { background: var(--card2); color: var(--text); }

.batch-upload-body { min-height: 0; flex: 1; overflow: auto; padding: 22px 26px; }
.batch-intro { height: 100%; min-height: 430px; display: grid; place-items: center; }
.batch-dropzone {
  width: min(720px, 100%);
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 42px;
  border: 1px dashed rgba(10, 132, 255, .5);
  border-radius: 20px;
  background: radial-gradient(circle at 50% 0, rgba(10, 132, 255, .12), transparent 55%), #0d1015;
  text-align: center;
  cursor: pointer;
  transition: .18s ease;
}
.batch-dropzone:hover, .batch-dropzone.drag { border-color: var(--blue); transform: translateY(-2px); }
.batch-dropzone .batch-drop-icon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 22px;
  background: linear-gradient(145deg, #168cfb, #0068d6);
  color: white;
  font-size: 30px;
  box-shadow: 0 12px 30px rgba(10, 132, 255, .28);
}
.batch-dropzone h3 { margin: 0; font-size: 22px; }
.batch-dropzone p { max-width: 520px; margin: 12px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.batch-drop-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.batch-drop-meta span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted2); font: 10px "JetBrains Mono"; }

.batch-workbench { display: grid; gap: 16px; }
.batch-overview {
  display: grid;
  grid-template-columns: minmax(210px, 1.2fr) repeat(4, minmax(90px, .45fr));
  gap: 10px;
}
.batch-progress-card, .batch-stat {
  min-height: 86px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
}
.batch-progress-card b, .batch-stat span { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.batch-progress-copy { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; }
.batch-progress-copy strong { font-size: 20px; }
.batch-progress-copy span { color: var(--muted2); font: 11px "JetBrains Mono"; }
.batch-progress-track { height: 5px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: var(--card2); }
.batch-progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #64d2ff); transition: width .25s ease; }
.batch-stat strong { display: block; margin-top: 10px; font: 600 23px "JetBrains Mono"; }
.batch-stat.ready strong { color: var(--green); }
.batch-stat.review strong { color: var(--orange); }
.batch-stat.failed strong { color: var(--red); }

.batch-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.batch-toolbar .batch-toolbar-note { margin-left: auto; color: var(--muted); font-size: 11px; }
.batch-toolbar .btn[hidden] { display: none; }

.batch-list { display: grid; gap: 10px; }
.batch-empty { padding: 60px 20px; border: 1px dashed var(--line2); border-radius: 14px; color: var(--muted); text-align: center; }
.batch-item {
  display: grid;
  grid-template-columns: auto 42px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: start;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.batch-item.is-ready { border-color: rgba(48, 209, 88, .23); }
.batch-item.is-duplicate { border-color: rgba(255, 159, 10, .32); }
.batch-item.is-failed { border-color: rgba(255, 69, 58, .32); }
.batch-select { width: 18px; height: 18px; margin-top: 11px; accent-color: var(--blue); }
.batch-file-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: rgba(10, 132, 255, .1); color: var(--blue); font: 10px "JetBrains Mono"; }
.batch-item-main { min-width: 0; }
.batch-item-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.batch-item-title b { overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.batch-item-title small { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.batch-candidate-line { margin-top: 7px; color: var(--muted2); font-size: 12px; line-height: 1.55; }
.batch-candidate-line strong { color: var(--text); font-size: 14px; }
.batch-summary { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.batch-error { margin-top: 7px; color: #ff7770; font-size: 11px; line-height: 1.55; }
.batch-duplicate-note { margin-top: 9px; padding: 8px 10px; border-radius: 8px; background: rgba(255, 159, 10, .08); color: #e6a54a; font-size: 11px; }
.batch-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 9px; }
.batch-tags span { padding: 4px 7px; border-radius: 99px; background: var(--card2); color: var(--muted2); font-size: 9px; }
.batch-status { min-width: 72px; padding: 6px 9px; border-radius: 99px; background: var(--card2); color: var(--muted2); text-align: center; font-size: 10px; white-space: nowrap; }
.batch-status.uploading, .batch-status.parsing { color: #69b5ff; background: rgba(10, 132, 255, .1); }
.batch-status.ready, .batch-status.imported { color: var(--green); background: rgba(48, 209, 88, .09); }
.batch-status.duplicate { color: var(--orange); background: rgba(255, 159, 10, .09); }
.batch-status.failed { color: var(--red); background: rgba(255, 69, 58, .09); }
.batch-item-actions { grid-column: 3 / -1; display: flex; justify-content: flex-end; gap: 7px; }
.batch-item-actions button { border: 0; background: transparent; color: var(--muted2); font-size: 11px; cursor: pointer; }
.batch-item-actions button:hover { color: var(--text); }
.batch-item-actions button.danger:hover { color: var(--red); }
.batch-edit-grid { grid-column: 3 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding-top: 13px; border-top: 1px solid var(--line); }
.batch-edit-grid .wide { grid-column: span 2; }
.batch-edit-grid .full { grid-column: 1 / -1; }
.batch-edit-grid label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; }
.batch-edit-grid input, .batch-edit-grid textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.batch-edit-grid textarea { min-height: 78px; padding-top: 10px; resize: vertical; }

.batch-upload-foot {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-top: 1px solid var(--line);
  background: rgba(16, 18, 22, .97);
}
.batch-foot-copy { color: var(--muted); font-size: 11px; }
.batch-foot-copy b { color: var(--text); }
.batch-upload-foot .batch-reset { margin-left: auto; }

html[data-theme="light"] .batch-upload-shell,
html[data-theme="light"] .batch-upload-foot { background: #fff; }
html[data-theme="light"] .batch-dropzone { background: radial-gradient(circle at 50% 0, rgba(10,132,255,.09), transparent 55%), #f8fafc; }

@media (max-width: 820px) {
  .batch-upload-modal { padding: 8px; }
  .batch-upload-shell { width: calc(100vw - 16px); height: calc(100vh - 16px); border-radius: 14px; }
  .batch-upload-head, .batch-upload-foot { padding-left: 16px; padding-right: 16px; }
  .batch-upload-body { padding: 16px; }
  .batch-overview { grid-template-columns: 1fr 1fr; }
  .batch-progress-card { grid-column: 1 / -1; }
  .batch-item { grid-template-columns: auto 36px minmax(0, 1fr); }
  .batch-status { grid-column: 3; justify-self: start; }
  .batch-item-actions, .batch-edit-grid { grid-column: 1 / -1; }
  .batch-edit-grid { grid-template-columns: 1fr 1fr; }
  .batch-edit-grid .wide, .batch-edit-grid .full { grid-column: 1 / -1; }
  .batch-toolbar .batch-toolbar-note { width: 100%; margin-left: 0; }
  .batch-foot-copy { display: none; }
  .batch-upload-foot .batch-reset { margin-left: 0; }
}

@media (max-width: 520px) {
  .batch-upload-title p { display: none; }
  .batch-upload-title h2 { font-size: 18px; }
  .batch-overview { grid-template-columns: 1fr 1fr; }
  .batch-stat { min-height: 72px; padding: 12px; }
  .batch-dropzone { min-height: 320px; padding: 24px; }
  .batch-item { grid-template-columns: auto minmax(0, 1fr); }
  .batch-file-icon { display: none; }
  .batch-item-main { grid-column: 2; }
  .batch-status { grid-column: 2; }
  .batch-edit-grid { grid-template-columns: 1fr; }
  .batch-upload-foot { flex-wrap: wrap; }
  .batch-upload-foot .btn { flex: 1; }
}
