/* Checklists, cambio de contraseña, ayuda, instalación y auditoría. */

/* ---------------- Cambio de contraseña ---------------- */

.clave-box { max-width: 420px; }
.clave-campo { display: block; font-size: 0.76rem; color: var(--text-dim); margin-bottom: 12px; }
.clave-campo input {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font-body); font-size: 14px;
}
.clave-campo input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }
.clave-ver { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); cursor: pointer; }
.clave-ver input { width: 15px; height: 15px; accent-color: var(--teal); }
.clave-nota { font-size: 12px; color: var(--text-faint); line-height: 1.45; margin: 12px 0 0; }
.clave-msg { font-size: 12.5px; margin-top: 10px; min-height: 16px; }
.clave-msg.mal { color: var(--red); }
.clave-msg.bien { color: #4fb88a; }
.clave-correo {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-2); padding: 12px 14px; margin: 14px 0 4px;
}
.clave-correo-tit {
  display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-faint); margin-bottom: 4px;
}
.clave-correo strong { font-size: 14px; word-break: break-all; }

/* ---------------- Ayuda ---------------- */

.ayuda-box { max-width: 560px; }
.ayuda-intro { font-size: 13.5px; color: var(--text-dim); line-height: 1.55; margin: 2px 0 16px; }
.ayuda-seccion { margin-bottom: 16px; }
.ayuda-seccion h4 {
  display: flex; align-items: center; gap: 7px; margin: 0 0 8px;
  font-family: var(--font-head); font-size: 13px; color: var(--text);
}
.ayuda-seccion ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.ayuda-seccion li { font-size: 13px; color: var(--text-dim); line-height: 1.45; }

.ayuda-soporte {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-2); padding: 14px 16px; margin-bottom: 16px;
}
.ayuda-soporte-tit {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-faint); margin-bottom: 6px;
}
.ayuda-persona { font-family: var(--font-head); font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.ayuda-dato {
  display: flex; align-items: center; gap: 8px; padding: 7px 0;
  font-size: 13.5px; color: var(--teal); text-decoration: none;
  border-top: 1px solid var(--border-soft);
}
.ayuda-dato:hover { text-decoration: underline; }

.install-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200;
  max-width: 420px; margin: 0 auto;
  background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 13px;
  transform: translateY(140%); transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
}
.install-banner.visible { transform: translateY(0); }
.install-banner .ib-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--blue-deep);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.install-banner .ib-icon svg { width: 26px; height: 26px; }
.install-banner .ib-body { flex: 1; min-width: 0; }
.install-banner .ib-title { font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--text); }
.install-banner .ib-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.install-banner .ib-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.install-banner .ib-btn {
  border: none; border-radius: 8px; padding: 8px 14px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; font-family: var(--font-body); white-space: nowrap;
}
.install-banner .ib-install { background: var(--teal); color: white; }
.install-banner .ib-dismiss { background: transparent; color: var(--text-faint); }
.install-banner .ib-dismiss:hover { color: var(--text); }
@media (max-width: 520px) {
  .install-banner { flex-wrap: wrap; padding: 14px; }
  .install-banner .ib-body { order: 1; }
  .install-banner .ib-icon { order: 0; }
  .install-banner .ib-actions { order: 2; flex-direction: row; width: 100%; margin-top: 4px; }
  .install-banner .ib-btn { flex: 1; justify-content: center; }
}

.activity-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
/* min-width:0 en los hijos: sin esto un flex-item no baja de su ancho de
   contenido y el detalle largo del log empujaba la fila fuera de la tarjeta. */
