/* ==========================================================================
   Registro de IA — hoja de estilos
   Diseño claro, moderno y sobrio. Sin dependencias externas.
   ========================================================================== */

:root{
  /* Superficies */
  --bg:            #f4f6fb;
  --surface:       #ffffff;
  --surface-2:     #fafbfe;
  --border:        #e6eaf3;
  --border-fuerte: #d5dcea;

  /* Texto */
  --txt:      #131a2b;
  --txt-2:    #55607a;
  --txt-3:    #8b93a7;

  /* Acento */
  --acc:      #4f56e8;
  --acc-2:    #6f75f0;
  --acc-soft: #eef0fe;

  /* Semánticos */
  --ok:       #157f4b;   --ok-soft:   #e8f7ee;
  --warn:     #b06a00;   --warn-soft: #fff4e2;
  --dang:     #c02626;   --dang-soft: #fdecec;
  --info:     #0a6fa8;   --info-soft: #e7f3fb;
  --neutro:   #5b6478;   --neutro-soft:#eef0f5;

  --r-s: 8px;
  --r:   12px;
  --r-l: 18px;

  --sh-1: 0 1px 2px rgba(19,26,43,.06), 0 1px 3px rgba(19,26,43,.04);
  --sh-2: 0 4px 16px rgba(19,26,43,.08);
  --sh-3: 0 18px 50px rgba(19,26,43,.18);

  --nav-w: 262px;
}

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

/* El atributo hidden debe ganar siempre a las reglas de display de abajo
   (si no, el modal y el toast aparecerían nada más cargar la página). */
[hidden]{ display:none !important; }

html,body{ height:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--txt);
  font-family:"Segoe UI Variable Text","Segoe UI",Inter,system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif;
  font-size:14.5px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}

h1,h2,h3,h4{ margin:0; font-weight:650; letter-spacing:-.011em; color:var(--txt); }
p{ margin:0; }
a{ color:var(--acc); text-decoration:none; }
a:hover{ text-decoration:underline; }
svg{ width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }

/* ===== Estructura ================================================= */
.app{ display:flex; min-height:100vh; }

