/* Portal de correcciones de KAI. Misma identidad que la webapp (Inter, #0047ab, píldoras). Diseño: claude.ai/artifact/TqSSKT3zXdPWNxWg7yrtnr */
:root {
  --ocean-blue: #0047ab; --ocean-blue-dark: #003b8e; --ocean-navy: #181858; --ocean-link: #1c6dbf;
  --bg: #f5f7fb; --surface: #fff; --border: #e3e7ee; --chip-border: #d7e2f6; --text: #262626; --title: #0a0a0a; --muted: #5a6472; --tint: #eaf0fb;
  --font: "Inter", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
a { color: var(--ocean-link); } a:hover { color: var(--ocean-blue); }
.env { background: #b45309; color: #fff; text-align: center; font-size: 12px; font-weight: 600; letter-spacing: .02em; padding: 6px 12px; }

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 0 32px; min-height: 68px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 14px; }
.logo { height: 34px; width: auto; display: block; }
.badge { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ocean-blue); background: var(--tint); padding: 4px 10px; border-radius: 25px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.btn-back { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; line-height: 16px; padding: 10px 16px; border-radius: 25px; border: 1px solid var(--ocean-blue); color: var(--ocean-blue); text-decoration: none; }
.btn-back:hover { background: var(--ocean-blue); color: #fff; }
.user { font-size: 14px; padding-left: 10px; border-left: 1px solid var(--border); }
.user:empty { display: none; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 24px 48px; display: flex; flex-direction: column; gap: 24px; }
.intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
h1 { margin: 0 0 4px; font-size: 26px; line-height: 1.25; font-weight: 600; color: var(--title); }
.muted { margin: 0; color: var(--muted); }
.link { background: none; border: 0; padding: 0; font-family: inherit; font-size: 14px; color: var(--ocean-link); text-decoration: underline; cursor: pointer; }
.aviso { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px; color: var(--muted); }
.aviso.error { border-color: #f5c2c0; background: #fdecea; color: #b3261e; }
#portal { display: flex; flex-direction: column; gap: 24px; }

.resumen { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.dep-card { text-align: left; font-family: inherit; cursor: pointer; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 19px 21px; display: flex; flex-direction: column; gap: 14px; color: var(--text); }
.dep-card:hover { border-color: var(--ocean-blue); }
.dep-card.activa { border: 2px solid var(--ocean-blue); padding: 18px 20px; }
.dep-nombre { font-size: 16px; font-weight: 600; color: var(--title); }
.cifras { display: flex; gap: 18px; }
.cifra { display: flex; flex-direction: column; }
.cifra b { font-size: 24px; font-weight: 600; line-height: 1.2; }
.cifra span { font-size: 12px; color: var(--muted); }
.c-pend { color: #92400e; } .c-apr { color: #15803d; } .c-cer { color: var(--muted); }

.filtros { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.filtros label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); flex: 1 1 180px; }
.filtros label.ancho { flex: 2 1 260px; }
.filtros select, .filtros input { font-family: inherit; font-size: 14px; font-weight: 400; color: var(--text); padding: 10px 12px; border: 1px solid var(--chip-border); border-radius: 10px; background: var(--surface); min-height: 44px; }
.filtros select:focus, .filtros input:focus { outline: none; border-color: var(--ocean-blue); box-shadow: 0 0 0 3px rgba(0, 71, 171, .12); }
.estados { display: flex; flex-wrap: wrap; gap: 8px; flex-basis: 100%; }
.estado-btn { font-family: inherit; font-size: 14px; font-weight: 500; padding: 9px 16px; min-height: 40px; border-radius: 25px; border: 1px solid var(--chip-border); background: var(--surface); color: var(--ocean-blue); cursor: pointer; }
.estado-btn:hover { border-color: var(--ocean-blue); }
.estado-btn.activo { background: var(--ocean-blue); border-color: var(--ocean-blue); color: #fff; }

.lista { display: flex; flex-direction: column; gap: 16px; }
.vacio { background: var(--surface); border: 1px dashed var(--chip-border); border-radius: 16px; padding: 28px; text-align: center; color: var(--muted); }
.tarjeta { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip { font-size: 13px; font-weight: 500; padding: 3px 12px; border-radius: 25px; }
.chip-dep { color: var(--ocean-blue); background: var(--tint); border: 1px solid var(--chip-border); }
.e-pendiente { color: #92400e; background: #fef3c7; } .e-aprobada { color: #15803d; background: #e7f5ec; } .e-rechazada { color: #b3261e; background: #fdecea; } .e-incorporada { color: var(--ocean-blue); background: var(--tint); }
.quien { font-size: 13px; color: var(--muted); }
.campo { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.lbl-fila { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pregunta { font-size: 16px; font-weight: 500; color: var(--title); }
.columnas { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.caja { border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.resp { border: 1px solid var(--border); }
.resp p { margin: 0 0 8px; } .resp ol, .resp ul { margin: 0 0 8px; padding-left: 20px; } .resp li { margin: 0 0 4px; } .resp > *:last-child { margin-bottom: 0; }
.fuentes { margin-top: 8px; font-size: 12px; color: var(--muted); }
.corr { background: var(--tint); border: 1px solid var(--chip-border); color: var(--ocean-navy); white-space: pre-wrap; flex: 1; }
.nota { font-size: 12px; color: var(--muted); }
.editor { font-family: inherit; font-size: 14px; line-height: 1.5; color: var(--ocean-navy); background: var(--tint); border: 1px solid var(--chip-border); border-radius: 12px; padding: 12px 16px; min-height: 96px; resize: vertical; width: 100%; flex: 1; }
.editor:hover { border-color: var(--ocean-blue-light, #4880c0); }
.editor:focus { outline: none; background: var(--surface); border-color: var(--ocean-blue); box-shadow: 0 0 0 3px rgba(0, 71, 171, .12); }
.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid #eef1f6; }
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: inherit; font-weight: 500; font-size: 14px; line-height: 16px; padding: 12px 22px; min-height: 44px; border-radius: 25px; cursor: pointer; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-p { background: var(--ocean-blue); border: 1px solid var(--ocean-blue); color: #fff; } .btn-p:hover { background: var(--ocean-blue-dark); }
.btn-s { background: var(--surface); border: 1px solid var(--border); color: var(--text); } .btn-s:hover { border-color: var(--ocean-blue); color: var(--ocean-blue); }
.mensaje { font-size: 13px; color: #15803d; }
.mensaje.error { color: #b3261e; }
details.plegable summary { cursor: pointer; font-size: 13px; color: var(--ocean-link); text-decoration: underline; list-style: none; }
details.plegable summary::-webkit-details-marker { display: none; }
details.plegable[open] summary { margin-bottom: 6px; }
.ayuda { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.ayuda summary { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--title); list-style: none; }
.ayuda summary::-webkit-details-marker { display: none; }
.ayuda summary svg { color: var(--ocean-blue); flex-shrink: 0; }
.ayuda summary::after { content: "+"; margin-left: auto; color: var(--ocean-blue); font-weight: 700; }
.ayuda[open] summary::after { content: "–"; }
.ayuda-cuerpo { padding: 0 20px 18px; font-size: 14px; }
.ayuda-cuerpo p { margin: 0 0 10px; }
.ayuda-cuerpo h3 { margin: 16px 0 8px; font-size: 15px; color: var(--title); }
.ayuda-cuerpo ul, .ayuda-cuerpo ol { margin: 0 0 10px; padding-left: 22px; }
.ayuda-cuerpo li { margin-bottom: 6px; }
.ayuda-nota { background: var(--tint); border-radius: 10px; padding: 10px 14px; color: var(--ocean-navy); }
.cabecera-portal { display: flex; flex-direction: column; gap: 24px; }
.detalle { width: 100%; max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.btn-volver { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; line-height: 16px; padding: 10px 18px; min-height: 44px; border-radius: 25px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; }
.btn-volver:hover { border-color: var(--ocean-blue); color: var(--ocean-blue); }
.det-cabecera { display: flex; align-items: center; gap: 14px; }
.det-cabecera img { width: 52px; height: 52px; border-radius: 50%; background: #cfe0f7; object-fit: cover; flex-shrink: 0; }
.det-cabecera .sub { font-size: 13px; color: var(--muted); }
.det-cabecera h1 { margin: 0; font-size: 24px; }
.resultado { border-radius: 16px; padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid; }
.resultado.ok { background: #e7f5ec; border-color: #b7e1c4; }
.resultado.ko { background: #fdecea; border-color: #f5c2c0; }
.res-texto { display: flex; align-items: center; gap: 14px; }
.res-icono { width: 44px; height: 44px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.resultado.ok .res-icono { color: #15803d; } .resultado.ko .res-icono { color: #b3261e; }
.res-titulo { display: block; font-size: 17px; font-weight: 600; }
.resultado.ok .res-titulo { color: #14532d; } .resultado.ko .res-titulo { color: #7f1d1d; }
.res-desc { font-size: 14px; }
.resultado.ok .res-desc { color: #166534; } .resultado.ko .res-desc { color: #991b1b; }
.btn-todas { display: inline-flex; align-items: center; font-weight: 500; font-size: 14px; line-height: 16px; padding: 12px 22px; min-height: 44px; border-radius: 25px; background: var(--ocean-blue); border: 1px solid var(--ocean-blue); color: #fff; text-decoration: none; }
.btn-todas:hover { background: var(--ocean-blue-dark); color: #fff; }
.btn-login { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-family: inherit; font-weight: 500; font-size: 14px; padding: 12px 22px; min-height: 44px; border-radius: 25px; background: var(--ocean-blue); border: 1px solid var(--ocean-blue); color: #fff; cursor: pointer; }
.btn-login:hover { background: var(--ocean-blue-dark); }
/* Pestañas (solo administradores) */
.pestanas { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.pestana { font-family: inherit; font-weight: 500; font-size: 15px; padding: 10px 16px; min-height: 44px; color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; }
.pestana:hover { color: var(--ocean-blue); }
.pestana.activa { font-weight: 600; color: var(--ocean-blue); border-bottom-color: var(--ocean-blue); }

/* Responsables */
.vista-responsables { display: flex; flex-direction: column; gap: 24px; }
.resp-intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.resp-intro p { margin: 0; max-width: 720px; color: var(--muted); }
.btn-mas { display: inline-flex; align-items: center; gap: 6px; font-family: inherit; font-weight: 500; font-size: 14px; line-height: 16px; padding: 9px 16px; min-height: 40px; border-radius: 25px; background: var(--surface); border: 1px solid var(--chip-border); color: var(--ocean-blue); cursor: pointer; white-space: nowrap; }
.btn-mas:hover { border-color: var(--ocean-blue); }
.tabla-resp { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.fila-resp { display: grid; grid-template-columns: 240px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 24px; border-bottom: 1px solid #eef1f6; }
.fila-resp:last-child { border-bottom: 0; }
.fila-resp.cab { padding: 12px 24px; background: #f8fafd; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.fila-resp.confirmando { background: #fffbeb; }
.dep-nom { font-weight: 600; color: var(--title); }
.personas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.persona { display: inline-flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border: 1px solid var(--chip-border); border-radius: 25px; background: var(--surface); }
.persona.yo { background: var(--tint); padding-right: 14px; }
.persona-txt { display: flex; flex-direction: column; line-height: 1.25; }
.persona-txt b { font-size: 14px; font-weight: 500; }
.persona-txt span { font-size: 12px; color: var(--muted); }
.btn-x { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--bg); color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.btn-x:hover { background: #fdecea; color: #b3261e; }
.sin-resp { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #92400e; }
.pregunta-baja { font-size: 14px; color: #92400e; }
.btn-peligro { font-family: inherit; font-weight: 500; font-size: 14px; padding: 8px 16px; min-height: 40px; border-radius: 25px; background: #b3261e; border: 1px solid #b3261e; color: #fff; cursor: pointer; }
.btn-peligro:hover { background: #962019; }
.bloque { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.bloque-cab { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; }
.bloque h2 { margin: 0 0 2px; font-size: 17px; font-weight: 600; color: var(--title); }

/* Alta */
.alta { width: 100%; max-width: 720px; align-self: center; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 26px 28px; display: flex; flex-direction: column; gap: 20px; }
.alta h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; color: var(--title); }
.alta fieldset { border: 0; margin: 0; padding: 0; }
.alta legend, .alta .etq { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.tipos { display: flex; flex-wrap: wrap; gap: 10px; }
.tipo { display: inline-flex; align-items: center; gap: 10px; padding: 13px 17px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; flex: 1 1 240px; }
.tipo.sel { border: 2px solid var(--ocean-blue); background: var(--tint); padding: 12px 16px; }
.tipo input { accent-color: var(--ocean-blue); }
.tipo b { display: block; color: var(--title); }
.tipo span span { font-size: 13px; color: var(--muted); }
.alta select, .alta input[type="text"] { width: 100%; font-family: inherit; font-size: 15px; color: var(--text); padding: 10px 12px; border: 1px solid var(--chip-border); border-radius: 10px; background: var(--surface); min-height: 44px; }
.alta select:focus, .alta input[type="text"]:focus { outline: none; border-color: var(--ocean-blue); box-shadow: 0 0 0 3px rgba(0, 71, 171, .12); }
.sugerencias { margin-top: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(16, 24, 40, .12); overflow: hidden; }
.sugerencia { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 0; border-top: 1px solid #eef1f6; background: var(--surface); font-family: inherit; text-align: left; cursor: pointer; }
.sugerencia:first-child { border-top: 0; }
.sugerencia:hover, .sugerencia.sel { background: var(--tint); }
.sugerencia .dep-chip { font-size: 12px; color: var(--muted); background: var(--bg); padding: 2px 10px; border-radius: 25px; white-space: nowrap; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ocean-blue); }
.check span span { display: block; font-size: 13px; color: var(--muted); }
.alta-acciones { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 14px; border-top: 1px solid #eef1f6; }
.aviso-ok { background: #e7f5ec; border: 1px solid #b7e1c4; color: #15803d; border-radius: 12px; padding: 12px 16px; font-weight: 500; }
.aviso-error { background: #fdecea; border: 1px solid #f5c2c0; color: #b3261e; border-radius: 12px; padding: 12px 16px; }
@media (max-width: 760px) {
  .fila-resp { grid-template-columns: 1fr; gap: 10px; padding: 14px 16px; }
  .fila-resp.cab { display: none; }
  .alta { padding: 20px 16px; }
}
.doc-actualizar { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border: 1px solid #f2cf6d; background: #fffbeb; border-radius: 12px; color: #92400e; }
.doc-actualizar svg { flex-shrink: 0; margin-top: 1px; }
.doc-actualizar div { display: flex; flex-direction: column; gap: 2px; }
.doc-lbl { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.doc-actualizar b { font-size: 15px; font-weight: 700; color: #78350f; }
.pie { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }

@media (max-width: 640px) {
  .top { padding: 0 14px; min-height: 60px; }
  .logo { height: 26px; }
  .btn-back span, .user { display: none; }
  .btn-back { width: 44px; height: 44px; padding: 0; justify-content: center; border-color: var(--border); }
  .wrap { padding: 20px 14px 32px; gap: 16px; }
  h1 { font-size: 22px; }
  .resumen { grid-template-columns: 1fr; }
  .estados { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .estado-btn { flex-shrink: 0; }
  .tarjeta { padding: 16px; }
  .columnas { grid-template-columns: 1fr; }
  .acciones .btn { flex: 1 1 0; justify-content: center; }
}