.activity-row > div { min-width: 0; }
.activity-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-extra { display: none; }
#recent-activity.audit-abierto .audit-extra { display: flex; }
.audit-toggle {
  width: 100%; margin-top: 8px; padding: 7px 10px; background: none; cursor: pointer;
  border: 1px dashed var(--border); border-radius: 8px; color: var(--text-dim);
  font-family: inherit; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.audit-toggle:hover { color: var(--teal); border-color: var(--teal); background: var(--teal-dim); }
#recent-activity.audit-abierto .audit-toggle svg { transform: rotate(180deg); }
.audit-toggle svg { transition: transform 0.18s ease; }

.activity-detalle {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.activity-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.activity-meta { color: var(--text-faint); font-size: 11.5px; }

.report-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 4px; border-bottom: 1px solid var(--border-soft); }
.report-row:last-child { border-bottom: none; }
.report-row strong { font-family: var(--font-head); font-size: 14px; }


.powered { text-align:center; color:var(--text-faint); font-size:12px; padding:18px 0; }
.powered strong { color: var(--text-dim); }

.progress-overlay {
  position: fixed; inset: 0; background: rgba(4,10,18,0.72);
  display: flex; align-items: center; justify-content: center; z-index: 120;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.progress-box {
  background: var(--bg-1); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 32px; width: min(430px, 90vw); text-align: center;
  box-shadow: var(--shadow);
}
.progress-box .progress-logo {
  width: 52px; height: 52px; margin: 0 auto 14px;
}
.progress-box .progress-logo svg { width: 100%; height: 100%; }
.progress-box h3 { margin: 0 0 4px; font-family: var(--font-head); font-size: 16px; }
.progress-track { height: 8px; background: var(--bg-3); border-radius: 999px; overflow: hidden; margin: 18px 0 10px; }
.progress-fill { height: 100%; width: 0%; background: var(--blue); transition: width 0.3s ease; border-radius: 999px; }
.progress-msg { font-size: 12.5px; color: var(--text-dim); font-family: var(--font-mono); min-height: 17px; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

.chk-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.struct-cards { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 14px; }
.struct-card { min-width: 132px; flex-shrink: 0; background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px 14px; }
.struct-card .sc-name { font-family: var(--font-mono); font-weight: 700; font-size: 12.5px; margin-bottom: 8px; white-space: nowrap; display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.struct-card .sc-pct { font-family: var(--font-mono); font-size: 12px; color: var(--teal); margin-top: 6px; font-weight: 700; }
.struct-card .sc-abscisa { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-faint); font-family: var(--font-mono); }
.struct-card .sc-edit-abs { background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 2px; display: inline-flex; border-radius: 4px; }
.struct-card .sc-edit-abs:hover { color: var(--teal); background: var(--teal-dim); }
/* Tarjeta clicable que abre la ficha de la estructura (igual que en Montaje). */
button.struct-card { font: inherit; text-align: left; cursor: pointer; color: var(--text); }
button.struct-card:hover .sc-name { color: var(--teal); }
.struct-card .sc-abs { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); margin: -4px 0 7px; }
/* Nombre de la estructura en el encabezado de la matriz: abre la misma ficha. */
.chk-th-name {
  background: none; border: none; padding: 0; cursor: pointer; font: inherit;
  color: inherit; letter-spacing: inherit; text-transform: inherit; white-space: nowrap;
}
.chk-th-name:hover { color: var(--teal); text-decoration: underline; }
.chk-cell { position: relative; }
.chk-medida { font-size: 10px; color: var(--text-faint); font-family: var(--font-mono); margin-top: 4px; }
.chk-table td:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ta-actions { display: flex; gap: 4px; flex-shrink: 0; opacity: 0.45; transition: opacity 0.15s ease; }
.chk-table tr:hover .ta-actions { opacity: 1; }
.ta-edit, .ta-del { background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 3px; display: inline-flex; border-radius: 4px; }
.ta-edit:hover { color: var(--teal); background: var(--teal-dim); }
.ta-del:hover { color: var(--red); background: rgba(224,90,90,0.12); }
.chk-matrix-wrap { overflow: auto; max-height: 68vh; border: 1px solid var(--border-soft); border-radius: 10px; }
.chk-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 100%; }
.chk-table th, .chk-table td { border-bottom: 1px solid var(--border-soft); padding: 11px 13px; }
.chk-table thead th {
  position: sticky; top: 0; background: var(--bg-2); z-index: 2;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.5px;
  color: var(--text-dim); text-transform: uppercase; text-align: center; white-space: nowrap;
}
.chk-table thead th:first-child { text-align: left; left: 0; z-index: 3; }
.chk-table tbody td:first-child {
  position: sticky; left: 0; background: var(--bg-1); z-index: 1;
  font-family: var(--font-mono); font-size: 13px; white-space: nowrap;
}
.chk-table tbody tr:hover td { background: var(--hover-fila); }
.chk-table tbody tr:hover td:first-child { background: var(--bg-2); }
.chk-cell { text-align: center; }
.chk-box {
  width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--bg-2); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform 0.12s, background 0.15s, border-color 0.15s; color: transparent;
}
.chk-box.checked { background: var(--ok); border-color: var(--ok); color: #06261a; }
.chk-box:hover:not(.disabled) { transform: scale(1.1); border-color: var(--teal); }
.chk-box.missing { border-style: dashed; opacity: 0.55; }
.chk-box.disabled { cursor: default; }
/* En claro, una casilla vacía sobre fondo blanco casi no se ve: se le sube el
   contraste del borde y del relleno para que se distinga de una hecha. */
html[data-tema="claro"] .chk-box:not(.checked) { border-color: var(--border-strong); background: var(--bg-3); }

/* Textos de estado: los tonos claros se leen sobre fondo oscuro, pero sobre
   una pastilla clara desaparecen. En el tema claro se usan los mismos colores
   en version oscura, manteniendo el significado. */
html[data-tema="claro"] .mh-estado.ok { color: #12653b; border-color: rgba(18,101,59,0.35); }
html[data-tema="claro"] .mh-estado.med { color: #1a4e8a; border-color: rgba(26,78,138,0.35); }
html[data-tema="claro"] .mh-estado.pend { color: var(--text-dim); }
html[data-tema="claro"] .mh-sop.ok .mh-sop-tag { color: #12653b; border-color: rgba(18,101,59,0.4); }
html[data-tema="claro"] .qty-input.partial { color: #12653b; border-color: rgba(18,101,59,0.55); }
html[data-tema="claro"] .mt-falta { color: #9a6112; }
html[data-tema="claro"] .tramo-select.t10, html[data-tema="claro"] .tramo-select.t1 { color: #17466f; }
html[data-tema="claro"] .tramo-select.t8 { color: #7d5510; }
html[data-tema="claro"] .tramo-select.t9 { color: #83364f; }
html[data-tema="claro"] .tramo-select.t7 { color: #10603f; }
html[data-tema="claro"] .tramo-select.tph { color: #443371; }
html[data-tema="claro"] .qty-fecha.vacia { opacity: 0.4; }
html[data-tema="claro"] .qty-input.missing { opacity: 0.6; }