.sidebar{
  width:var(--nav-w); flex:0 0 var(--nav-w);
  background:var(--surface);
  border-right:1px solid var(--border);
  display:flex; flex-direction:column;
  position:sticky; top:0; height:100vh; z-index:40;
}
.brand{ display:flex; gap:11px; align-items:center; padding:20px 18px 16px; }
.brand-mark{
  width:38px; height:38px; border-radius:11px; flex:none;
  background:linear-gradient(135deg,var(--acc),#8b74f5);
  color:#fff; display:grid; place-items:center;
  font-weight:750; font-size:14px; letter-spacing:.02em;
  box-shadow:0 4px 12px rgba(79,86,232,.32);
}
.brand-text{ display:flex; flex-direction:column; min-width:0; }
.brand-text strong{ font-size:14.5px; letter-spacing:-.01em; }
.brand-text span{ font-size:12px; color:var(--txt-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.nav{ flex:1; overflow-y:auto; padding:4px 12px 16px; }
.nav-grupo{ font-size:10.5px; font-weight:700; letter-spacing:.09em; text-transform:uppercase;
  color:var(--txt-3); padding:16px 10px 7px; }
.nav a{
  display:flex; align-items:center; gap:10px;
  padding:8.5px 10px; margin-bottom:2px; border-radius:var(--r-s);
  color:var(--txt-2); font-size:13.8px; font-weight:500; text-decoration:none;
  transition:background .13s, color .13s;
}
.nav a svg{ width:18px; height:18px; color:var(--txt-3); }
.nav a:hover{ background:var(--surface-2); color:var(--txt); text-decoration:none; }
.nav a:hover svg{ color:var(--txt-2); }
.nav a.activo{ background:var(--acc-soft); color:var(--acc); font-weight:600; }
.nav a.activo svg{ color:var(--acc); }
.nav .cont{ margin-left:auto; font-size:11.5px; color:var(--txt-3); font-variant-numeric:tabular-nums; }
.nav a.activo .cont{ color:var(--acc); }

.sidebar-foot{ border-top:1px solid var(--border); padding:12px 18px; font-size:11.5px; color:var(--txt-3); }
.origen{ margin-bottom:5px; display:flex; align-items:center; gap:6px; }
.origen .punto{ width:7px; height:7px; border-radius:50%; background:var(--ok); flex:none; }
.origen.local .punto{ background:var(--warn); }
.origen.err .punto{ background:var(--dang); }

.sidebar-backdrop{ display:none; }

.main{ flex:1; min-width:0; display:flex; flex-direction:column; }

.topbar{
  position:sticky; top:0; z-index:30;
  display:flex; align-items:center; gap:14px;
  padding:16px 30px; background:rgba(244,246,251,.86);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
}
.topbar-title{ min-width:0; }
.topbar-title h1{ font-size:20px; }
.topbar-title p{ font-size:12.8px; color:var(--txt-2); margin-top:1px; }
.topbar-actions{ margin-left:auto; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

.vista{ padding:24px 30px 60px; max-width:1420px; width:100%; }

/* ===== Botones ==================================================== */
.btn{
  display:inline-flex; align-items:center; gap:7px;
  padding:8px 14px; border-radius:9px; border:1px solid var(--border-fuerte);
  background:var(--surface); color:var(--txt); font:inherit; font-size:13.5px; font-weight:550;
  cursor:pointer; white-space:nowrap; transition:.14s;
  box-shadow:var(--sh-1);
}
.btn:hover{ background:var(--surface-2); border-color:#c3ccdf; }
.btn svg{ width:16px; height:16px; }
.btn-pri{ background:var(--acc); border-color:var(--acc); color:#fff; box-shadow:0 2px 8px rgba(79,86,232,.28); }
.btn-pri:hover{ background:var(--acc-2); border-color:var(--acc-2); }
.btn-dang{ color:var(--dang); border-color:#f2c9c9; background:#fff; }
.btn-dang:hover{ background:var(--dang-soft); }
.btn-ghost{ border-color:transparent; box-shadow:none; background:transparent; color:var(--txt-2); }
.btn-ghost:hover{ background:var(--surface-2); }
.btn-sm{ padding:5px 10px; font-size:12.5px; }
.icon-btn{
  display:grid; place-items:center; width:34px; height:34px; flex:none;
  border-radius:9px; border:1px solid transparent; background:transparent;
  color:var(--txt-2); cursor:pointer; transition:.14s;
}
.icon-btn:hover{ background:var(--surface-2); color:var(--txt); border-color:var(--border); }

/* ===== Tarjetas =================================================== */
.card{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-l); box-shadow:var(--sh-1);
}
.card-head{
  display:flex; align-items:center; gap:12px;
  padding:16px 20px; border-bottom:1px solid var(--border);
}
.card-head h2{ font-size:15.5px; }
.card-head p{ font-size:12.5px; color:var(--txt-2); }
.card-head .der{ margin-left:auto; display:flex; gap:8px; align-items:center; }
.card-body{ padding:18px 20px; }
.card-body.tight{ padding:0; }

.grid{ display:grid; gap:16px; }
.g-kpis{ grid-template-columns:repeat(auto-fit,minmax(168px,1fr)); }
.g-2{ grid-template-columns:repeat(auto-fit,minmax(330px,1fr)); }
.g-3{ grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); }
.mt{ margin-top:18px; }

/* KPI */
.kpi{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r-l);
  padding:16px 18px; box-shadow:var(--sh-1); position:relative; overflow:hidden;
}
.kpi .et{ font-size:12.2px; color:var(--txt-2); font-weight:550; display:flex; align-items:center; gap:7px; }
.kpi .et svg{ width:15px; height:15px; color:var(--txt-3); }
.kpi .val{ font-size:29px; font-weight:680; letter-spacing:-.02em; margin-top:6px; line-height:1.1; font-variant-numeric:tabular-nums; }
.kpi .sub{ font-size:12px; color:var(--txt-3); margin-top:2px; }
/* Modificadores prefijados: evitan colisionar con .aviso, .ok, .peligro
   de otros componentes, que impondrían su propio display a la tarjeta. */
.kpi.k-acento{ background:linear-gradient(180deg,#f6f7ff,#fff); border-color:#dfe2fb; }
.kpi.k-acento .val{ color:var(--acc); }
.kpi.k-peligro .val{ color:var(--dang); }
.kpi.k-ok .val{ color:var(--ok); }
.kpi.k-aviso .val{ color:var(--warn); }

/* ===== Etiquetas / badges ========================================= */
.badge{
  display:inline-flex; align-items:center; gap:5px;
  padding:3px 9px; border-radius:100px; font-size:11.8px; font-weight:600;
  background:var(--neutro-soft); color:var(--neutro); white-space:nowrap;
  border:1px solid transparent;
}
.badge::before{ content:""; width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.85; }
.badge.sin::before{ display:none; }
.b-ok{ background:var(--ok-soft); color:var(--ok); }
.b-warn{ background:var(--warn-soft); color:var(--warn); }
.b-dang{ background:var(--dang-soft); color:var(--dang); }
.b-info{ background:var(--info-soft); color:var(--info); }
.b-acc{ background:var(--acc-soft); color:var(--acc); }
.b-gris{ background:var(--neutro-soft); color:var(--neutro); }

.chip{
  display:inline-flex; align-items:center; gap:6px; padding:4px 10px;
  border-radius:100px; border:1px solid var(--border-fuerte); background:var(--surface);
  font-size:12.3px; color:var(--txt-2); cursor:pointer; transition:.13s;
}
.chip:hover{ border-color:#bcc5d9; }
.chip.on{ background:var(--acc-soft); border-color:#c9cdfa; color:var(--acc); font-weight:600; }

/* ===== Tablas ===================================================== */
.tabla-wrap{ overflow-x:auto; }
table.tabla{ width:100%; border-collapse:collapse; font-size:13.5px; }
table.tabla th{
  text-align:left; font-size:11.4px; font-weight:700; letter-spacing:.055em; text-transform:uppercase;
  color:var(--txt-3); padding:11px 16px; border-bottom:1px solid var(--border);
  background:var(--surface-2); white-space:nowrap; position:sticky; top:0;
}
table.tabla td{ padding:12px 16px; border-bottom:1px solid var(--border); vertical-align:middle; }
table.tabla tbody tr{ cursor:pointer; transition:background .12s; }
table.tabla tbody tr:hover{ background:var(--surface-2); }
table.tabla tbody tr:last-child td{ border-bottom:none; }
table.tabla .id{ font-family:ui-monospace,"Cascadia Mono",Consolas,monospace; font-size:12px; color:var(--txt-3); }
table.tabla .princ{ font-weight:600; color:var(--txt); }
table.tabla .sec{ font-size:12.2px; color:var(--txt-3); }
table.tabla td.acciones{ text-align:right; white-space:nowrap; }
td.acciones .icon-btn{ width:30px; height:30px; }
td.acciones svg{ width:16px; height:16px; }

.vacio{ padding:52px 20px; text-align:center; color:var(--txt-3); }
.vacio svg{ width:36px; height:36px; color:var(--border-fuerte); margin-bottom:10px; }
.vacio strong{ display:block; color:var(--txt-2); font-weight:600; margin-bottom:3px; }

/* ===== Barra de filtros =========================================== */
.filtros{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
.buscador{ position:relative; flex:1; min-width:200px; max-width:380px; }
.buscador svg{ position:absolute; left:11px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--txt-3); }
input[type=search]{
  width:100%; padding:8.5px 12px 8.5px 34px; border-radius:9px;
  border:1px solid var(--border-fuerte); background:var(--surface); font:inherit; font-size:13.5px; color:var(--txt);
  box-shadow:var(--sh-1);
}
select.filtro{
  padding:8px 30px 8px 12px; border-radius:9px; border:1px solid var(--border-fuerte);
  background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93a7' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center/16px;
  font:inherit; font-size:13.3px; color:var(--txt-2); appearance:none; cursor:pointer; box-shadow:var(--sh-1);
}
.contador{ font-size:12.5px; color:var(--txt-3); margin-left:auto; }

/* ===== Formularios ================================================ */
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px 16px; }
.campo{ display:flex; flex-direction:column; gap:5px; }
.campo.full{ grid-column:1 / -1; }
.campo label{ font-size:12.5px; font-weight:600; color:var(--txt-2); }
.campo .ayuda{ font-size:11.5px; color:var(--txt-3); line-height:1.45; }
.campo .req{ color:var(--dang); }
input[type=text],input[type=date],input[type=number],input[type=email],textarea,select.entrada{
  width:100%; padding:8.5px 11px; border-radius:9px; border:1px solid var(--border-fuerte);
  background:var(--surface); font:inherit; font-size:13.6px; color:var(--txt); transition:.14s;
}
select.entrada{ appearance:none; cursor:pointer;
  background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93a7' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center/16px;
  padding-right:32px;
}
textarea{ resize:vertical; min-height:78px; line-height:1.5; }
input:focus,textarea:focus,select:focus{ outline:none; border-color:var(--acc); box-shadow:0 0 0 3px rgba(79,86,232,.14); }
.check{ display:flex; align-items:center; gap:9px; padding:9px 11px; border:1px solid var(--border-fuerte);
  border-radius:9px; background:var(--surface-2); cursor:pointer; font-size:13.4px; }
.check input{ width:16px; height:16px; accent-color:var(--acc); cursor:pointer; }
.lista-check{
  border:1px solid var(--border-fuerte); border-radius:9px; padding:8px; max-height:210px; overflow-y:auto;
  display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:2px; background:var(--surface);
}
.lista-check label{ display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:7px;
  font-size:13px; font-weight:450; color:var(--txt); cursor:pointer; }
.lista-check label:hover{ background:var(--surface-2); }
.lista-check input{ accent-color:var(--acc); }
.seccion-form{ grid-column:1/-1; font-size:11.6px; font-weight:700; letter-spacing:.07em; text-transform:uppercase;
  color:var(--txt-3); padding-top:8px; border-top:1px solid var(--border); margin-top:4px; }
.seccion-form:first-child{ border-top:none; padding-top:0; margin-top:0; }

/* ===== Ficha de detalle =========================================== */
.detalle{ display:grid; grid-template-columns:1fr 1fr; gap:2px 22px; }
.detalle .dt{ grid-column:1/-1; font-size:11.6px; font-weight:700; letter-spacing:.07em; text-transform:uppercase;
  color:var(--txt-3); margin:16px 0 6px; padding-bottom:6px; border-bottom:1px solid var(--border); }
.detalle .dt:first-child{ margin-top:0; }
.detalle .df{ padding:7px 0; }
.detalle .df.full{ grid-column:1/-1; }
.detalle .df dt{ font-size:11.8px; color:var(--txt-3); font-weight:600; margin-bottom:2px; }
.detalle .df dd{ margin:0; font-size:13.6px; color:var(--txt); white-space:pre-wrap; }

/* ===== Barras de progreso ========================================= */
.barra{ height:8px; border-radius:100px; background:#edf0f7; overflow:hidden; }
.barra > i{ display:block; height:100%; border-radius:100px; background:var(--acc); transition:width .5s ease; }
.barra.ok > i{ background:var(--ok); }
.barra.warn > i{ background:#e6a23c; }
.barra.dang > i{ background:var(--dang); }

.dist{ display:flex; flex-direction:column; gap:13px; }
.dist-fila .top{ display:flex; justify-content:space-between; font-size:13px; margin-bottom:5px; }
.dist-fila .top b{ font-weight:650; font-variant-numeric:tabular-nums; }

/* ===== Avisos ===================================================== */
.avisos{ display:flex; flex-direction:column; }
.aviso{ display:flex; gap:12px; padding:13px 20px; border-bottom:1px solid var(--border); align-items:flex-start; }
.aviso:last-child{ border-bottom:none; }
.aviso .ico{ width:30px; height:30px; border-radius:9px; display:grid; place-items:center; flex:none; margin-top:1px; }
.aviso .ico svg{ width:16px; height:16px; }
.aviso.alta .ico{ background:var(--dang-soft); color:var(--dang); }
.aviso.media .ico{ background:var(--warn-soft); color:var(--warn); }
.aviso.baja .ico{ background:var(--info-soft); color:var(--info); }
.aviso .txt{ min-width:0; flex:1; }
.aviso .txt strong{ display:block; font-size:13.6px; font-weight:600; }
.aviso .txt span{ font-size:12.4px; color:var(--txt-2); }
.aviso .btn{ margin-left:auto; }

.nota{
  display:flex; gap:11px; padding:13px 16px; border-radius:var(--r);
  background:var(--info-soft); border:1px solid #cfe6f5; color:#0a4d75; font-size:13px; line-height:1.55;
}
.nota svg{ flex:none; width:18px; height:18px; margin-top:1px; }
.nota.warn{ background:var(--warn-soft); border-color:#f3dcb6; color:#7a4a02; }
.nota.dang{ background:var(--dang-soft); border-color:#f5cccc; color:#8f1d1d; }
.nota b{ font-weight:650; }

/* ===== Línea de tiempo ============================================ */
.timeline{ position:relative; padding-left:30px; }
.timeline::before{ content:""; position:absolute; left:9px; top:6px; bottom:6px; width:2px; background:var(--border); }
.hito{ position:relative; padding:0 0 24px; }
.hito:last-child{ padding-bottom:0; }
.hito::before{
  content:""; position:absolute; left:-26px; top:5px; width:12px; height:12px; border-radius:50%;
  background:#fff; border:2.5px solid var(--border-fuerte);
}
.hito.pasado::before{ background:var(--ok); border-color:var(--ok); }
.hito.proximo::before{ background:var(--acc); border-color:var(--acc); box-shadow:0 0 0 4px rgba(79,86,232,.16); }
.hito .fecha{ font-size:11.8px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--txt-3); }
.hito.proximo .fecha{ color:var(--acc); }
.hito h4{ font-size:14.5px; margin:2px 0 4px; }
.hito p{ font-size:13px; color:var(--txt-2); }
.hito .afecta{ font-size:12px; color:var(--txt-3); margin-top:4px; }

/* ===== Cumplimiento =============================================== */
.req{ display:flex; gap:14px; padding:14px 20px; border-bottom:1px solid var(--border); align-items:flex-start; }
.req:last-child{ border-bottom:none; }
.req .cuerpo{ flex:1; min-width:0; }
.req .cab{ display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.req .cab strong{ font-size:13.9px; font-weight:600; }
.req .ref{ font-family:ui-monospace,Consolas,monospace; font-size:11.4px; color:var(--txt-3); }
.req p{ font-size:12.9px; color:var(--txt-2); margin-top:4px; }
.req .meta{ font-size:11.9px; color:var(--txt-3); margin-top:6px; display:flex; gap:14px; flex-wrap:wrap; }
.req select{ flex:none; }

/* ===== Pantalla de acceso ========================================= */
.login{
  position:fixed; inset:0; z-index:150; display:grid; place-items:center; padding:24px;
  background:linear-gradient(140deg,#eef1fb 0%,#f6f7fc 45%,#e9ecfa 100%);
}
.login-caja{
  width:min(400px,100%); background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-l); box-shadow:var(--sh-3); padding:30px 28px;
  display:flex; flex-direction:column; gap:16px; animation:sube .25s cubic-bezier(.2,.7,.3,1);
}
.login-marca{ display:flex; gap:12px; align-items:center; margin-bottom:4px; }
.login-marca strong{ display:block; font-size:16px; letter-spacing:-.01em; }
.login-marca span{ font-size:12px; color:var(--txt-3); }
.login-caja .btn{ justify-content:center; padding:10px 14px; font-size:14.2px; }
.login-error{
  background:var(--dang-soft); border:1px solid #f3cbcb; color:var(--dang);
  border-radius:var(--r-s); padding:9px 12px; font-size:12.8px;
}
.login-pie{ font-size:11.8px; color:var(--txt-3); text-align:center; line-height:1.5; }

/* ===== Usuario y empresa en la barra lateral ====================== */
.selector-empresa{ padding:0 14px 10px; }
.selector-empresa label{
  display:block; font-size:10.5px; font-weight:700; letter-spacing:.09em;
  text-transform:uppercase; color:var(--txt-3); padding:0 4px 5px;
}
.selector-empresa select{ font-size:13px; padding:7px 30px 7px 10px; }
.usuario-caja{ display:flex; align-items:center; gap:9px; margin-bottom:10px; }
.usuario-caja .avatar{
  width:32px; height:32px; border-radius:50%; flex:none; display:grid; place-items:center;
  background:var(--acc-soft); color:var(--acc); font-weight:700; font-size:13px;
}
.usuario-datos{ min-width:0; flex:1; }
.usuario-datos strong{ display:block; font-size:13px; color:var(--txt); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.usuario-datos span{ font-size:11.3px; color:var(--txt-3); }
.usuario-caja .icon-btn{ width:28px; height:28px; }
.usuario-caja .icon-btn svg{ width:15px; height:15px; }

/* ===== Asistente de clasificación ================================= */
.asistente .paso{ display:flex; gap:11px; align-items:flex-start; margin:22px 0 10px; }
.asistente .paso:first-child{ margin-top:0; }
.asistente .num{
  width:25px; height:25px; border-radius:50%; flex:none; display:grid; place-items:center;
  background:var(--acc-soft); color:var(--acc); font-size:12px; font-weight:700;
}
.asistente .paso h4{ font-size:14.6px; }
.asistente .paso p{ font-size:12.5px; color:var(--txt-2); margin-top:2px; }
.asistente .area{ font-size:11.8px; font-weight:700; letter-spacing:.05em; text-transform:uppercase;
  color:var(--txt-3); margin:12px 0 5px; }
.asistente .ops{ display:flex; flex-direction:column; gap:2px; }
.asistente .op{ display:flex; gap:10px; align-items:flex-start; padding:7px 10px; border-radius:8px;
  font-size:13.3px; cursor:pointer; line-height:1.45; }
.asistente .op:hover{ background:var(--surface-2); }
.asistente .op input{ margin-top:2px; accent-color:var(--acc); flex:none; width:16px; height:16px; }
.asistente .op em{ font-style:normal; color:var(--txt-3); font-size:11.8px; white-space:nowrap; }

.resultado{ margin-top:22px; padding:16px 18px; border-radius:var(--r); border:1px solid var(--border-fuerte); background:var(--surface-2); }
.resultado .cab{ display:flex; gap:10px; align-items:baseline; flex-wrap:wrap; }
.resultado .cab b{ font-size:13.8px; font-weight:600; flex:1; min-width:200px; }
.resultado .just{ font-size:12.8px; color:var(--txt-2); margin-top:10px; line-height:1.6; }
.resultado .obl{ margin-top:12px; padding-top:12px; border-top:1px solid var(--border); }
.resultado .obl strong{ font-size:12px; text-transform:uppercase; letter-spacing:.05em; color:var(--txt-3); }
.resultado .obl ul{ margin:7px 0 0; padding-left:18px; font-size:12.8px; color:var(--txt-2); line-height:1.6; }
.resultado.b-dang{ background:var(--dang-soft); border-color:#f3cbcb; }
.resultado.b-warn{ background:var(--warn-soft); border-color:#f2dcb8; }
.resultado.b-info{ background:var(--info-soft); border-color:#cee5f3; }
.resultado.b-ok{   background:var(--ok-soft);   border-color:#c9e9d5; }

/* ===== Histórico ================================================== */
.hist{ display:flex; gap:14px; padding:13px 20px; border-bottom:1px solid var(--border); }
.hist:last-child{ border-bottom:none; }
.hist .hora{ font-size:12px; color:var(--txt-3); font-variant-numeric:tabular-nums; padding-top:3px; flex:none; width:40px; }
.hist .cuerpo{ flex:1; min-width:0; }
.hist .cab{ display:flex; gap:9px; align-items:center; flex-wrap:wrap; }
.hist .cab strong{ font-size:13.7px; font-weight:600; }
.hist .ref{ font-family:ui-monospace,Consolas,monospace; font-size:11.3px; color:var(--txt-3); }
.hist .meta{ font-size:11.8px; color:var(--txt-3); margin-top:6px; }
.cambios{ margin-top:8px; display:flex; flex-direction:column; gap:4px; }
.cambio{ display:flex; gap:8px; align-items:baseline; flex-wrap:wrap; font-size:12.4px;
  background:var(--surface-2); border:1px solid var(--border); border-radius:8px; padding:6px 10px; }
.cambio .campo{ font-weight:600; color:var(--txt-2); }
.cambio .antes{ color:var(--dang); text-decoration:line-through; opacity:.8; }
.cambio .despues{ color:var(--ok); font-weight:550; }
.cambio .flecha{ color:var(--txt-3); }
.hist-mini{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; padding:7px 0; border-bottom:1px solid var(--border); }
.hist-mini:last-child{ border-bottom:none; }

/* Cuestionarios en el informe */
pre.cuest-txt{
  margin:10px 0 0; padding:12px 14px; border-radius:var(--r-s);
  background:var(--surface-2); border:1px solid var(--border);
  font-family:inherit; font-size:12.5px; color:var(--txt-2); white-space:pre-wrap; line-height:1.55;
}

/* ===== Modal ====================================================== */
.modal-backdrop{
  position:fixed; inset:0; z-index:100; background:rgba(19,26,43,.42);
  backdrop-filter:blur(3px); display:flex; align-items:flex-start; justify-content:center;
  padding:40px 18px; overflow-y:auto;
}
.modal{
  width:min(880px,100%); background:var(--surface); border-radius:var(--r-l);
  box-shadow:var(--sh-3); display:flex; flex-direction:column; animation:sube .22s cubic-bezier(.2,.7,.3,1);
}
@keyframes sube{ from{ opacity:0; transform:translateY(14px) scale(.99); } }
.modal-head{ display:flex; align-items:center; gap:12px; padding:18px 22px; border-bottom:1px solid var(--border); }
.modal-head h2{ font-size:17px; flex:1; }
.modal-body{ padding:20px 22px; }
.modal-foot{ display:flex; gap:9px; justify-content:flex-end; padding:14px 22px;
  border-top:1px solid var(--border); background:var(--surface-2); border-radius:0 0 var(--r-l) var(--r-l); }
.modal-foot .izq{ margin-right:auto; }

/* ===== Toast ====================================================== */
.toast{
  position:fixed; bottom:26px; left:50%; transform:translateX(-50%);
  background:#131a2b; color:#fff; padding:11px 20px; border-radius:100px;
  font-size:13.4px; box-shadow:var(--sh-3); z-index:200; animation:sube .2s;
}

/* ===== Utilidades ================================================= */
.mut{ color:var(--txt-2); }
.mut-3{ color:var(--txt-3); }
.sm{ font-size:12.5px; }
.mono{ font-family:ui-monospace,Consolas,monospace; }
.fila{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.only-mobile{ display:none !important; }
.nowrap{ white-space:nowrap; }

/* ===== Responsive ================================================= */
@media (max-width:960px){
  .sidebar{ position:fixed; left:0; top:0; transform:translateX(-100%); transition:transform .24s ease; box-shadow:var(--sh-3); }
  body.nav-abierta .sidebar{ transform:none; }
  body.nav-abierta .sidebar-backdrop{ display:block; position:fixed; inset:0; background:rgba(19,26,43,.35); z-index:39; }
  .only-mobile{ display:grid !important; }
  .topbar{ padding:12px 16px; }
  .vista{ padding:18px 16px 50px; }
  .form-grid,.detalle{ grid-template-columns:1fr; }
}

/* ===== Impresión ================================================== */
@media print{
  .sidebar,.topbar-actions,.filtros,.icon-btn,td.acciones,.btn{ display:none !important; }
  body{ background:#fff; }
  .vista{ padding:0; }
  .card{ box-shadow:none; break-inside:avoid; }
  .topbar{ position:static; border:none; padding:0 0 16px; }
}
