/* Multitrad Web · componentes: pasos, lista de trabajos, detalle, diálogos y configuración. */

/* ---------- pasos de la nueva traducción ---------- */
.step-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.step-head h2 { margin: 2px 0 3px; }
.step-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.step-num {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border-strong);
}
.drop {
  display: flex; flex-direction: column; gap: 6px;
  border: 2px dashed var(--border-strong); background: var(--surface-2);
  border-radius: 14px; padding: 26px 16px; text-align: center; cursor: pointer; margin: 0 0 12px;
}
.drop:hover, .drop.dragover { border-color: var(--accent-2); background: var(--accent-soft); }
.drop span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.drop.compact { padding: 16px 12px; }
#uploadText { margin-top: 8px; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid label, .field { font-size: 12px; font-weight: 700; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 16px; margin: 14px 0 0; font-size: 13px; }
.checks label { display: flex; align-items: center; gap: 7px; }
.voice-tools, .main-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.voice-tools { margin: 16px 0 10px; }
.voice-tools .muted { flex: 1; min-width: 200px; }
#voicePreviewAudio { width: 100%; height: 38px; margin: 0 0 10px; }
.feature-note {
  font-size: 12px; line-height: 1.45; color: var(--text-2);
  background: var(--surface-2); border-left: 4px solid var(--accent-2);
  border-radius: 8px; padding: 10px 12px; margin: 10px 0 0;
}
.manual-speaker-setup { margin: 4px 0 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.manual-speaker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.manual-speaker-head label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.manual-speaker-head select { width: auto; min-width: 70px; }
.speaker-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.speaker-row { border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 10px; min-width: 0; }
.speaker-row label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; font-weight: 700; }
.speaker-listen { margin-top: 9px; padding: 8px 10px; }
.speaker-preview-status { display: block; margin-top: 7px; line-height: 1.35; }
.action-bar {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin: 0 -4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow);
}
.action-bar .error { flex: 1; min-width: 180px; margin: 0; }
.main-actions { justify-content: flex-end; margin-left: auto; }

/* ---------- lista de trabajos (barra lateral) ---------- */
.job-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.job-entry { position: relative; display: flex; align-items: stretch; border-radius: 10px; }
.job-entry:hover, .job-entry:focus-within { background: var(--sidebar-hover); }
.job-entry.selected { background: var(--selected); }
.job-item {
  flex: 1; min-width: 0; display: flex; gap: 10px; align-items: flex-start;
  border: 0; background: transparent; color: inherit; text-align: left;
  padding: 9px 4px 9px 10px; cursor: pointer; border-radius: 10px;
}
.job-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--muted); }
.job-entry[data-tone="active"] .job-dot { background: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.job-entry[data-tone="done"] .job-dot { background: var(--ok); }
.job-entry[data-tone="failed"] .job-dot { background: var(--danger); }
.job-entry[data-tone="cancelled"] .job-dot { background: var(--muted); }
.job-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.job-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-sub { display: flex; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.job-sub > span { overflow: hidden; text-overflow: ellipsis; }
.job-sub > span + span::before { content: "·"; margin-right: 6px; }
.job-lang { font-weight: 700; color: var(--text-2); flex: none; }
.job-date { flex: none; margin-left: auto; }
.progress.mini { height: 4px; margin-top: 3px; }
.job-more { width: 32px; height: auto; align-self: center; margin-right: 2px; opacity: .55; font-size: 16px; }
.job-entry:hover .job-more, .job-entry.selected .job-more, .job-more:focus-visible, .job-more[aria-expanded="true"] { opacity: 1; }
.empty-list { margin: 10px; font-size: 13px; color: var(--muted); }
.archived-section { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 6px; }
.archived-section summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px;
  padding: 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  border-radius: 8px;
}
.archived-section summary::-webkit-details-marker { display: none; }
.archived-section summary::before { content: "▸"; transition: transform .15s ease; }
.archived-section[open] summary::before { transform: rotate(90deg); }
.archived-section summary:hover { background: var(--sidebar-hover); }
.count { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; font-size: 11px; }

.popover {
  position: fixed; z-index: 40; min-width: 190px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18); padding: 6px; display: flex; flex-direction: column;
}
.popover button {
  border: 0; background: transparent; color: var(--text); text-align: left;
  padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.popover button:hover, .popover button:focus-visible { background: var(--accent-soft); outline: none; }
.popover button.danger { color: var(--danger); }
.popover button.danger:hover { background: var(--danger-soft); }
.popover button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- detalle del trabajo ---------- */
.job-detail { display: flex; flex-direction: column; gap: 12px; }
.job-detail-head { display: flex; align-items: flex-start; gap: 12px; }
.job-detail-title { flex: 1; min-width: 0; }
.job-detail-title h2 { font-size: 20px; margin: 8px 0 4px; overflow-wrap: anywhere; }
.job-detail-title p { margin: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 3px 10px; background: var(--accent-soft); color: var(--accent);
}
.pill[data-tone="done"] { color: var(--ok); }
.pill[data-tone="failed"] { background: var(--danger-soft); color: var(--danger); }
.pill[data-tone="cancelled"] { color: var(--muted); background: var(--surface-2); }
.job-progress-row { display: flex; align-items: center; gap: 12px; }
.job-progress-row .progress { flex: 1; }
.job-percent { font-weight: 800; color: var(--accent); min-width: 44px; text-align: right; }
.job-message { font-size: 13px; color: var(--text-2); margin: 0; overflow-wrap: anywhere; }
.job-message.is-error { color: var(--danger); }
.job-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.result-card h3 { margin-bottom: 2px; }
.result-card video { display: block; width: 100%; max-height: 62vh; background: #071522; border-radius: 12px; margin-top: 12px; }
.option-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 13px; }
.option-list dt { color: var(--muted); }
.option-list dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- avisos ---------- */
.update-banner {
  margin: 12px 28px 0; background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text);
  border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.update-banner span { font-size: 13px; font-weight: 700; }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60;
  max-width: min(520px, calc(100vw - 32px));
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px;
  font-size: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}
.toast.is-error { background: var(--danger); color: var(--surface); }

/* ---------- diálogos ---------- */
.modal { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal-card {
  width: min(920px, 100%); max-height: 88vh; max-height: 88dvh; overflow: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 18px; padding: 22px; box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
}
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-head p { color: var(--muted); font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.confirm-card { width: min(440px, 100%); }
.confirm-card p { overflow-wrap: anywhere; }
.block-editor { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.block-row { display: grid; grid-template-columns: 110px 90px minmax(0, 1fr) 220px; gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.block-time, .block-speaker { font-size: 12px; color: var(--muted); }
.block-text { font-size: 13px; line-height: 1.35; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.block-text small { color: var(--muted); }
.block-row select { padding: 8px; }

/* ---------- configuración ---------- */
.settings-card { width: min(720px, 100%); }
.settings-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 6px 0 16px; overflow-x: auto; }
.tab {
  border: 0; background: transparent; color: var(--muted); font-weight: 700; padding: 10px 12px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.settings-panel h3 { margin: 18px 0 8px; }
.settings-panel h3:first-child { margin-top: 0; }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 12px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.segmented label { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; cursor: pointer; font-size: 14px; }
.segmented label:has(input:checked) { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.field { max-width: 360px; }
.voice-list { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.voice-list li {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
}
.voice-list .voice-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.voice-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-list .muted { font-size: 12px; overflow-wrap: anywhere; }
.voice-list .remove { color: var(--danger); background: var(--danger-soft); }
.consent { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; margin-top: 12px; }

@media (max-width: 900px) {
  .block-row { grid-template-columns: 1fr; }
  .block-row select { width: 100%; }
}
@media (max-width: 767px) {
  .form-grid, .speaker-editor { grid-template-columns: 1fr; }
  .step-head { gap: 10px; }
  .checks { flex-direction: column; gap: 10px; }
  .action-bar { margin: 0; padding: 10px 12px; }
  .main-actions { width: 100%; }
  .main-actions button { flex: 1; }
  .update-banner { margin: 10px 16px 0; }
  .modal { padding: 10px; }
  .modal-card { padding: 16px; }
  .option-list { grid-template-columns: 1fr; gap: 2px; }
  .option-list dd { margin-bottom: 8px; }
}

/* Revisión humana (Core 2.0) */
.review-card .review-blockers details, .review-card .review-sections details { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin-top: 10px; }
.review-card .review-blocker { border-color: var(--danger) !important; background: var(--danger-soft); }
.review-card summary { cursor: pointer; font-weight: 600; }
.review-card ul { list-style: none; padding: 0; margin: 8px 0 0; }
.review-card li { border-top: 1px solid var(--border); padding: 8px 0; }
.review-card li p { margin: 4px 0; overflow-wrap: anywhere; }
.review-text { font-size: 0.92em; }
.review-item-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.review-clip { display: block; width: 100%; max-height: 40vh; background: #071522; border-radius: 12px; margin-top: 12px; }
.review-check { display: block; margin-top: 8px; font-weight: 600; }
.review-form { display: grid; gap: 10px; margin-top: 14px; }
.review-form label { display: grid; gap: 4px; }
.review-form .review-confirm { display: flex; gap: 8px; align-items: center; }
.review-history { margin-top: 10px; }

/* Historial de errores */
.history-filters, .history-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.history-list { list-style: none; padding: 0; margin: 12px 0 0; }
.history-item { border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.history-item.sev-alta, .history-item.sev-critica { border-left-color: var(--danger); }
.history-item.sev-media { border-left-color: var(--warn); }
.history-item p { margin: 4px 0; overflow-wrap: anywhere; }
.history-item pre { white-space: pre-wrap; font-size: 0.85em; max-height: 240px; overflow: auto; }
.history-head { font-size: 0.9em; font-weight: 600; }
.history-item-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.history-report form { display: grid; gap: 8px; margin-top: 8px; }
.history-report label { display: grid; gap: 4px; }

