.panel + .panel { margin-top: 20px; }
.panel-hint { font-size: 12px; color: var(--text-dim); margin: -6px 0 14px; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 30px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: rgba(79,140,255,0.06);
}
.dropzone-icon { font-size: 26px; }
.dropzone-text { margin-top: 6px; font-size: 14px; }
.dropzone-sub { margin-top: 4px; font-size: 12px; color: var(--text-dim); }

.upload-queue { list-style: none; margin: 14px 0 0; padding: 0; }
.upload-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.upload-item:last-child { border-bottom: none; }
.upload-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  width: 100%;
}
.upload-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-state { font-size: 12px; color: var(--text-dim); min-width: 90px; text-align: right; }
.upload-state.ok { color: #4ade80; }
.upload-state.error { color: #ff6b6b; }

.upload-progress-bar {
  width: 100%;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.1s ease, background-color 0.2s ease;
}
.upload-progress-fill.ok {
  background-color: #4ade80;
}
.upload-progress-fill.error {
  background-color: #ff6b6b;
}

.admin-body { padding-bottom: 24px; }

.admin-app { max-width: 800px; margin: 0 auto; padding: 24px 16px; }

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.admin-topbar h1 { font-size: 20px; margin: 0; }
.back-link { color: var(--accent); text-decoration: none; font-size: 14px; }
.back-link:hover { text-decoration: underline; }

.panel {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.panel h2 { margin: 0 0 16px; font-size: 16px; }

.ext-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-dim);
}
.ext-row input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: monospace;
  font-size: 13px;
}

.folder-list-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.folder-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.folder-table thead th {
  position: sticky; top: 0;
  background: var(--bg-alt);
  text-align: left;
  padding: 8px 10px;
  color: var(--text-dim);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.folder-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  word-break: break-all;
}
.folder-table tbody tr { cursor: pointer; }
.folder-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.folder-table tbody tr.selected { background: rgba(79,140,255,0.16); }

.empty-state { color: var(--text-dim); text-align: center; padding: 24px; margin: 0; }

.folder-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.btn {
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { color: #ff6b6b; border-color: #ff6b6b44; }
.btn-accent { color: #ffd166; border-color: #ffd16644; }
.btn-ghost { background: transparent; }

.scan-status { margin-top: 12px; font-size: 13px; color: var(--text-dim); min-height: 18px; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-overlay[hidden] { display: none; }

.modal-box {
  width: 440px; max-width: 92vw;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 600;
}
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 16px; cursor: pointer; }

.modal-body { padding: 14px 16px; }
.modal-subtitle { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.breadcrumb {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
  word-break: break-all;
}

.browse-list-wrap {
  border: 1px solid var(--border);
  border-radius: 6px;
  height: 240px;
  overflow-y: auto;
  background: var(--bg);
}
.browse-list { list-style: none; margin: 0; padding: 4px; }
.browse-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.browse-item:hover { background: rgba(255,255,255,0.06); }
.browse-item.selected { background: rgba(79,140,255,0.22); }
.up-item { color: var(--text-dim); border-bottom: 1px solid var(--border); border-radius: 0; }

.recursive-check {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; font-size: 13px; color: var(--text-dim);
}

.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
