/* ===== Auditoría de audios — sistema visual ===== */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f4f8;
  --border: #e3e8ef;
  --border-strong: #cdd5df;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;

  --primary: #2952cc;
  --primary-hover: #2145b0;
  --primary-soft: #edf2fe;
  --primary-text: #1e40af;
  --danger: #d1281f;
  --danger-hover: #b42018;
  --danger-soft: #fdf0ef;
  --danger-text: #a3201a;
  --success: #0b8a4e;
  --success-soft: #eaf7f0;
  --success-text: #0a6b3e;
  --warning: #c26a06;
  --warning-soft: #fdf5e7;
  --warning-text: #8f4e05;
  --info-soft: #eef6fd;
  --info-text: #175c95;

  --sidebar: #0d1526;
  --sidebar-2: #17223a;
  --sidebar-text: #a9b4c7;
  --sidebar-strong: #ffffff;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .07), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, .28);
  --focus: 0 0 0 3px rgba(41, 82, 204, .28);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #121a2c;
    --surface-2: #162036;
    --surface-3: #1b2640;
    --border: #243049;
    --border-strong: #33415e;
    --text: #e6ebf4;
    --text-2: #b3bdd0;
    --muted: #8692a9;
    --primary: #5b80f0;
    --primary-hover: #7493f3;
    --primary-soft: #1a2647;
    --primary-text: #a9bdfa;
    --danger: #ef5a50;
    --danger-hover: #f37268;
    --danger-soft: #3a1717;
    --danger-text: #f9a39c;
    --success: #2fbf7a;
    --success-soft: #0f2e22;
    --success-text: #7fdcae;
    --warning: #e99a34;
    --warning-soft: #33240e;
    --warning-text: #f3c27f;
    --info-soft: #11263d;
    --info-text: #8cc4f2;
    --sidebar: #080d18;
    --sidebar-2: #131c30;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4);
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .6);
    --focus: 0 0 0 3px rgba(91, 128, 240, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
body.con-modal { overflow: hidden; }
a { color: var(--primary); }
code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
[hidden] { display: none !important; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: none; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30;
}
.marca { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: var(--sidebar-strong); }
.marca .logo {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, #3b6cf0, #2952cc); color: #fff;
}
.marca b { font-size: 14.5px; font-weight: 650; line-height: 1.2; }
.marca small { display: block; font-size: 11.5px; color: var(--sidebar-text); font-weight: 400; }
.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav .grupo { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6b7891; padding: 14px 10px 6px; }
.nav button {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; font: inherit; font-size: 13.5px;
  color: var(--sidebar-text); background: none; border: 0; padding: 8px 10px; border-radius: 7px; cursor: pointer;
}
.nav button:hover { background: var(--sidebar-2); color: var(--sidebar-strong); }
.nav button.activo { background: var(--sidebar-2); color: var(--sidebar-strong); box-shadow: inset 2px 0 0 #5b80f0; }
.nav button:focus-visible { outline: none; box-shadow: var(--focus); }
.cuenta { border-top: 1px solid #1c2740; padding: 12px; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: #26345a; color: #dbe4ff; font-weight: 600; font-size: 12.5px;
}
.cuenta .quien { flex: 1; min-width: 0; line-height: 1.25; }
.cuenta .quien b { display: block; color: var(--sidebar-strong); font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cuenta .quien small { font-size: 11.5px; }
.cuenta .icon-btn { color: var(--sidebar-text); }
.cuenta .icon-btn:hover { background: var(--sidebar-2); color: #fff; }

.contenido { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 12px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 18px; font-weight: 650; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .der { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.selector-proyecto { display: flex; align-items: center; gap: 8px; }
.selector-proyecto label { margin: 0; font-size: 12.5px; color: var(--muted); }
.selector-proyecto select { min-width: 220px; width: auto; font-weight: 500; }
.icon-btn.btn-menu { display: none; }
#detalle { scroll-margin-top: 84px; }
main { padding: 24px 28px 48px; max-width: 1400px; width: 100%; }

/* ---------- Tarjetas y grillas ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); min-width: 0; }
.card.wide, .wide { grid-column: 1 / -1; }
.card-cab { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-cab h3 { font-size: 15px; font-weight: 600; }
.card-cab .acciones { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card h3 small, h3 small { font-weight: 400; }
.card > h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.desc { color: var(--muted); font-size: 13px; margin: -8px 0 14px; }
.grafico { position: relative; height: 280px; }
.grafico.bajo { height: 220px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow-sm); }
.kpi .et { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .val { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi small { display: block; color: var(--muted); font-size: 12px; }
.kpi.alerta { border-color: var(--warning); background: var(--warning-soft); }

/* ---------- Formularios ---------- */
label { display: block; font-size: 12.5px; font-weight: 500; margin: 12px 0 5px; color: var(--text-2); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); width: 100%;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 11px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-3); color: var(--muted); cursor: not-allowed; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; padding: 0; accent-color: var(--primary); vertical-align: middle; }
input[type=file] { padding: 6px; background: var(--surface-2); }
.ayuda { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.fila { display: flex; gap: 14px; flex-wrap: wrap; }
.fila > div { flex: 1; min-width: 180px; }
.check { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; color: var(--text); font-size: 13.5px; font-weight: 400; cursor: pointer; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-size: 13.5px; font-weight: 550;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  background: var(--primary); color: #fff; transition: background .15s, border-color .15s, box-shadow .15s; line-height: 1.3;
}
.btn:hover { background: var(--primary-hover); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sec { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn.sec:hover { background: var(--surface-3); }
.btn.peligro { background: var(--danger); }
.btn.peligro:hover { background: var(--danger-hover); }
.btn.peligro-sec { background: var(--surface); color: var(--danger-text); border-color: var(--border-strong); }
.btn.peligro-sec:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.fantasma { background: none; color: var(--text-2); }
.btn.fantasma:hover { background: var(--surface-3); color: var(--text); }
.btn.chico { padding: 5px 10px; font-size: 12.5px; }
.btn .ico { width: 16px; height: 16px; }
.btn.cargando { position: relative; color: transparent !important; pointer-events: none; }
.btn.cargando::after {
  content: ''; position: absolute; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid currentColor; border-color: #fff #fff transparent transparent; animation: girar .7s linear infinite;
}
.btn.sec.cargando::after, .btn.fantasma.cargando::after, .btn.peligro-sec.cargando::after { border-color: var(--text-2) var(--text-2) transparent transparent; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; border: 0;
  background: none; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.barra { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.barra select, .barra input { width: auto; min-width: 190px; }
.barra .sep { flex: 1; }
.acciones-fila { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Tablas ---------- */
.tabla-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.card .tabla-wrap { border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em;
  background: var(--surface-2); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--surface-2); }
tbody tr.sel td { background: var(--primary-soft) !important; }
td.n, th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.chk, th.chk { width: 36px; }
td.acc { white-space: nowrap; text-align: right; }
td.acc .btn { margin-left: 4px; }
table input.pr { width: 92px; padding: 5px 7px; text-align: right; }
.mapa td { text-align: center; font-size: 12.5px; font-weight: 550; font-variant-numeric: tabular-nums; }
.mapa th { text-transform: none; letter-spacing: 0; font-size: 12px; }

/* ---------- Panel: período, tendencias y ranking ---------- */
.barra-periodo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.barra-periodo .sep { flex: 1; }
.segmentos { display: inline-flex; background: var(--surface-3); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; }
.segmentos button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 550; color: var(--text-2); padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.segmentos button:hover { color: var(--text); }
.segmentos button.activo { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmentos button:focus-visible { outline: none; box-shadow: var(--focus); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 12px; }
.delta.bien { color: var(--success-text); } .delta.mal { color: var(--danger-text); } .delta.igual { color: var(--muted); }
.ranking { display: flex; flex-direction: column; }
.rk-fila {
  display: grid; grid-template-columns: 34px minmax(160px, 1.3fr) minmax(160px, 2fr) 90px 90px minmax(170px, 1.4fr);
  gap: 14px; align-items: center; padding: 11px 10px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 8px;
}
.rk-fila:last-child { border-bottom: 0; }
.rk-fila:hover { background: var(--surface-2); }
.rk-fila:focus-visible { outline: none; box-shadow: inset var(--focus); }
.rk-pos { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 12.5px; background: var(--surface-3); color: var(--text-2); }
.rk-fila:nth-child(1) .rk-pos { background: #f6d77a; color: #6b4a00; }
.rk-fila:nth-child(2) .rk-pos { background: #dfe3ea; color: #3c4658; }
.rk-fila:nth-child(3) .rk-pos { background: #f0c5a0; color: #6b3610; }
.rk-nombre b { display: block; font-weight: 600; } .rk-nombre small, .rk-dato small, .rk-debil small { color: var(--muted); font-size: 12px; }
.rk-barra .barra-mini { width: 100%; } .rk-barra .pista { height: 8px; border-radius: 4px; }
.rk-dato { text-align: right; font-variant-numeric: tabular-nums; } .rk-dato b { display: block; font-weight: 650; }
.rk-debil span { display: block; font-size: 13px; color: var(--danger-text); font-weight: 500; }
.rk-cab { display: grid; grid-template-columns: 34px minmax(160px, 1.3fr) minmax(160px, 2fr) 90px 90px minmax(170px, 1.4fr); gap: 14px; padding: 0 10px 6px;
  font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border); }
.rk-cab span:nth-child(4), .rk-cab span:nth-child(5) { text-align: right; }
@media (max-width: 960px) {
  .rk-cab { display: none; }
  .rk-fila { grid-template-columns: 30px 1fr 70px; gap: 6px 12px; }
  .rk-barra { grid-column: 2 / -1; } .rk-dato:nth-of-type(5) { display: none; }
  .rk-debil { grid-column: 2 / -1; }
}

/* ---------- Ayuda de criterios ---------- */
.ayuda-criterios { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); margin-bottom: 12px; }
.ayuda-criterios summary { cursor: pointer; padding: 10px 14px; font-weight: 550; display: flex; align-items: center; gap: 8px; list-style: none; color: var(--primary-text); }
.ayuda-criterios summary::-webkit-details-marker { display: none; }
.ayuda-criterios summary::after { content: '▾'; margin-left: auto; color: var(--muted); transition: transform .15s; }
.ayuda-criterios[open] summary::after { transform: rotate(180deg); }
.ayuda-criterios summary .ico { width: 16px; height: 16px; }
#ayudaCriteriosCuerpo { padding: 2px 16px 14px; color: var(--text-2); font-size: 13.5px; }
.tipos-criterio { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.tipo-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.tipo-card p { margin: 6px 0 0; font-size: 13px; }
.formula { font-family: var(--mono); font-size: 12.5px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; margin: 6px 0 10px; color: var(--text); }
.ejemplo { background: var(--surface); border-left: 3px solid var(--primary); padding: 8px 12px; border-radius: 0 6px 6px 0; margin: 8px 0; font-size: 13px; }
.incidencia { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.incidencia .pista { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.incidencia .pista i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.incidencia b { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 42px; text-align: right; }

/* ---------- Notificaciones ---------- */
.campana { position: relative; }
.campana .contador {
  position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; line-height: 1;
  box-shadow: 0 0 0 2px var(--bg);
}
.panel-notif {
  position: absolute; z-index: 150; width: min(400px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 90px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); animation: subir .12s ease-out;
}
.panel-notif .cab { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.panel-notif .cab b { flex: 1; font-size: 14px; }
.panel-notif .lista { overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; width: 100%; text-align: left;
  background: none; border-left: 0; border-right: 0; border-top: 0; font: inherit; color: inherit; }
.notif:hover, .notif:focus-visible { background: var(--surface-2); outline: none; }
.notif .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.notif .ic.lote { background: var(--success-soft); color: var(--success); }
.notif .ic .ico { width: 15px; height: 15px; }
.notif .cuerpo { flex: 1; min-width: 0; }
.notif .cuerpo b { display: block; font-size: 13.5px; font-weight: 600; }
.notif .cuerpo p { margin: 2px 0 3px; font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.notif .cuerpo small { color: var(--muted); font-size: 11.5px; }
.notif.no-leida { background: var(--primary-soft); }
.notif.no-leida:hover { background: color-mix(in srgb, var(--primary-soft) 70%, var(--surface-2)); }
.notif .punto-nuevo { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; margin-top: 6px; }
.sugerencia-box { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); margin: 14px 0 4px;
  background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); color: var(--text); }
.sugerencia-box .ico { color: var(--primary); margin-top: 2px; }
.sugerencia-box .txt { flex: 1; } .sugerencia-box .txt small { color: var(--text-2); }
.sugerencia-box .acc { display: flex; gap: 8px; flex-wrap: wrap; }
textarea.cuestionario-edit { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }

/* ---------- Tabla de datos ---------- */
.tabla-barra { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.tabla-barra select { width: auto; min-width: 160px; }
.tabla-barra .sep, .tabla-pie .sep { flex: 1; }
.tabla-acciones { display: contents; }
.buscador { position: relative; flex: 0 1 280px; min-width: 200px; }
.buscador .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.buscador input { padding-left: 34px; }
th.ordenable { cursor: pointer; user-select: none; }
th.ordenable:hover, th.ordenada { color: var(--text); }
th.ordenable:focus-visible { outline: none; box-shadow: inset var(--focus); }
th .flecha { margin-left: 5px; font-size: 10px; opacity: .45; }
th.ordenada .flecha { opacity: 1; color: var(--primary); }
th.n.ordenable .flecha { margin-left: 4px; }
tbody tr.marcada td { background: var(--primary-soft); }
tbody tr.click:focus-visible { outline: none; box-shadow: inset 3px 0 0 var(--primary); }
.tabla-pie { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 2px 0; color: var(--muted); font-size: 12.5px; }
.tabla-pie .por-pagina { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; color: var(--muted); }
.tabla-pie .por-pagina select { width: auto; padding: 4px 8px; font-size: 12.5px; }
.paginas { display: flex; gap: 2px; align-items: center; }
.paginas .icon-btn { width: 30px; height: 30px; font-size: 13px; font-weight: 550; }
.paginas .icon-btn.actual { background: var(--primary); color: #fff; }
.paginas .icon-btn:disabled { opacity: .35; cursor: default; background: none; }
.menu-flotante {
  position: absolute; z-index: 150; min-width: 220px; padding: 5px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: subir .12s ease-out;
}
.menu-flotante button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 6px;
  font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left;
}
.menu-flotante button:hover, .menu-flotante button:focus-visible { background: var(--surface-3); outline: none; }
.menu-flotante button .ico { width: 16px; height: 16px; color: var(--muted); }
.menu-flotante button.peligro { color: var(--danger-text); }
.barra-mini { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; }
.barra-mini .pista { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; min-width: 50px; }
.barra-mini .pista i { display: block; height: 100%; border-radius: 3px; }

/* ---------- Insignias ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 550; white-space: nowrap; background: var(--surface-3); color: var(--text-2); line-height: 1.6;
}
.badge.punto::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok, .badge.listo, .badge.textual, .badge.activo { background: var(--success-soft); color: var(--success-text); }
.badge.mal, .badge.error, .badge.omitida { background: var(--danger-soft); color: var(--danger-text); }
.badge.adv, .badge.reformulada { background: var(--warning-soft); color: var(--warning-text); }
.badge.info, .badge.procesando { background: var(--info-soft); color: var(--info-text); }
.badge.procesando::before { animation: latir 1.2s ease-in-out infinite; }
.badge.prim { background: var(--primary-soft); color: var(--primary-text); }
@keyframes latir { 50% { opacity: .25; } }
.cumple { color: var(--success-text); font-weight: 600; }
.parcial { color: var(--warning-text); font-weight: 600; }
.no_cumple { color: var(--danger-text); font-weight: 600; }
.positivo { color: var(--success-text); } .negativo { color: var(--danger-text); } .neutro { color: var(--muted); } .mixto { color: var(--warning-text); }
.puntaje { font-weight: 650; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
small.muted { font-size: 12px; }

/* ---------- Avisos dentro de la página ---------- */
.nota { display: flex; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px; margin: 12px 0; background: var(--info-soft); color: var(--info-text); }
.nota.adv { background: var(--warning-soft); color: var(--warning-text); }
.nota.mal { background: var(--danger-soft); color: var(--danger-text); }
.nota.ok { background: var(--success-soft); color: var(--success-text); }
.nota .ico { margin-top: 1px; }
.banner-modo {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--warning-soft); color: var(--warning-text); font: inherit; font-size: 12.5px; font-weight: 550;
}
.vacio { text-align: center; padding: 36px 16px; color: var(--muted); }
.vacio .ico { width: 34px; height: 34px; stroke-width: 1.5; margin-bottom: 8px; opacity: .7; }
.vacio b { display: block; color: var(--text-2); font-size: 14.5px; margin-bottom: 2px; }
.esqueleto { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: brillo 1.2s infinite; }
@keyframes brillo { to { background-position: -200% 0; } }

/* ---------- Detalle de audio ---------- */
.detalle-cab { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.detalle-cab h2 { font-size: 17px; font-weight: 650; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-2); font-size: 13px; margin: 8px 0 14px; }
.meta span b { color: var(--text); font-weight: 550; }
.resultado { display: flex; align-items: center; gap: 18px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); margin: 16px 0; flex-wrap: wrap; }
.resultado .nota-grande { font-size: 34px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.resultado .nota-grande small { font-size: 15px; color: var(--muted); font-weight: 500; }
.resultado p { margin: 0; flex: 1; min-width: 240px; color: var(--text-2); }
.seccion-t { font-size: 14.5px; font-weight: 600; margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.costo { background: var(--info-soft); color: var(--info-text); border-radius: var(--radius-sm); padding: 10px 14px; margin: 12px 0; font-size: 13.5px; }
.costo small { color: inherit; opacity: .85; }
pre.transcripcion { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); padding: 14px; border-radius: var(--radius-sm); max-height: 380px; overflow: auto; font-size: 13px; line-height: 1.6; margin: 0; }
.hab { font-weight: 650; } .hab-a { color: var(--primary-text); } .hab-b { color: var(--success-text); } .hab-c { color: #8b5cf6; }
.cobertura { font-size: 24px; font-weight: 700; margin-right: 10px; font-variant-numeric: tabular-nums; }
audio { width: 100%; height: 40px; }

/* ---------- Modales ---------- */
.modal-capa {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 13, 25, .55); backdrop-filter: blur(2px); animation: aparecer .15s ease-out;
}
.modal {
  width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface);
  border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: subir .18s ease-out;
}
.modal-cab { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 0; }
.modal-cab .ico-modal { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.modal-cab .ico-modal.peligro { background: var(--danger-soft); color: var(--danger); }
.modal-cab h2 { font-size: 16px; font-weight: 650; padding-top: 7px; flex: 1; }
.modal-cuerpo { padding: 12px 20px 4px; overflow-y: auto; color: var(--text-2); }
.modal-cuerpo p { margin: 0 0 10px; }
.modal-cuerpo label:first-child { margin-top: 4px; }
.modal-pie { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 18px; flex-wrap: wrap; }
.modal-capa.saliendo { animation: desaparecer .15s ease-in forwards; }
.modal-capa.saliendo .modal { animation: bajar .15s ease-in forwards; }
.lista-detalle { margin: 6px 0 12px; padding-left: 18px; }
.lista-detalle li { margin: 2px 0; }
.confirmar-texto { font-family: var(--mono); font-weight: 600; color: var(--text); background: var(--surface-3); padding: 1px 6px; border-radius: 4px; }
.secreto { display: flex; gap: 8px; align-items: center; }
.secreto code { flex: 1; font-size: 15px; padding: 9px 12px; user-select: all; }
@keyframes aparecer { from { opacity: 0; } }
@keyframes desaparecer { to { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes bajar { to { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ---------- Avisos (toasts) ---------- */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 13.5px; animation: entrar .2s ease-out;
  border-left: 4px solid var(--primary);
}
.toast.exito { border-left-color: var(--success); } .toast.exito .ico { color: var(--success); }
.toast.error { border-left-color: var(--danger); } .toast.error .ico { color: var(--danger); }
.toast.info .ico { color: var(--primary); }
.toast .txt { flex: 1; color: var(--text); }
.toast .icon-btn { width: 24px; height: 24px; margin: -2px -4px 0 0; }
.toast .icon-btn .ico { width: 15px; height: 15px; color: var(--muted); }
.toast.saliendo { animation: salir .2s ease-in forwards; }
@keyframes entrar { from { opacity: 0; transform: translateX(16px); } }
@keyframes salir { to { opacity: 0; transform: translateX(16px); } }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background:
  radial-gradient(1200px 600px at 10% -10%, rgba(59, 108, 240, .18), transparent 60%),
  radial-gradient(900px 500px at 110% 110%, rgba(59, 108, 240, .12), transparent 60%), var(--bg); }
.login .card { width: 100%; max-width: 380px; padding: 28px; box-shadow: var(--shadow-lg); }
.login .marca { padding: 0 0 18px; color: var(--text); }
.login .marca small { color: var(--muted); }
.login h2 { font-size: 20px; font-weight: 650; }
.login .btn { width: 100%; margin-top: 18px; padding: 10px; }
.login .pie { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

/* ---------- Solo lectura / permisos ---------- */
body:not(.es-admin) .solo-admin { display: none !important; }
body.solo-lectura .req-edicion { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.menu-abierto .sidebar { transform: none; }
  body.menu-abierto::after { content: ''; position: fixed; inset: 0; background: rgba(8, 13, 25, .45); z-index: 25; }
  .icon-btn.btn-menu { display: inline-grid; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .topbar .der { width: 100%; margin-left: 0; }
  .selector-proyecto { flex: 1; } .selector-proyecto select { min-width: 0; flex: 1; }
  main { padding: 16px 16px 40px; }
  .grid { grid-template-columns: 1fr; }
  .barra select, .barra input { min-width: 0; flex: 1 1 160px; }
  .tabla-barra select, .buscador { min-width: 0; flex: 1 1 160px; }
}
