/* ============================================================
   batch.css — styles for /bulk_classify and /batch pages
   ============================================================ */

/* ── Table area (scrollable both axes) ────────────────── */
.ab-main {
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 60vh;
}
.ab-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
}

/* ── Detail panel — fixed overlay from the right ─────── */
.ab-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 440px; min-width: 260px; max-width: 760px;
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  background: var(--surface);
  box-shadow: -6px 0 24px rgba(0,0,0,.12);
  z-index: 300;
  transform: translateX(100%);
  transition: transform .22s ease;
}
.ab-panel.ab-panel-open {
  transform: translateX(0);
}
.ab-resize-handle {
  position: absolute; left: -4px; top: 0; bottom: 0; width: 8px;
  cursor: col-resize; z-index: 10;
  background: transparent; transition: background .15s;
}
.ab-resize-handle:hover, .ab-resize-handle.dragging {
  background: var(--accent); opacity: .4;
}
.ab-panel-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em; flex-shrink: 0;
}
.ab-panel-body { flex: 1; overflow-y: auto; padding: 16px; }
.ab-panel-empty { color: var(--text-muted); font-size: 13px; font-style: italic; }

/* ── Results table ────────────────────────────────────── */
.ab-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.ab-table th {
  font-size: 11px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left;
  overflow: hidden;
}
/* Input columns (description, site, etc.) are resizable by the user */
.ab-table th[data-col-name] {
  resize: horizontal;
  min-width: 80px;
  width: 180px;
  cursor: col-resize;
}
.ab-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ab-table tbody tr { cursor: pointer; transition: background .1s; }
.ab-table tbody tr:hover  { background: var(--surface-hover); }
.ab-table tbody tr.ab-selected { background: var(--accent-light); outline: 2px solid var(--accent); outline-offset: -2px; }
.ab-table tbody tr.ab-error td { color: var(--conf-low); }
.ab-table tbody tr.ab-row-low  { background: color-mix(in srgb, var(--conf-low) 6%, transparent); }
.ab-table tbody tr.ab-row-low:hover { background: color-mix(in srgb, var(--conf-low) 10%, transparent); }
.ab-table tbody tr.ab-row-low.ab-selected { background: color-mix(in srgb, var(--conf-low) 12%, var(--accent-light)); }

/* ── Method tag chips ─────────────────────────────────── */
.ab-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 99px;
  font-size: 10px; font-weight: 700; letter-spacing: .03em; white-space: nowrap;
}
.ab-tag-match { background: color-mix(in srgb, #16a34a 15%, transparent); color: #16a34a; }
.ab-tag-rules { background: var(--accent-light); color: var(--accent); }
.ab-tag-error { background: color-mix(in srgb, var(--conf-low) 12%, transparent); color: var(--conf-low); }

/* ── Code chip ────────────────────────────────────────── */
.ab-code { font-family: monospace; font-size: 12px; font-weight: 600; background: var(--surface-hover); padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.ab-code-empty { color: var(--text-muted); font-style: italic; }

/* ── Detail panel sections ────────────────────────────── */
.ab-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); margin: 14px 0 6px;
}
.ab-section-title:first-child { margin-top: 0; }
.ab-kv { display: flex; flex-direction: column; gap: 5px; }
.ab-kv-row { display: flex; justify-content: space-between; font-size: 12px; }
.ab-kv-key { color: var(--text-muted); }
.ab-kv-val { font-family: monospace; font-weight: 600; font-size: 11px; }

/* ── History in panel ─────────────────────────────────── */
.ab-hist-step { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.ab-hist-step:last-child { border-bottom: none; }
.ab-hist-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.ab-hist-body { flex: 1; min-width: 0; }
.ab-hist-label { font-size: 12px; font-weight: 500; }
.ab-hist-pills { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.ab-hist-reasoning summary { font-size: 11px; color: var(--text-muted); cursor: pointer; margin-top: 2px; }

/* ── Retrieved doc rows ───────────────────────────────── */
.ab-ret-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 8px; border-radius: 5px;
  border: 1px solid var(--border); margin-bottom: 5px; font-size: 11px;
}
.ab-ret-desc  { font-size: 12px; color: var(--text); }
.ab-ret-code  { font-family: monospace; font-weight: 600; color: var(--accent); }
.ab-ret-score { color: var(--text-muted); }

/* ── Progress bar ─────────────────────────────────────── */
.ab-progress-bar  { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.ab-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }
