@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* Fondo de la app. Blanco desde 2026-08-05: el detalle del registro ya lo usaba
     (`body{background:#fff}` en sus plantillas) y se decidió llevar ese tratamiento al
     resto — hoja blanca, y cada recuadro separado por sombra, no por contraste de fondo. */
  --page:         #ffffff;
  /* Relleno HUNDIDO (inputs, selects, cabeceras de tabla): sigue siendo el beige, que
     ahora es lo que marca "acá se escribe" sobre la hoja blanca. */
  --bg:           #ede9e2;
  --surface:      #faf8f5;
  --surface-2:    #f4f1eb;
  --surface-3:    #eee9e0;
  --border:       #d8d2c8;
  --border-hi:    #c5bdb2;
  --sidebar-bg:   #e5e0d8;
  --accent:       #e0702e;
  --accent-dim:   rgba(224,112,46,0.10);
  --text:         #1c1a16;
  --text-dim:     #5e5a54;
  --text-muted:   #9e9a92;
  --success:      #15803d;
  --danger:       #dc2626;
  --warning:      #b45309;
  --info:         #4338ca;
  /* Receta de recuadro sobre la hoja blanca: sobre blanco el relleno ya no separa nada,
     así que un recuadro se define por la sombra y un borde de un pelo. Es exactamente lo
     que hace el detalle del registro (.det2-side), llevado al resto de la app. */
  --card-border:  #f0ece5;
  --card-shadow:  0 3px 16px rgba(28,26,22,.045);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--page);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* ── TOPBAR ── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: #ffffff;
  height: 48px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  /* Sobre una página blanca la topbar ya no se despega sola: la separa la sombra, no el
     contraste de fondo. */
  box-shadow: 0 1px 0 rgba(28,26,22,.07), 0 3px 14px rgba(28,26,22,.045);
}
.topbar-hamburger { display: none; flex-direction: column; gap: 4px; padding: 4px; cursor: pointer; }
.topbar-hamburger span { display: block; width: 18px; height: 1.5px; background: var(--text-dim); border-radius: 2px; }
.topbar-logo { display: flex; align-items: center; gap: 8px; flex: 1; text-decoration: none; }
.logo-icon {
  width: 28px; height: 28px; background: var(--accent); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.logo-icon svg {
  width: 16px; height: 16px; fill: white;
  transform-origin: 24% 80%;          /* pivote en el extremo del mango — la "mano" */
  will-change: transform;
}
@keyframes logo-tap {
  0%, 100% { transform: rotate(0deg); }
  30%      { transform: rotate(-18deg); }
  55%      { transform: rotate(6deg); }
  72%      { transform: rotate(-2deg); }
  85%      { transform: rotate(1deg); }
}
.topbar-logo:hover .logo-icon svg { animation: logo-tap .9s cubic-bezier(.5,.05,.3,1); }
@media (prefers-reduced-motion: reduce) {
  .topbar-logo:hover .logo-icon svg { animation: none; }
}
.logo-text { font-size: 15px; font-weight: 700; color: var(--text); }
.logo-text span { color: var(--accent); }
.logo-subtitle { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.tb-icon {
  width: 32px; height: 32px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 14px; cursor: pointer;
}
.tb-icon:hover { border-color: var(--accent); color: var(--accent); }
.tb-icon img { width: 19px; height: 19px; object-fit: contain; display: block; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 24px;
  cursor: pointer;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.user-name { font-size: 11px; font-weight: 700; color: var(--accent); line-height: 1.2; }
.user-role { font-size: 10px; color: var(--text-muted); line-height: 1.2; }

/* ── BREADCRUMB ── */
.breadcrumb {
  padding: 10px 24px;
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.breadcrumb a { color: var(--accent); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--border-hi); }

/* ── MAIN CONTENT ── */
.main-content { padding: 32px 24px; max-width: 1200px; margin: 0 auto; }
/* Paginas que aprovechan el ancho disponible (el Panel de seguimiento y su ficha). El
   `width` NO es decorativo: sin el, `main-content` —flex-item del body con `margin:auto`—
   se dimensiona al contenido. Medido en el panel: 734px de 1500 disponibles. */
.main-ancha { width: 100%; max-width: 1560px; }

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--card-border);
  padding: 14px 24px;
  background: #ffffff;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: auto;
}
.site-footer strong { color: var(--text-dim); }

/* ── BOTONES ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; font-family: inherit; transition: all .15s;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #c96028; }
.btn-primary:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent-dim); }
.btn-ghost { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border-hi); }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 7px; }

/* ── CARDS ── */
.card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  padding: 20px;
}

/* ── NAV CARDS (home) ── */
.nav-cards-grid {
  display: flex; gap: 24px; justify-content: center; align-items: center;
  min-height: 320px;
}
.nav-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 16px; width: 180px; height: 190px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  cursor: pointer; transition: all .2s; text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  position: relative;
}
.nav-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); transform: translateY(-2px); }
.nav-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim), 0 4px 12px rgba(224,112,46,.15); }
.nav-card.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.nav-card-icon {
  width: 64px; height: 64px; background: var(--accent-dim);
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
}
.nav-card.active .nav-card-icon { background: var(--accent); }
.nav-card-icon svg { width: 36px; height: 36px; }
.nav-card-label { font-size: 13px; color: var(--text-dim); text-align: center; font-weight: 500; line-height: 1.4; }
.nav-card-label strong { color: var(--text); }
.nav-card.active .nav-card-label { color: var(--accent); }
.soon-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 6px; font-size: 9px; padding: 2px 6px;
  color: var(--text-muted); font-weight: 600; text-transform: uppercase;
}

/* ── WIZARD ── */
.wizard-wrap { max-width: 680px; margin: 0 auto; }
.wizard-header { text-align: center; margin-bottom: 32px; }
.wizard-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.wizard-sub { font-size: 14px; color: var(--text-dim); }
.wizard-sub strong { color: var(--text); }
.stepper { display: flex; align-items: center; justify-content: center; margin-bottom: 32px; }
.step-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.step-circle {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  border: 2px solid var(--border); background: var(--surface); color: var(--text-muted);
}
.step-circle.done { background: var(--success); border-color: var(--success); color: white; }
.step-circle.active { background: var(--accent); border-color: var(--accent); color: white; }
.step-name { font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.step-name.done { color: var(--success); }
.step-name.active { color: var(--accent); }
.step-line { width: 90px; height: 2px; background: var(--border); margin-bottom: 24px; }
.step-line.done { background: var(--success); }
.wizard-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; }

/* ── DROPZONE ── */
.dropzone {
  border: 2px dashed var(--border-hi); border-radius: 12px;
  padding: 40px 24px; text-align: center;
  background: var(--surface); cursor: pointer; transition: all .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-dim); }
.dropzone-icon { font-size: 36px; margin-bottom: 12px; opacity: .45; }
.dropzone-title { font-size: 14px; font-weight: 600; color: var(--text-dim); margin-bottom: 4px; }
.dropzone-sub { font-size: 12px; color: var(--text-muted); }
.dropzone-sub a { color: var(--accent); text-decoration: none; font-weight: 600; }
.format-chips { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.format-chip {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 10px;
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  font-family: 'DM Mono', monospace;
}
.file-selected { display: flex; align-items: center; gap: 10px; justify-content: center; }
.file-name { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 500; color: var(--text); }

/* ── ALERTS & BANNERS ── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.alert-info { background: var(--accent-dim); border-left: 3px solid var(--accent); color: var(--text-dim); }
.alert-success { background: #dcfce7; border-left: 3px solid var(--success); color: #166534; }
.alert-danger { background: #fee2e2; border-left: 3px solid var(--danger); color: #991b1b; }
.alert-error { background: #fee2e2; border-left: 3px solid var(--danger); color: #991b1b; }
.alert-warning { background: #fffbeb; border-left: 3px solid var(--warning); color: #92400e; }
.sim-banner {
  background: #fffbeb; border-bottom: 1px solid #fde68a;
  padding: 10px 24px; font-size: 12px; color: #92400e;
  display: flex; align-items: center; gap: 8px;
}
.sim-banner strong { font-weight: 700; }

/* ── FORM ── */
.form-row { display: flex; gap: 16px; margin-bottom: 16px; }
.form-group { flex: 1; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; display: block; }
.form-label .req { color: var(--accent); }
.form-control {
  width: 100%; padding: 9px 12px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 13px;
  font-family: inherit; color: var(--text); outline: none;
  transition: border-color .15s;
}
.form-control:focus { border-color: var(--accent); }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239e9a92' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.note-inline {
  font-size: 11px; color: var(--text-muted);
  padding: 8px 12px; background: var(--surface-3);
  border-radius: 6px; border: 1px solid var(--border);
}

/* ── TABLA DE RESULTADOS ── */
.results-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 16px;
  /* Barra, no tarjeta: sobre blanco la separa la línea inferior, sin relleno propio. */
  background: #ffffff; border-bottom: 1px solid var(--card-border);
}
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 8px;
  padding: 6px 12px; min-width: 180px;
}
.search-box input {
  border: none; background: transparent; font-size: 13px;
  font-family: inherit; color: var(--text); outline: none; width: 100%;
}
.search-box input::placeholder { color: var(--text-muted); }
.toolbar-sep { width: 1px; height: 24px; background: var(--border); }
.toolbar-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.filter-select {
  padding: 6px 28px 6px 10px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 12px; font-family: inherit; color: var(--text-dim);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' fill='none'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%239e9a92' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 8px center;
  appearance: none; outline: none;
}
.filter-select:focus { border-color: var(--accent); }
.spacer { flex: 1; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: var(--surface-2); }
th {
  padding: 10px 14px; text-align: left;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-dim); vertical-align: middle; }
tr:hover td { background: var(--surface-3); }
tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.row-num { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.name-cell { display: flex; align-items: center; gap: 10px; }
.name-letter {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white; flex-shrink: 0;
}
.name-text { font-weight: 600; color: var(--text); }
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-procede { background: #fee2e2; color: #dc2626; }
.badge-no-procede { background: #dcfce7; color: #15803d; }
.badge-auditoria { background: #fef9c3; color: #b45309; }
.badge-pendiente { background: var(--surface-3); color: var(--text-muted); }
.badge-potencial-procede { background: #fff1f2; color: #e11d48; }
.badge-potencial-no { background: #ecfdf5; color: #059669; }
.score-val { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 500; }
.toggle {
  width: 36px; height: 20px; background: var(--border); border-radius: 10px;
  position: relative; cursor: pointer; transition: background .2s; border: none;
}
.toggle.on { background: var(--success); }
.toggle::after {
  content: ''; position: absolute;
  width: 16px; height: 16px; background: white; border-radius: 50%;
  top: 2px; left: 2px; transition: left .2s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.toggle.on::after { left: 18px; }
.action-btn {
  width: 28px; height: 28px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); font-size: 13px;
  transition: all .15s; text-decoration: none;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.action-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: #fee2e2; }
.action-btn img { width: 15px; height: 15px; object-fit: contain; display: block; }
.action-btn:disabled { opacity:.45; cursor:not-allowed; pointer-events:none; }
.table-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted); flex-wrap: wrap; gap: 8px;
}
.kpi-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.kpi-chip { padding: 3px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.kpi-chip.procede { background: #fee2e2; color: #dc2626; }
.kpi-chip.no-procede { background: #dcfce7; color: #15803d; }
.kpi-chip.auditoria { background: #fef9c3; color: #b45309; }
.col-tag {
  display: inline-block; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 8px; font-size: 11px;
  font-family: 'DM Mono', monospace; color: var(--text-dim);
}
.col-tag.required { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--text); color: white;
  padding: 12px 20px; border-radius: 8px;
  font-size: 13px; font-weight: 500; z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: slideUp .2s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* ── SCORE AUDIO DOT (sonar ping) ── */
.score-dot {
  position: relative;
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.score-dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1.5px solid;
  opacity: 0;
  animation: dotPing 2.6s ease-out infinite;
}
.score-dot.green  { background: #16a34a; }
.score-dot.green::after  { border-color: #16a34a; }
.score-dot.yellow { background: #d97706; }
.score-dot.yellow::after { border-color: #d97706; }
.score-dot.red    { background: #dc2626; }
.score-dot.red::after    { border-color: #dc2626; }

@keyframes dotPing {
  0%   { transform: scale(1);   opacity: .75; }
  75%  { transform: scale(1.9); opacity: 0;   }
  100% { transform: scale(1.9); opacity: 0;   }
}

/* ── TOPNAV BREADCRUMB INTEGRADO ── */
.topbar-crumb {
  flex: 1;
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
  margin: 0 16px;
}
.topbar-crumb a { color: var(--accent); text-decoration: none; font-weight: 500; }
.topbar-crumb a:hover { text-decoration: underline; }
.topbar-crumb .sep { color: var(--border-hi); }

/* ── VISTA DETALLE — LAYOUT ── */
.detail-page {
  display: flex; gap: 16px; padding: 20px 24px;
  align-items: flex-start; min-height: calc(100vh - 48px);
}
.detail-sidebar { flex: 0 0 210px; display: flex; flex-direction: column; gap: 12px; }
.detail-main    { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ── SIDEBAR CARDS ── */
.client-card {
  background: #fff; border-radius: 14px;
  border: 1px solid var(--border); overflow: hidden;
}
.client-card-top {
  padding: 20px 16px 14px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.avatar-wrap {
  width: 64px; height: 64px; border-radius: 50%;
  overflow: hidden; border: 2px solid var(--border); background: var(--surface-2);
  flex-shrink: 0;
}
.avatar-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #6366f1; background: #e0e7ff;
}
.client-card-name { font-weight: 700; font-size: 14px; line-height: 1.25; color: var(--text); }
.client-card-doc  { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--text-muted); }
.client-card-fields { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.detail-field { display: flex; flex-direction: column; gap: 1px; }
.detail-field-label {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); font-weight: 600;
}
.detail-field-val  { font-size: 12px; font-weight: 500; color: var(--text); }
.detail-field-soon { font-size: 11px; color: var(--border-hi); font-style: italic; }

/* ── RPA RESULT CARD ── */
.rpa-card {
  background: #fff; border-radius: 14px;
  border: 1px solid var(--border); padding: 14px 16px;
}
.rpa-card-label {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); font-weight: 600; margin-bottom: 8px;
}
.rpa-result-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  font-weight: 700; font-size: 13px;
}
.rpa-result-badge.procede    { background: #fef2f2; color: #b91c1c; }
.rpa-result-badge.no-procede { background: #f0fdf4; color: #15803d; }
.rpa-result-badge.auditoria  { background: #fffbeb; color: #b45309; }
.rpa-result-badge.potencial-procede { background: #ecfdf5; color: #0d9488; }
.rpa-result-badge.potencial-no { background: #fff7ed; color: #c2410c; }

/* ── SCORE CARD ── */
.score-card-detail {
  background: #fff; border-radius: 14px;
  border: 1px solid var(--border); padding: 14px 16px;
}
.score-card-label {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); font-weight: 600; margin-bottom: 6px;
}
.score-num-big {
  font-size: 36px; font-weight: 800; font-family: 'DM Mono', monospace; line-height: 1;
}
.score-num-big.procede    { color: #dc2626; }
.score-num-big.no-procede { color: #16a34a; }
.score-track {
  height: 6px; background: var(--surface-3); border-radius: 3px;
  margin-top: 8px; overflow: hidden;
}
.score-track-fill { height: 100%; border-radius: 3px; }
.score-hint { font-size: 10px; color: var(--text-muted); margin-top: 5px; }
.score-pen-row {
  display: flex; justify-content: space-between;
  font-size: 10px; margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--border);
}
.score-pen-item { display: flex; flex-direction: column; gap: 1px; }
.score-pen-key { color: var(--text-muted); }
.score-pen-val { font-weight: 600; color: var(--text); }

/* ── AUDIO STRIP ── */
.audio-strip {
  background: #fff; border-radius: 14px;
  border: 1px solid var(--border); padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
}
.audio-phone-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(224,112,46,.35);
}
.audio-info { flex: 1; min-width: 0; }
.audio-filename {
  font-family: 'DM Mono', monospace; font-size: 11.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text);
}
.audio-filename span { color: var(--text-muted); }
.audio-meta { font-size: 10px; color: var(--text-muted); margin-top: 3px; }
.audio-match-group { display: flex; gap: 5px; flex-shrink: 0; }
.match-pill-hi { background: #dcfce7; color: #15803d; font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }
.match-pill-md { background: #fef9c3; color: #854d0e; font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }
.match-pill-lo { background: #fee2e2; color: #b91c1c; font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }

/* ── PANEL DE ANÁLISIS (filas pill-tag) ── */
.analysis-panel {
  background: #fff; border-radius: 14px;
  border: 1px solid var(--border); overflow: hidden;
}
.arow {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 18px; border-bottom: 1px solid var(--surface);
}
.arow:last-child { border-bottom: none; }
.arow:hover { background: var(--surface); }
.arow.rpa-final { background: var(--text); }
.arow.rpa-final:hover { background: #2d2a24; }

.atag {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 20px; padding: 3px 10px;
  font-size: 10px; font-weight: 700; letter-spacing: .3px;
  white-space: nowrap; flex-shrink: 0; min-width: 90px;
}
.atag-vc      { background: #fff3ed; color: var(--accent); }
.atag-mac     { background: #dcfce7; color: #15803d; }
.atag-precio  { background: #fef9c3; color: #854d0e; }
.atag-alerta  { background: #fee2e2; color: #b91c1c; }
.atag-rechazo { background: #f3f4f6; color: #374151; }
.atag-score   { background: #eff6ff; color: #1d4ed8; }
.atag-tmo     { background: #f5f3ff; color: #6d28d9; }
.atag-asesor  { background: #f0fdf4; color: #166534; }
.atag-reclamo { background: #fdf4ff; color: #7e22ce; }
.atag-rpa     { background: var(--text); color: #fff; }

.aval {
  flex: 1; font-size: 12.5px; color: var(--text);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 2px;
}
.aval-big  { font-size: 16px; font-weight: 700; font-family: 'DM Mono', monospace; }
.aval-dim  { color: var(--text-muted); font-size: 11px; }
.aval-placeholder { color: var(--border-hi); font-style: italic; font-size: 11.5px; }
.aval-soon {
  background: var(--surface-3); color: var(--text-muted);
  font-size: 9px; font-weight: 600; border-radius: 4px; padding: 1px 5px; letter-spacing: .3px;
}
.aval-rpa-result { color: #4ade80; font-weight: 700; font-size: 13px; }
.aval-rpa-result.no { color: #f87171; }
.aval-rpa-result.audit { color: #fbbf24; }
.aval-rpa-result.pot   { color: #0d9488; }
.aval-rpa-result.potno { color: #c2410c; }

.alert-pill-scored {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px; font-size: 10.5px; font-weight: 600;
  background: #fff3ed; color: #9a3412; border: 1px solid #fed7aa;
}
.alert-pill-zero {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px; font-size: 10.5px; font-weight: 600;
  background: var(--surface); color: var(--text-muted); border: 1px solid var(--border);
}
.reclamo-kv   { display: flex; flex-direction: column; gap: 3px; }
.reclamo-kv-row { display: flex; gap: 8px; font-size: 12px; }
.reclamo-k    { color: var(--text-muted); min-width: 90px; }
.reclamo-v    { font-weight: 500; color: var(--text); }

/* ── CHIPS DE SEÑALES ── */
.chips-panel {
  background: #fff; border-radius: 14px;
  border: 1px solid var(--border); padding: 16px 18px;
}
.chips-panel-title {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); font-weight: 600; margin-bottom: 10px;
}
.chips-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-signal {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px; font-size: 11.5px; font-weight: 500; border: 1px solid;
}
.chip-signal.warn { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.chip-signal.ok   { background: #f0fdf4; color: #15803d; border-color: #86efac; }
.chip-signal.info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

.chip-signal.dim  { background: var(--surface); color: var(--text-muted); border-color: var(--border); }

/* ── KPI STRIP ── */
.kpi-cell {
  flex: 1;
  min-width: 0;
  padding: 10px 16px 9px;
  border-radius: 10px;
  border: 1px solid rgba(216,210,200,.4);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  animation: kpiIn .32s ease both;
  transition: box-shadow .2s, transform .2s;
  position: relative;
}
.kpi-cell:hover {
  box-shadow: 0 5px 16px rgba(0,0,0,.09);
  transform: translateY(-2px);
}

.kpi-icon-wrap {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-icon-wrap svg { width: 15px; height: 15px; }
.kpi-num {
  font-family: 'DM Mono', monospace;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.6px;
}
.kpi-num-suffix {
  font-size: 13px;
  font-weight: 500;
  color: inherit;
  opacity: .7;
  font-family: 'DM Mono', monospace;
  letter-spacing: -.2px;
  margin-left: 4px;
}
.kpi-bar-track {
  height: 2px;
  background: rgba(216,210,200,.5);
  border-radius: 2px;
  margin: 6px 0 5px;
  overflow: hidden;
}
.kpi-bar-fill {
  height: 100%;
  border-radius: 3px;
  width: 0;
  transition: width 1.1s cubic-bezier(.22, .68, 0, 1.15);
}
.kpi-pre-lbl {
  font-size: 7.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.kpi-lbl {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}
.kpi-ctx {
  font-size: 9.5px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}
@keyframes kpiIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* ── LOTE CARDS ── */
.lote-card {
  display: flex;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(216,210,200,.5);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  overflow: hidden;
  animation: loteIn .32s ease both;
  transition: box-shadow .2s, transform .2s;
}
.lote-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.lote-accent { width: 4px; flex-shrink: 0; }
.lote-body   { flex: 1; padding: 14px 18px; min-width: 0; }

.lote-top {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 12px; margin-bottom: 10px;
}
.lote-name {
  font-weight: 700; font-size: 14px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lote-meta {
  display: flex; align-items: center; gap: 8px; margin-top: 3px;
}
.lote-id {
  font-family: 'DM Mono', monospace; font-size: 10px; color: var(--text-muted);
}
.lote-date-rel {
  font-size: 10px; color: var(--text-muted);
  background: var(--surface-2); border-radius: 4px; padding: 1px 6px;
}

.lote-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.lote-stats {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.lote-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.lote-pill.p  { background: #fef2f2; color: #dc2626; }
.lote-pill.np { background: #f0fdf4; color: #16a34a; }
.lote-pill.au { background: #fffbeb; color: #d97706; }
.lote-pill.sp { background: var(--surface-2); color: var(--text-muted); }
.lote-pill.tot {
  margin-left: auto; background: var(--surface-2);
  color: var(--text-dim); font-family: 'DM Mono', monospace;
}

.lote-bar-wrap {
  height: 5px; border-radius: 3px;
  background: var(--surface-3); overflow: hidden;
  display: flex;
}
.lote-bar-seg {
  height: 100%; width: 0;
  transition: width .9s cubic-bezier(.22,.68,0,1.1);
}
.lote-bar-seg.p  { background: #ef4444; }
.lote-bar-seg.np { background: #22c55e; }
.lote-bar-seg.au { background: #f59e0b; }

@keyframes loteIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ══════════════════════════════════════════════════════════════
   DETALLE REDISEÑADO v2 — prefijo det2-
   Fondo blanco acotado al contenedor del detalle (no afecta --bg global)
   ══════════════════════════════════════════════════════════════ */

.det2-page {
  background: #ffffff;
  max-width: 1240px;
  margin: 22px auto 40px;
  padding: 28px 34px 56px;
  border-radius: 22px;
  box-shadow: 0 10px 44px rgba(28,26,22,.09), 0 1px 0 rgba(28,26,22,.03);
}

/* ── Grid: sidebar + main ── */
/* `flex: 1` porque su padre (#state-content) lo muestra con `display:flex` desde el JS:
   sin crecer, el grid se dimensiona al contenido y el detalle entero se encogía al
   largo del nombre del audio — por eso los botones de la cabecera cambiaban de sitio
   con cada registro. */
.det2-grid { display: flex; gap: 30px; align-items: flex-start; flex: 1 1 auto; min-width: 0; }

/* ── SIDEBAR ── */
.det2-side {
  flex: 0 0 248px;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #f0ece5;
  box-shadow: 0 3px 16px rgba(28,26,22,.045);
  padding: 20px 16px;
}
.det2-who {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 7px; padding-bottom: 14px;
}
.det2-ava {
  width: 66px; height: 66px; border-radius: 50%;
  background: linear-gradient(135deg,#f1ede7,#e6e0d8);
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; font-weight: 800; color: #b9b1a5;
  overflow: hidden;
  /* anillo sutil que define la circunferencia sobre el fondo blanco */
  box-shadow: 0 0 0 1px rgba(20,18,14,.10), 0 1px 4px rgba(20,18,14,.08);
}
.det2-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.det2-who-name { font-weight: 800; font-size: 15px; line-height: 1.2; }
.det2-who-doc  { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--text-muted); }

.det2-rows { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; }
.det2-row  { display: flex; align-items: center; gap: 11px; padding: 9px 6px; border-radius: 11px; }
.det2-row:hover { background: #faf8f5; }

.det2-ic {
  width: 32px; height: 32px; border-radius: 10px;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.det2-ic.org { background: #fff3ec; color: #e0702e; }
.det2-ic.blu { background: #eaf1ff; color: #2563eb; }
.det2-ic.grn { background: #e7f8ee; color: #16a34a; }
.det2-ic.pur { background: #f6edff; color: #7e22ce; }
.det2-ic.gry { background: #f1efe9; color: #6b6760; }

/* Iconos PNG a color (sin chip de fondo) — sidebar del detalle */
.det2-ic-img {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.det2-ic-img img { width: 26px; height: 26px; object-fit: contain; display: block; }

.det2-rv {
  font-size: 12.5px; font-weight: 700; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 175px;
}
.det2-rv.up { text-transform: uppercase; }
.det2-rv small {
  display: block; font-weight: 500; font-size: 10px; color: #5e5a54;
  font-family: 'DM Mono', monospace; text-transform: none; white-space: normal;
}
.det2-rl {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); font-weight: 600; margin-top: 1px;
}
.det2-rl-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: .02em;
}
/* Aviso de que la transcripción informó más de un monto: el valor de arriba es el
   reconciliado, pero la grabación no fue unívoca y conviene escucharla. */
.det2-rl-warn {
  color: var(--warning);
  font-weight: 600;
  cursor: help;
}

/* Transcripción sin separación de hablantes: lo que depende de quién habló no es
   verificable. Medido 2026-08-04: reconstruirlo desde el texto acierta el 50%. */
.ia-aviso-hablantes {
  background: rgba(180, 83, 9, 0.08);
  border-left: 3px solid var(--warning);
  color: var(--warning);
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}
/* El motor decidió, pero con evidencia incompleta. La coletilla va pegada al veredicto
   para que se lea como UNA etiqueta: "✕ NO Procede · evidencia no concluyente…". */
.badge-con-aviso {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
/* Solo en las TARJETAS del lote: en el detalle este aviso se retiró (2026-08-05) porque
   duplicaba al de `dp-completitud`, que dice lo mismo con más precisión. */
.pdc-no-concluyente {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--warning);
  background: rgba(180, 83, 9, 0.10);
  border-radius: 4px;
  padding: 2px 7px;
  cursor: help;
  line-height: 1.35;
}

.ia-no-verif {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--warning);
  border: 1px solid var(--warning);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ── MAIN ── */
.det2-main { flex: 1; min-width: 0; }

/* Cabecera: nombre de archivo + botones arriba */
.det2-head {
  display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap;
}
/* El nombre se queda con el espacio sobrante para que los botones no se muevan al
   cambiar de registro: van pegados al borde derecho, mida lo que mida el archivo. */
.det2-head-name { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 320px; }
/* `nowrap`: si la fila se parte, la marca se va sola a un renglón sobre el nombre.
   Que quiebre el nombre, que para eso es texto. */
.det2-fname-row { display: flex; align-items: flex-start; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.det2-fname {
  font-family: 'DM Mono', monospace; font-size: 13.5px; font-weight: 500;
  border-bottom: 2px solid #f0d9c9; padding-bottom: 3px;
}
.det2-fname b { color: #e0702e; font-weight: 600; }
/* Marca de llamada concatenada: el audio es la unión de varias grabaciones de la misma
   venta. Va FUERA de #audio-filename a propósito — los modales de IA y CPS titulan con
   su .textContent y se llevarían la etiqueta puesta. */
.det2-concat {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 24px; height: 24px; border-radius: 50%; margin-top: -2px;
  background: #fff7e8; border: 1px solid #f2ddb4; cursor: default;
}
.det2-concat img { width: 15px; height: 15px; object-fit: contain; display: block; }
/* Línea "Ejecutado" — discreta, pequeña, gris */
.det2-exec {
  font-family: 'DM Mono', monospace; font-size: 10px; font-weight: 500;
  color: #a8a297; letter-spacing: .2px; line-height: 1.3;
}
.det2-exec:empty { display: none; }
.det2-acts { display: flex; gap: 9px; margin-left: auto; align-items: center; flex: 0 0 auto; }
.det2-acts-media { display: flex; gap: 9px; align-items: center; }
/* Reprocesar es de otra familia (rehace el RPA y gasta IA): se separa con un filete, no
   con espacio libre — el espacio lo repartía el flex y lo corría en cada ancho. */
.det2-acts-div { width: 1px; height: 20px; background: #eee5dc; flex: 0 0 auto; }
/* Botones solo-icono, alineados al nivel del nombre del audio */
.det2-act {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  width: 34px; height: 34px; padding: 0;
  background: #fff; border: 1.5px solid #f0e7df;
  color: #1c1a16; border-radius: 50%;
  text-decoration: none; transition: all .14s;
}
.det2-act svg { width: 17px; height: 17px; display: block; }
.det2-act:hover { border-color: #e0702e; background: #fff3ec; color: #e0702e; }
.det2-act.primary {
  background: #e0702e; color: #fff; border-color: #e0702e;
  box-shadow: 0 4px 12px rgba(224,112,46,.3);
}
.det2-act.primary:hover { background: #c96028; color: #fff; }
.det2-act:disabled, .det2-act[disabled] {
  opacity: .45; cursor: not-allowed; pointer-events: none;
}
/* Botón Análisis IA — pill con texto (la funcionalidad nueva se descubre sola) */
.det2-act-ia {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  height: 34px; padding: 0 14px;
  background: #fff; border: 1.5px solid #e0702e; color: #e0702e;
  border-radius: 17px; font-weight: 700; font-size: 12.5px;
  font-family: inherit; white-space: nowrap; transition: all .14s;
}
.det2-act-ia:hover { background: #e0702e; color: #fff; }
.det2-act-ia:disabled { opacity: .45; cursor: not-allowed; }
/* Variante sidebar: al final de la info del cliente, ancho completo */
.det2-act-ia-side { width: 100%; justify-content: center; margin-top: 14px; }

/* Pestañas pills del modal Análisis IA (mismo patrón que Registros/Auditados) */
.ia-tab {
  cursor: pointer; border-radius: 15px; padding: 6px 14px;
  font-size: 12px; font-weight: 700; font-family: inherit;
  background: var(--surface-2, #f4f1ec); border: 1px solid var(--border, #e5e0d8);
  color: var(--text-muted, #6b6659); transition: all .14s;
}
.ia-tab.active {
  background: var(--accent, #e0702e); border-color: var(--accent, #e0702e); color: #fff;
}

/* ── Modal CPS: mini-hero, filas de métrica, citas MAC/PDR ──────────────────── */

/* Mini-hero: score total + nivel semántico (bajo/medio/alto), siempre junto al número */
.cps-hero {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 22px; border-bottom: 1px solid #f0e7df;
}
.cps-score-badge {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace; font-size: 20px; font-weight: 800;
  border: 3px solid currentColor; background: #fff;
}
.cps-hero-level { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.cps-hero-desc  { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }

.cps-pane { padding: 18px 22px; font-size: 13px; }

/* Encabezado de cada pestaña: score del segmento + nivel + qué significa */
.cps-pane-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cps-pane-score {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace; font-weight: 800; font-size: 15px; color: #fff;
}
.cps-pane-level { font-size: 12.5px; font-weight: 800; }
.cps-pane-desc  { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

/* Filas icono + valor + etiqueta — mismo lenguaje que el sidebar (.det2-row) */
.cps-metric-row {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 2px; border-bottom: 1px solid #f5f1ea;
}
.cps-metric-row:last-child { border-bottom: none; }
.cps-metric-ic {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  font-size: 11px; font-weight: 800; letter-spacing: .2px;
  display: flex; align-items: center; justify-content: center; background: #f4f1ec; color: #6b6760;
}
/* Monogramas de color — mismo lenguaje que los avatares/burbujas A·C del drawer */
.cps-metric-ic.org { background: #fff3ec; color: #e0702e; }
.cps-metric-ic.blu { background: #eaf1ff; color: #2563eb; }
.cps-metric-ic.grn { background: #e7f8ee; color: #16a34a; }
.cps-metric-ic.pur { background: #f6edff; color: #7e22ce; }
.cps-metric-ic.gry { background: #f1efe9; color: #6b6760; }
.cps-metric-val { font-size: 13px; font-weight: 700; color: var(--text); }
.cps-metric-lbl {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); font-weight: 600; margin-top: 1px;
}
/* Mismo par de colores que la transcripción (Asesor=naranja / Cliente=verde) */
.cps-agente  { color: #e0702e; }
.cps-cliente { color: #1a9e52; }

/* Badge PASS/FAIL de la pestaña MAC/PDR */
.cps-macpdr-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 16px; border-radius: 20px;
  font-size: 12.5px; font-weight: 800; margin-bottom: 16px;
}
.cps-macpdr-badge.pass { background: #dcfce7; color: #15803d; }
.cps-macpdr-badge.fail { background: #fee2e2; color: #dc2626; }
.cps-macpdr-sub { font-size: 11.5px; color: var(--text-muted); margin: -8px 0 16px; }

/* Citas MAC/PDR como burbujas de chat — mismo lenguaje visual del drawer de transcripción */
.cps-quote { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.cps-quote.cliente { justify-content: flex-end; }
.cps-quote-who {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; color: #fff;
  font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.cps-quote-body { max-width: 78%; min-width: 0; }
.cps-quote-label {
  font-size: 9px; color: #8a8a8a; margin-bottom: 3px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3px;
}
.cps-quote-text { padding: 8px 12px; font-size: 12.5px; line-height: 1.5; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.cps-quote.agente .cps-quote-who  { background: #e0702e; }
.cps-quote.agente .cps-quote-text { background: #fff8f3; border: 1px solid #f3ded0; border-radius: 0 12px 12px 12px; }
.cps-quote.cliente .cps-quote-who  { background: #25d366; }
.cps-quote.cliente .cps-quote-text { background: #eafbe7; border: 1px solid #d3f3c8; border-radius: 12px 0 12px 12px; text-align: left; }
.cps-quote.cliente .cps-quote-label { text-align: right; }
.cps-quote-none {
  font-size: 12px; color: var(--text-muted); font-style: italic;
  padding: 10px 0; border-bottom: 1px dashed #ece6dc; margin-bottom: 12px;
}

/* Toggle "ver ›" / "ver los turnos del cliente ▾" — mismo estilo que .gp */
.cps-toggle-link { font-size: 12px; color: var(--text-muted); font-weight: 600; cursor: pointer; }
.cps-toggle-link:hover { color: var(--accent); }

/* Lista expandible de turnos del cliente clasificados (Calidad) */
.cps-turno-item { padding: 10px 2px; border-bottom: 1px dashed #ece6dc; }
.cps-turno-item:last-child { border-bottom: none; }
.cps-turno-texto { font-size: 12.5px; color: var(--text); margin-bottom: 6px; line-height: 1.5; }
.cps-turno-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.cps-turno-badge {
  font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: .3px;
}
.cps-turno-badge.activo { background: #dcfce7; color: #15803d; }
.cps-turno-badge.pasivo { background: #f1efe9; color: #6b6760; }
.cps-turno-badge.sent-positivo { background: #dcfce7; color: #15803d; }
.cps-turno-badge.sent-neutro   { background: #eaf1ff; color: #2563eb; }
.cps-turno-badge.sent-negativo { background: #fee2e2; color: #dc2626; }
.cps-turno-badge.tipo { background: #f6edff; color: #7e22ce; }

/* Variante con icono PNG a color: sin círculo ni borde, solo la imagen */
.det2-act-img {
  width: 36px; height: 36px; background: none; border: none; box-shadow: none; border-radius: 0;
}
.det2-act-img:hover { background: none; border: none; transform: translateY(-1px); }
.det2-act-img img { width: 30px; height: 30px; object-fit: contain; display: block; }
/* Tooltip CSS al hover */
.det2-act[data-tooltip]::after,
.det2-concat[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(-3px);
  background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(28,26,22,.12);
  font-size: 11px; font-weight: 600; text-transform: none;
  letter-spacing: .2px; white-space: nowrap; padding: 5px 9px; border-radius: 7px;
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 30;
}
.det2-act[data-tooltip]::before,
.det2-concat[data-tooltip]::before {
  content: ""; position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%) translateY(-3px);
  border: 5px solid transparent; border-bottom-color: var(--border);
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 30;
}
.det2-act[data-tooltip]:hover::after,
.det2-act[data-tooltip]:hover::before,
.det2-concat[data-tooltip]:hover::after,
.det2-concat[data-tooltip]:hover::before { opacity: 1; transform: translateX(-50%) translateY(0); }
/* La marca de concatenada vive pegada al borde izquierdo de la tarjeta: centrado, el
   globo se salía de la pantalla en anchos chicos. La flechita sí queda centrada. */
.det2-concat[data-tooltip]::after { left: 0; transform: translateX(0) translateY(-3px); }
.det2-concat[data-tooltip]:hover::after { transform: translateX(0) translateY(0); }

/* HERO Score OneFace — protagonista */
.det2-hero {
  display: flex; align-items: center; gap: 28px; margin: 22px 0 8px;
  /* Neutro mientras no se sabe el veredicto (evaluando, sin procesar, error de Apolo).
     El color lo pone el modificador `h-*` que estampa record.js. */
  background: linear-gradient(180deg,#faf8f5,#ffffff); border: 1px solid #ece6dc;
  border-radius: 20px; padding: 22px 28px;
  transition: background .2s, border-color .2s;
}
/* El fondo acompaña al veredicto, con la MISMA semántica invertida que las pills: que la
   reclamación proceda es el resultado malo para el negocio, de ahí el rojo. Antes era
   verde fijo y contradecía al badge rojo que llevaba adentro. */
.det2-hero.h-procede {
  background: linear-gradient(180deg,#fff6f6,#ffffff); border-color: #f7dcdc;
}
.det2-hero.h-no-procede {
  background: linear-gradient(180deg,#f7fdf9,#ffffff); border-color: #e7f3ec;
}
.det2-hero.h-auditoria {
  background: linear-gradient(180deg,#fffdf4,#ffffff); border-color: #f4ead0;
}
.det2-hero.h-potencial-procede {
  background: linear-gradient(180deg,#fff8f9,#ffffff); border-color: #f8e3e6;
}
.det2-hero.h-potencial-no {
  background: linear-gradient(180deg,#f6fdfa,#ffffff); border-color: #e2f2ea;
}
/* Los separadores internos siguen al borde del bloque para que no queden verdes sobre
   un fondo rojo. */
.det2-hero.h-procede .of-res           { border-top-color: #f7dcdc; }
.det2-hero.h-no-procede .of-res       { border-top-color: #e7f3ec; }
.det2-hero.h-auditoria .of-res        { border-top-color: #f4ead0; }
.det2-hero.h-potencial-procede .of-res { border-top-color: #f8e3e6; }
.det2-hero.h-potencial-no .of-res     { border-top-color: #e2f2ea; }
.det2-hero:not([class*="h-"]) .of-res { border-top-color: #ece6dc; }
/* Mismo caso para el filete del veredicto: el hero se tiñe segun lo que dijo el motor,
   asi que un separador de color fijo queda verde sobre un fondo rojo. */
.det2-hero.h-procede #of-vrd           { border-left-color: #f7dcdc; }
.det2-hero.h-no-procede #of-vrd        { border-left-color: #e7f3ec; }
.det2-hero.h-auditoria #of-vrd         { border-left-color: #f4ead0; }
.det2-hero.h-potencial-procede #of-vrd { border-left-color: #f8e3e6; }
.det2-hero.h-potencial-no #of-vrd      { border-left-color: #e2f2ea; }
.det2-gauge { position: relative; width: 148px; height: 148px; flex-shrink: 0; }
.det2-gauge .num {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.det2-gauge .num b {
  font-family: 'DM Mono', monospace; font-size: 31px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: baseline; justify-content: center;
}
.det2-gauge .num b .of-int { font-size: 31px; }
.det2-gauge .num b .of-dec { font-size: 18px; }
.det2-gauge .num b .of-pct { font-size: 18px; margin-left: 1px; }
.det2-gauge .num > span {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-muted); font-weight: 700; margin-top: 4px;
}
.det2-hero-info { flex: 1; }

/* ── Veredicto del auditor, dentro del hero ────────────────────────────────────
   Los dos pulgares van a la derecha del resultado. No llevan `margin-left:auto`:
   `.det2-hero-info` ya se come el sobrante con su `flex:1`. Los iconos traen su
   propio circulo de color, asi que el boton solo pone el disco blanco de atras.
   Sin veredicto los dos estan apagados; el elegido se enciende y el otro se apaga
   mas — el mismo lenguaje que tenian en la tarjeta. */
.of-vrd {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 9px; flex-shrink: 0;
  /* Filete propio: sin el, los dos circulos flotan contra el borde del hero y se leen
     como decoracion. El color lo pisan los modificadores `h-*` de mas abajo. */
  align-self: stretch; padding-left: 26px; border-left: 1px solid #ece6dc;
}
.of-vrd-rot {
  font-size: 10px; text-transform: uppercase; letter-spacing: .7px;
  font-weight: 800; color: var(--text-muted);
}
.of-vrd-btns { display: flex; gap: 14px; align-items: flex-start; }
.of-vrd-uno { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.of-vrd-cap { font-size: 10px; font-weight: 700; color: var(--text-dim); }
.of-vrd-btn {
  width: 54px; height: 54px; padding: 0; border: none; border-radius: 50%;
  background: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 9px rgba(31,26,20,.14);
  transition: opacity .15s, transform .15s, box-shadow .15s;
}
.of-vrd-btn img { width: 38px; height: 38px; display: block; }
/* Sin veredicto los dos se ofrecen por igual, a color pleno: son una pregunta abierta,
   no un estado. Recien al decidir uno se destaca y el otro se retira. */
.of-vrd-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 4px 13px rgba(31,26,20,.2); }
.of-vrd-btn:disabled { cursor: progress; }
.of-vrd-btn.on { opacity: 1; filter: none; transform: scale(1.07); }
#of-vrd-si.on { box-shadow: 0 3px 13px #86efac; }
#of-vrd-no.on { box-shadow: 0 3px 13px #fca5a5; }
/* Con un veredicto puesto, el que NO se eligio se retira mas todavia: la pareja tiene
   que leerse como "esta es la decision", no como dos opciones abiertas. */
.of-vrd.decidido .of-vrd-btn:not(.on) { opacity: .28; }
.of-vrd-quien {
  font-size: 10.5px; line-height: 1.4; text-align: center; max-width: 168px;
  color: var(--text-muted);
}
.of-vrd-quien b { font-weight: 800; color: var(--text-dim); }
.det2-hero-lbl  {
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-muted); font-weight: 700;
}
.det2-res-badge {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 8px;
  font-weight: 800; font-size: 18px; padding: 10px 20px; border-radius: 14px;
}
.det2-res-badge.procede     { background: #fee2e2; color: #dc2626; }
.det2-res-badge.no-procede  { background: #dcfce7; color: #15803d; }
.det2-res-badge.auditoria   { background: #fef9c3; color: #b45309; }
.det2-res-badge.potencial-procede { background: #fff1f2; color: #e11d48; }
.det2-res-badge.potencial-no      { background: #ecfdf5; color: #059669; }
.det2-hero-hint { font-size: 12px; color: #6b6760; margin-top: 10px; }
.det2-hero-pen  { display: flex; gap: 22px; margin-top: 12px; }
.det2-pen       { font-size: 11px; }
.det2-pen b     { font-family: 'DM Mono', monospace; font-size: 13px; }
.det2-pen span  {
  color: var(--text-muted); display: block;
  text-transform: uppercase; letter-spacing: .4px; font-size: 9px; font-weight: 700;
}

/* Timeline */
.det2-timeline { display: flex; gap: 20px; margin-top: 18px; }
.det2-spine    {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0; padding-top: 2px;
}
.det2-phone {
  width: 46px; height: 46px; border-radius: 50%;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(224,112,46,.4);
}
.det2-phone img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; display: block; }
.det2-dots {
  flex: 1; width: 0; border-left: 2px dotted #e2dcd3; margin: 8px 0;
}
.det2-plus {
  width: 30px; height: 30px; border-radius: 50%;
  background: transparent; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.det2-plus img { width: 100%; height: 100%; object-fit: contain; display: block; }
.det2-rowsR {
  flex: 1; display: flex; flex-direction: column; gap: 18px; padding-top: 6px;
}
.det2-arow { display: flex; align-items: center; gap: 16px; }

/* ── Etiquetas de las filas del "Detalle de llamada" ──────────────────────────
   Capsula blanca con el color en el CONTORNO y en un punto, no en el relleno: seis
   rellenos de color pesan y compiten con el hero, seis contornos no.

   Un tono por metrica. Antes «Venta consciente» y «Score» compartian exactamente el
   mismo verde (#dcfce7) —dos cosas distintas pintadas igual— y, peor, la gravedad
   estaba invertida: Alertas iba en ROJO y Rechazos en GRIS, el tono mas apagado de los
   seis, siendo el rechazo calificado lo mas grave de la lista. Ahora el rechazo es el
   rojo y la alerta el ambar. Hay tests que lo fijan.

   `--c-fg` texto · `--c-st` punto (solido) · `--c-bd` contorno y sombra (con alfa). Se
   escriben los tres a mano en vez de derivarlos con `color-mix()`: si el navegador no lo
   soporta, un `border-color` invalido tira ABAJO toda la declaracion del borde y la
   capsula queda sin contorno. */
.det2-tag {
  flex-shrink: 0; width: 180px;      /* "VENTA CONSCIENTE" entra en UNA linea */
  font-size: 11px; font-weight: 800; letter-spacing: .3px;
  padding: 8px 14px; border-radius: 999px;
  display: flex; align-items: center; gap: 8px;
  background: #fff; color: var(--c-fg);
  border: 1.5px solid var(--c-bd);
  box-shadow: 0 2px 6px var(--c-bd);
}
.det2-tag::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  background: var(--c-st); box-shadow: 0 0 0 3px var(--c-bd);
}
.det2-tag.t-cps { --c-fg: #4338ca; --c-st: #818cf8; --c-bd: #818cf866; }
.det2-tag.t-vc  { --c-fg: #15803d; --c-st: #4ade80; --c-bd: #4ade8066; }
.det2-tag.t-al  { --c-fg: #b45309; --c-st: #fbbf24; --c-bd: #fbbf2466; }
.det2-tag.t-rj  { --c-fg: #b91c1c; --c-st: #f87171; --c-bd: #f8717166; }
.det2-tag.t-sc  { --c-fg: #0e7490; --c-st: #22d3ee; --c-bd: #22d3ee66; }
.det2-tag.t-tmo { --c-fg: #1d4ed8; --c-st: #60a5fa; --c-bd: #60a5fa66; }

.det2-av { font-size: 14.5px; font-weight: 600; color: #1c1a16; }
.det2-av .pct { font-weight: 800; }
.det2-av .gp  { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.det2-av small { color: var(--text-muted); font-weight: 500; font-size: 12.5px; }

/* Botón "i" circular — abre el desglose (CPS, y cualquier fila futura que lo necesite) */
.det2-info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--accent); color: var(--accent); background: #fff;
  font-size: 11px; font-weight: 800; font-style: italic; font-family: Georgia, 'Times New Roman', serif;
  cursor: pointer; margin-left: 7px; transition: all .14s; text-decoration: none;
  vertical-align: middle;
}
.det2-info-btn:hover { background: var(--accent); color: #fff; }

/* Contenedor de pills (alertas/rechazos): envuelven enteras, sin cortar palabras */
.det2-pills {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  flex: 1 1 auto; min-width: 0;
}
/* El contenido de las dos listas, a juego con su etiqueta pero mas liviano: contorno
   fino, relleno muy tenue del propio tono y SIN sombra. Una fila puede traer cuatro o
   cinco pills, y ahi el relieve de la capsula se vuelve ruido. Eran una sola clase y las
   dos rojas, asi que un aviso y un motivo de rechazo se veian identicos. */
.det2-pill-alert, .det2-pill-rechazo {
  display: inline-block;
  background: var(--p-tt); color: var(--p-fg);
  border: 1px solid var(--p-bd);
  font-size: 12.5px; font-weight: 600; padding: 5px 13px; border-radius: 999px;
  white-space: normal; overflow-wrap: normal;
}
.det2-pill-alert   { --p-fg: #b45309; --p-tt: #fffbeb; --p-bd: #fbbf24aa; }
.det2-pill-rechazo { --p-fg: #b91c1c; --p-tt: #fff5f5; --p-bd: #f87171aa; }

/* ══════════════════════════════════════════════════════════════
   MOTOR DE PROCEDENCIA — los dos motores lado a lado (prefijo dp-)
   Comparación temporal mientras dura la migración: el motor activo
   (settings_store.get_motor_procedencia()) se marca con .dp-activo, mismo
   lenguaje visual que .engine-card.selected en /configuracion. Los colores del
   veredicto son los mismos tres de las pills de resultado (results.js / .det2-res-badge).
   ══════════════════════════════════════════════════════════════ */
/* ── Recuadro del resultado (rediseño 2026-08-31) ─────────────────────────────
   Reemplaza al comparador de motores y al plegable de motivos: las razones del veredicto
   dejaron de ser algo que se lee y pasaron a ser algo que se califica, una por una.
   El acento de la izquierda dice de qué tipo es la fila sin tener que leer el chip: rojo
   los decisivos (deciden el veredicto) y ámbar las alertas (no deciden, solo se miden). */
.of-res {
  margin: 12px 0 0; padding-top: 10px; border-top: 1px solid #ece6dc;
}
.of-res[hidden] { display: none; }
.of-res-top { display: flex; align-items: center; justify-content: space-between; }
.of-res-lbl {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-dim);
}
.of-res-avance { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.of-res-filas { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.of-fila {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
  border-left: 3px solid var(--border); background: var(--surface-2);
}
.of-fila.t-decisivo  { border-left-color: #dc2626; background: #fef2f2; }
.of-fila.t-alerta    { border-left-color: #d97706; background: #fffbeb; }
.of-fila.t-resultado { border-left-color: var(--accent); background: #fff; }
.of-fila-chip {
  font-size: 8.5px; font-weight: 800; letter-spacing: .06em; padding: 2px 7px;
  border-radius: 4px; color: #fff; flex-shrink: 0;
}
.of-fila-chip.c-decisivo { background: #dc2626; }
.of-fila-chip.c-alerta   { background: #d97706; }
.of-fila-txt { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; }
.of-fila-cita {
  display: block; font-weight: 400; font-style: italic; font-size: 11.5px;
  color: var(--text-muted); margin-top: 3px;
}
.of-fila-ts {
  flex-shrink: 0; border: none; background: rgba(0,0,0,.05); color: var(--text-muted);
  font-family: 'DM Mono', monospace; font-size: 10.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 9px; cursor: pointer;
}
.of-fila-ts:hover { background: rgba(0,0,0,.09); color: var(--text); }
.of-fila-coment {
  flex-shrink: 0; border: none; background: transparent; cursor: pointer;
  line-height: 0; padding: 4px; border-radius: 6px; color: var(--text-muted);
}
.of-fila-coment:hover { background: rgba(0,0,0,.07); }
.of-salida-txt { font-size: 13px; line-height: 1.5; color: var(--text); }
/* El comentario del auditor: `pre-wrap` porque puede traer renglones, y se lee como una
   cita —es lo que escribió una persona, no un campo del sistema—. */
.of-coment-txt {
  white-space: pre-wrap; font-size: 13px; line-height: 1.55; color: var(--text);
  background: var(--surface-2); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 10px 12px; margin-top: 4px;
}
.of-coment-quien {
  font-size: 11px; color: var(--text-muted); margin-top: 8px; text-align: right;
}
/* Los pulgares por fila. El estado vive en aria-pressed y no en una clase: el lector de
   pantalla necesita saberlo igual que el ojo. */
.of-fila-votos { display: flex; gap: 5px; flex-shrink: 0; }
.of-voto {
  width: 29px; height: 29px; border-radius: 50%; border: 1px solid var(--border);
  background: #fff; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: background .15s, border-color .15s, transform .12s;
}
.of-voto:hover { transform: translateY(-1px); }
.of-voto img { width: 15px; height: 15px; opacity: .55; }
.of-voto[aria-pressed="true"].si { background: #16a34a; border-color: #16a34a; }
.of-voto[aria-pressed="true"].no { background: #dc2626; border-color: #dc2626; }
.of-voto[aria-pressed="true"] img { filter: brightness(0) invert(1); opacity: 1; }
/* El estado del registro se dice acá porque el bloque que lo decía —los pulgares
   globales del hero— no se muestra con el motor binario. */
.of-res-avance.v-aprueba { color: #15803d; font-weight: 700; }
.of-res-avance.v-rechaza { color: #b91c1c; font-weight: 700; }
/* Panel del 👎. Reusa la tarjeta del modal grande (`mm-*`): es el mismo acto de auditoría
   y darle su propio lenguaje visual lo haría parecer otra cosa. */
.of-causa-fila {
  font-size: 12.5px; font-weight: 600; color: var(--text); padding: 2px 0 4px;
}
/* La refutación es la respuesta esperada: se lee primero y se distingue del resto. */
.of-causa-inversa { background: var(--surface-2); border: 1px solid var(--border);
                    border-radius: 8px; font-weight: 600; }
.of-causa-correcto {
  width: 100%; font-family: inherit; font-size: 12px; padding: 7px 9px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}

/* Plegable de motivos */
/* ── Plegables de la ficha ────────────────────────────────────────────────────
   Lo comparten los motivos del veredicto y el detalle de la llamada. Estaba escrito
   una sola vez porque habia un solo plegable; al aparecer el segundo, copiar estos
   renglones era garantizar que en unos meses se vieran distinto — como ya paso con
   `MATCH_TIPO`, la paleta del avatar y la tabla de roles. */
.of-pleg {
  margin: 10px 0 4px; background: #fff; border: 1px solid #ece6dc; border-radius: 13px;
}
.of-pleg[hidden] { display: none; }
.of-pleg-sum {
  list-style: none; cursor: pointer; padding: 9px 14px;
  font-size: 12px; font-weight: 600; color: var(--text-dim);
  display: flex; align-items: center; gap: 7px;
}
.of-pleg-sum::-webkit-details-marker { display: none; }
.of-pleg-sum::before {
  content: "▸"; color: var(--text-muted); transition: transform .18s;
  display: inline-block;
}
.of-pleg[open] .of-pleg-sum::before { transform: rotate(90deg); }
.of-pleg-sum:hover { color: var(--text); }
.of-pleg-sum:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.of-motivos .dp-motivos { padding: 0 14px 12px; }
/* El timeline traia su propio margen de arriba, que adentro del plegable lo despegaba
   de la cabecera. Ahora el aire lo pone la caja, alineado con el padding del summary. */
.det2-pleg .det2-timeline { margin-top: 0; padding: 2px 14px 16px; }

/* ── Mapa de la conversación ──────────────────────────────────────────────────
   Marca CUÁNDO habló el cliente, no cuánto duró cada intervención: a esta escala un
   turno de 1,5 s mediría medio píxel, así que las marcas llevan ancho mínimo.

   Horizontal y a todo el ancho desde el rediseño del 2026-08-31: el eje es el tiempo de
   la llamada, que es como el auditor la escucha. Antes era una columna dentro del hero,
   donde competía por el espacio con la decisión. */
.of-mapa {
  width: 100%; border: 1px solid var(--border); background: #fff; cursor: pointer;
  display: flex; flex-direction: column; gap: 7px; text-align: left;
  padding: 10px 14px; border-radius: 12px; font: inherit; color: inherit;
  margin: 10px 0 4px; transition: background .15s;
}
.of-mapa-fila { display: flex; align-items: center; gap: 12px; width: 100%; }
/* Leyenda: qué hizo el cliente en cada turno. Todas las marcas son SUYAS —el asesor no se
   dibuja—, por eso el primer texto lo dice en vez de dejarlo a la deducción. */
.of-mapa-leyenda {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px;
  padding-left: 132px; font-size: 9.5px; color: var(--text-muted);
}
.of-mapa-leyenda[hidden] { display: none; }
.ofm-leg-q {
  font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--text-dim);
}
.ofm-leg-i { display: inline-flex; align-items: center; gap: 4px; }
.ofm-leg-i i { width: 8px; height: 11px; border-radius: 2px; display: inline-block; }
/* El MAC no es un turno del cliente sino el momento de la fórmula de activación: misma
   forma que en el mapa, para que se reconozca sin traducir. */
.ofm-leg-mac i {
  width: 12px; background: rgba(224,112,46,.20); border-top: 3px solid var(--accent);
}
.of-mapa:hover { background: rgba(224,112,46,.05); }
.of-mapa:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.of-mapa[hidden] { display: none; }
.of-mapa-lienzo { position: relative; flex: 1; min-width: 0; height: 30px; }
.ofm-rail {
  position: absolute; top: 13px; left: 0; right: 0; height: 3px;
  background: #e3ddd2; border-radius: 2px;
}
/* El color lo pone `_OFM_COLOR` (record.js), el mismo mapa que arma la leyenda: escrito
   también acá, cambiar un color exigía acordarse de los dos lados. */
.ofm-tick { position: absolute; top: 8px; height: 13px; border-radius: 2px; }
.ofm-mac {
  position: absolute; top: 4px; height: 22px; border-radius: 4px; min-width: 5px;
  background: rgba(224,112,46,.20); border-top: 3px solid var(--accent);
}
.ofm-mac-lbl {
  position: absolute; top: 0; font-size: 7px; font-weight: 800; color: #b45309;
  letter-spacing: .3px;
}
.ofm-t {
  position: absolute; bottom: -2px; font-size: 7px; color: #b6b0a6;
  font-family: 'DM Mono', monospace;
}
.ofm-vacio {
  position: absolute; inset: 0; border-radius: 8px; border: 1px dashed #d0c8bb;
  background: repeating-linear-gradient(45deg,#f4f1eb,#f4f1eb 4px,#eee9e0 4px,#eee9e0 8px);
  display: grid; place-items: center; font-size: 11px; color: #b6b0a6;
}
.of-mapa-val {
  font-family: 'DM Mono', monospace; font-size: 15px; font-weight: 700; flex-shrink: 0;
}
.of-mapa-cap {
  font-size: 8.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); flex-shrink: 0; max-width: 120px; line-height: 1.35;
}
.of-mapa-cap.ofm-aviso { color: #92400e; }

/* El gauge del hero y su umbral se ocultan cuando manda el motor binario: ese número es
   del motor de pesos y no explica el veredicto mostrado. Regla explícita porque
   `.det2-hero-pen` define `display:flex` y le gana al [hidden] del navegador. */
.det2-gauge[hidden], .det2-hero-hint[hidden], .det2-hero-pen[hidden],
.of-vrd[hidden] { display: none; }

/* Razones del veredicto en las tarjetas de registro (procedencia_ui.js). Ocupan el lugar
   de la barra "Score OneFace" cuando manda el motor binario. */
.pdc-razones { margin-top: 9px; }
.pdc-titulo {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-dim); margin-bottom: 5px;
}
.pdc-lista { list-style: none; margin: 0; padding: 0; display: flex;
             flex-direction: column; gap: 4px; }
.pdc-motivo {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 11.5px; line-height: 1.4; color: #44403a;
  border-left: 3px solid #d8d2c8; background: #faf8f5;
  border-radius: 0 7px 7px 0; padding: 5px 9px;
}
.pdc-motivo.pdc-decisivo { border-left-color: #dc2626; background: #fef2f2; color: #7f1d1d; }
.pdc-motivo.pdc-alerta   { border-left-color: #f59e0b; background: #fffbeb; color: #92400e; }
.pdc-ico { flex-shrink: 0; }
.pdc-vacio { font-size: 11.5px; color: var(--text-muted); font-style: italic; padding: 2px 0; }

.dp-veredicto {
  display: inline-flex; align-items: center; font-weight: 800; font-size: 15px;
  padding: 6px 14px; border-radius: 10px; background: #f4f1ec; color: var(--text-muted);
}
.dp-veredicto.procede            { background: #fee2e2; color: #dc2626; }
.dp-veredicto.no-procede         { background: #dcfce7; color: #15803d; }
.dp-veredicto.auditoria          { background: #fef9c3; color: #b45309; }
.dp-veredicto.potencial-procede  { background: #fff1f2; color: #e11d48; }
.dp-veredicto.potencial-no       { background: #ecfdf5; color: #059669; }

/* Dentro del comparador el veredicto de cada motor es información de apoyo: el badge
   grande de arriba es el que manda, y estos no deben competir con él. */
.of-cmp-row .dp-veredicto { font-size: 12.5px; padding: 4px 11px; border-radius: 8px; }

/* Con qué evidencia se pronunció el motor: separa "no encontramos nada" de "no pudimos
   mirar". Ámbar tenue — es una advertencia sobre el veredicto, no un veredicto. */
.dp-completitud {
  margin-top: 9px; padding: 7px 10px; border-radius: 8px;
  background: #fffbeb; color: #92400e; border-left: 3px solid #f59e0b;
  font-size: 11.5px; font-weight: 600; line-height: 1.45;
}

.dp-motivos {
  list-style: none; margin: 12px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.dp-motivo {
  border-left: 3px solid #d8d2c8; background: #faf8f5; border-radius: 0 10px 10px 0;
  padding: 9px 12px;
}
/* Distinción "de un vistazo" entre lo que decide el veredicto y lo que solo informa */
.dp-motivo.dp-decisivo { border-left-color: #dc2626; background: #fff5f5; }
.dp-motivo.dp-alerta   { border-left-color: #b45309; background: #fffbeb; }

.dp-m-tipo {
  display: inline-block; font-size: 9px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .4px; padding: 2px 7px; border-radius: 8px; margin-right: 6px;
  vertical-align: middle;
}
.dp-decisivo .dp-m-tipo { background: #dc2626; color: #fff; }
.dp-alerta   .dp-m-tipo { background: #fef3c7; color: #92400e; }

.dp-m-etiqueta { font-size: 12.5px; font-weight: 700; color: var(--text); }
.dp-m-cita {
  display: block; font-size: 12px; font-style: italic; color: #44403c;
  margin-top: 5px; line-height: 1.45;
}
.dp-m-ts {
  display: inline-flex; align-items: center; gap: 3px; margin-top: 7px;
  font-family: 'DM Mono', monospace; font-size: 10.5px; font-weight: 700;
  color: var(--accent); background: #fff3ec; border: 1px solid #f3ded0;
  border-radius: 9px; padding: 2px 9px; cursor: pointer; transition: all .14s;
}
.dp-m-ts:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.dp-motivos-vacio {
  font-size: 12px; color: var(--text-muted); font-style: italic; margin-top: 8px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   Modal de motivos del rechazo
   Se abre al dar 👎 y es lo que convierte el rechazo en feedback medible sobre el
   motor. Ver app/static/js/motivos_modal.js.
   ══════════════════════════════════════════════════════════════════════════════ */
.mm-overlay {
  position: fixed; inset: 0; z-index: 200;   /* el topbar es fixed: hay que taparlo */
  background: rgba(28, 26, 22, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: mm-fade .15s ease;
}
@keyframes mm-fade { from { opacity: 0; } to { opacity: 1; } }

.mm-card {
  background: var(--page); border-radius: 14px; width: 100%; max-width: 520px;
  max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(28, 26, 22, .28);
}
.mm-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px 10px; border-bottom: 1px solid var(--border);
}
.mm-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; color: var(--text); }
.mm-x {
  margin-left: auto; border: none; background: none; cursor: pointer;
  font-size: 14px; color: var(--text-dim); line-height: 1; padding: 4px;
}
.mm-body { padding: 12px 18px; overflow-y: auto; }
.mm-grupo { display: block; margin-bottom: 14px; }
.mm-grupo-tit {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-dim); margin-bottom: 6px;
}
.mm-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px; border-radius: 7px; cursor: pointer; font-size: 12.5px;
  line-height: 1.35; color: var(--text);
}
.mm-item:hover { background: var(--surface); }
.mm-item input { margin-top: 2px; flex-shrink: 0; accent-color: var(--accent); }
.mm-coment textarea, .mm-grupo textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  font-family: inherit; font-size: 12.5px; resize: vertical; background: var(--surface);
  color: var(--text);
}
.mm-error { color: var(--danger); font-size: 11px; font-weight: 600; margin-top: 4px; }
.mm-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px 16px; border-top: 1px solid var(--border);
}
.mm-ok { background: var(--danger); color: #fff; border-color: var(--danger); }

/* Lo que el motor marcó: a la vista y con el acento del rechazo, porque es lo que el
   auditor viene a contradecir. Todo lo demás vive plegado. */
.mm-marcados {
  background: var(--surface); border-left: 3px solid var(--danger);
  border-radius: 0 9px 9px 0; padding: 8px 10px 4px;
}
.mm-marcados .mm-item:hover { background: var(--page); }

/* Desplegables por momento de la llamada. Los 16 motivos + la evidencia sin plegar
   empujaban el botón de confirmar fuera de la tarjeta. */
.mm-det {
  border: 1px solid var(--border); border-radius: 9px;
  margin-bottom: 6px; background: var(--page);
}
.mm-det > summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  padding: 8px 10px; border-radius: 9px;
  font-size: 12.5px; font-weight: 600; color: var(--text);
}
.mm-det > summary::-webkit-details-marker { display: none; }
.mm-det > summary::before { content: "▸"; font-size: 9px; color: var(--text-dim); }
.mm-det[open] > summary::before { content: "▾"; }
.mm-det > summary:hover { background: var(--surface); }
.mm-det[open] > summary { border-radius: 9px 9px 0 0; }
.mm-det-tit { flex: 1; }
.mm-det-n {
  font-size: 10px; font-weight: 700; color: var(--text-dim);
  background: var(--surface); border-radius: 20px; padding: 1px 7px;
}
/* Solo aparece con el grupo cerrado y algo marcado adentro: es la única forma de no
   perder de vista lo elegido al plegar. */
.mm-det-mark {
  font-size: 10px; font-weight: 700; color: #991b1b;
  background: #fee2e2; border: 1px solid #fecaca; border-radius: 20px; padding: 1px 7px;
}
.mm-det[open] .mm-det-mark { display: none; }
.mm-det-body { padding: 4px 6px 6px; border-top: 1px solid var(--border); }

/* «Otro» y el comentario son una sola cosa: ese motivo es lo único que abre el campo,
   así que comparten caja en vez de quedar a dos secciones de distancia. */
.mm-coment {
  border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 10px 10px; background: var(--page);
}
.mm-coment .mm-item { margin: 2px 0 6px; }
.mm-coment .mm-item:hover { background: var(--surface); }
/* El comentario nace bloqueado: es el detalle de «Otro», no una nota libre. */
.mm-coment textarea:disabled, .mm-grupo textarea:disabled {
  background: var(--surface); color: var(--text-dim); cursor: not-allowed;
}

/* Los motivos ya guardados, en la tarjeta del tab Auditados. */
.mm-pill {
  padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 600;
  background: var(--page); border: 1px solid #fecaca; color: #991b1b;
}
.mm-pill-coment {
  padding: 2px 8px; border-radius: 20px; font-size: 10px;
  background: var(--page); border: 1px solid var(--border); color: var(--text-dim);
}

/* ══════════════════════════════════════════════════════════════════════════════
   Panel de seguimiento
   Una tarjeta por perfil de carga/consulta. El porcentaje NUNCA va solo: lleva su
   denominador al lado y la marca de muestra chica, porque con pocos registros es ruido
   y alguien podría decidir sobre una persona con eso. Ver app/services/seguimiento.py.
   ══════════════════════════════════════════════════════════════════════════════ */
.seg-toggle { display:inline-flex; background:#efece6; border:1px solid var(--border);
              border-radius:8px; padding:2px; gap:2px; }
.seg-btn { border:none; background:transparent; font-family:inherit; font-size:12px;
           font-weight:600; color:var(--text-muted); padding:5px 12px; border-radius:6px;
           cursor:pointer; transition:background .15s, color .15s; }
.seg-btn.active { background:#fff; color:var(--accent); box-shadow:0 1px 2px rgba(0,0,0,.08); }

.seg-kpi { display:flex; gap:10px; padding:12px 20px 0; flex-wrap:wrap; }
.seg-kpi-card {
  flex:1 1 0; min-width:0; background:var(--page); border:1px solid var(--border);
  border-left:3px solid var(--accent); border-radius:10px; padding:10px 12px;
  display:flex; flex-direction:column; gap:2px;
}
.seg-kpi-card span { font-size:10px; font-weight:700; text-transform:uppercase;
                     letter-spacing:.06em; color:var(--text-dim); }
.seg-kpi-card b { font-size:19px; color:var(--text); }

.seg-card {
  display:flex; gap:20px; align-items:stretch; justify-content:space-between;
  text-decoration:none; color:inherit; background:var(--page);
  border:1px solid var(--border); border-left:5px solid var(--seg-borde, var(--border));
  border-radius:12px; padding:14px 18px; transition:box-shadow .15s, transform .15s;
}
.seg-card:hover { box-shadow:0 6px 18px rgba(28,26,22,.09); transform:translateY(-1px); }
/* El borde dice cuán reciente es la última vez que el usuario uso la aplicacion. El
   estado lo calcula el backend (`seguimiento._estado_conexion`), no el JS. */
.seg-card--conectado  { --seg-borde:#16a34a; }   /* haciendo algo ahora mismo */
.seg-card--activo_24h { --seg-borde:#86efac; }   /* entro en las ultimas 24 h */
.seg-card--activo_72h { --seg-borde:#f59e0b; }   /* entre 24 y 72 h */
.seg-card--inactivo   { --seg-borde:#d6d0c6; }   /* mas de 72 h, o nunca entro */

.seg-card-izq { flex:1; min-width:0; display:flex; flex-direction:column; gap:5px; }
/* Ancho FIJO: los renglones se alineaban a la derecha, asi que el ✓ se corria segun el
   numero tuviera 1, 2 o 3 digitos — medidos 10 iconos en 10 x distintas. Con la columna
   fija, el icono arranca en el mismo punto en todas las tarjetas. */
/* El bloque se alinea por su BORDE DERECHO, como el mockup: la coincidencia apilada
   arriba y los dos conteos abajo, y los tres textos terminan en el mismo eje. `flex-end`
   pega cada hijo a la derecha, asi que sus bordes derechos coinciden por construccion,
   midan lo que midan. Antes la etiqueta del conteo se estiraba (`1fr`) y el bloque
   terminaba ~100px antes que la coincidencia. */
.seg-card-der { flex-shrink:0; width:236px; display:flex; flex-direction:column;
                align-items:flex-end; justify-content:space-between; gap:8px; }
/* Los DOS conteos en una sola rejilla: asi sus iconos y sus numeros alinean entre si.
   Cada uno por su lado se dimensionaria a su etiqueta —"Aprobados" y "Rechazados" no
   miden lo mismo— y, pegados a la derecha, cada icono caeria en una x distinta.
   `auto` en la ultima columna (y no `1fr`): la etiqueta no se estira, asi el bloque mide
   lo que ocupa y su borde derecho es el de su texto mas ancho. */
.seg-conteos { display:grid; grid-template-columns:18px 4ch auto;
               align-items:center; gap:8px; }
.seg-conteo { display:contents; }
.seg-card-titulo { display:flex; align-items:center; gap:10px; }
.seg-nombre { font-size:17px; font-weight:700; color:var(--text); text-transform:uppercase;
              letter-spacing:.3px; }
/* Indicador todavia sin definir: se reserva el lugar del diseno sin afirmar un valor. */
.seg-ind { background:var(--surface); color:var(--text-muted); border:1px solid var(--border);
           font-size:12px; font-weight:700; padding:2px 12px; border-radius:20px; }
.seg-procesados { font-size:13px; color:var(--text-muted); }
.seg-procesados b { color:var(--accent); font-size:14px; }
.seg-conexion { font-size:11.5px; color:var(--text-muted); }
.seg-conexion b { color:var(--text-dim); }
.seg-sub { font-size:11px; color:var(--text-muted); font-family:'DM Mono', monospace; }
/* Solo el ROL se capitaliza: viene en minuscula de la base ('carga') y en la tarjeta se
   lee como nombre. El username va tal cual — deformarlo seria mostrar otro identificador. */
.seg-rol { text-transform:capitalize; }
.seg-metricas { display:flex; gap:16px; flex-wrap:wrap; margin-top:2px;
                font-size:11.5px; color:var(--text-muted); }
.seg-metricas b { color:var(--text); }

.seg-coinc { display:flex; flex-direction:column; align-items:flex-end; line-height:1.05;
             font-variant-numeric:tabular-nums; }
.seg-coinc-val { font-size:30px; font-weight:800; color:var(--accent); }
.seg-coinc-vacia { color:var(--text-muted); }
.seg-coinc span { font-size:13px; color:var(--text-dim); }
.seg-conteo b { font-size:19px; font-weight:700; color:var(--text);
                text-align:right; font-variant-numeric:tabular-nums; }
.seg-conteo span { font-size:10.5px; color:var(--text-dim); line-height:1.15; text-align:left; }
.seg-conteo-ic { font-style:normal; font-size:12px; font-weight:800; width:17px; height:17px;
                 border-radius:50%; display:inline-flex; align-items:center;
                 justify-content:center; color:#fff; flex-shrink:0; }
.seg-conteo-ic.ok { background:#22c55e; }
.seg-conteo-ic.no { background:#ef4444; }

/* La barra va a medir otra cosa; hasta entonces, vacia y gris. */
.seg-barra { height:6px; background:var(--surface); border:1px solid var(--border);
             border-radius:20px; margin:4px 0 2px; }

.seg-pill { display:inline-block; padding:2px 8px; border-radius:20px; font-size:10px;
            font-weight:700; }
.seg-pill-gris  { background:var(--surface); color:var(--text-dim); border:1px solid var(--border); }
.seg-pill-ambar { background:#fef3c7; color:#92400e; border:1px solid #fde68a; }

.seg-hero { display:flex; justify-content:space-between; align-items:flex-start; gap:16px;
            background:var(--page); border:1px solid var(--border); border-radius:12px;
            padding:14px 16px; }
.seg-datos { display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; }
.seg-dato { flex:1 1 150px; background:var(--page); border:1px solid var(--border);
            border-radius:10px; padding:9px 12px; display:flex; flex-direction:column; gap:2px; }
.seg-dato span { font-size:10px; font-weight:700; text-transform:uppercase;
                 letter-spacing:.06em; color:var(--text-dim); }
.seg-dato b { font-size:16px; color:var(--text); }

.seg-bloque { margin-top:18px; }
.seg-bloque h3 { font-size:12px; font-weight:700; text-transform:uppercase;
                 letter-spacing:.06em; color:var(--text-dim); margin:0 0 8px; }
.seg-motivos { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.seg-motivos li { background:var(--page); border:1px solid var(--border); border-radius:8px;
                  padding:7px 10px; font-size:12.5px; display:flex; justify-content:space-between;
                  gap:10px; }
.seg-veces { font-weight:700; color:var(--text-dim); }

.seg-evento { display:grid; grid-template-columns:150px 190px 1fr; gap:10px; padding:6px 10px;
              border-bottom:1px solid var(--border); font-size:12px; }
.seg-evento:hover { background:var(--surface); }
.seg-evento-fecha { color:var(--text-muted); font-family:'DM Mono', monospace; font-size:11px; }
.seg-evento-nombre { font-weight:600; color:var(--text); }
.seg-evento-ref { color:var(--text-muted); font-family:'DM Mono', monospace; font-size:11px;
                  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* La referencia enlaza al lote o al registro que se tocó. Se distingue del texto muerto
   —el de un lote ya borrado— por el color y el subrayado al pasar por encima. */
a.seg-evento-link { color:var(--accent); text-decoration:none; cursor:pointer; }
a.seg-evento-link:hover { text-decoration:underline; }

.seg-vacio { text-align:center; padding:50px 20px; color:var(--text-muted); font-size:13px; }
.seg-vacio-mini { color:var(--text-muted); font-size:12px; padding:6px 0; }
