/* styles.css — Módulo Cuestionarios de Actividad */
:root { --entity-color: #2980b9; }

/* ═══════════════════════════════════════════════════
   PANEL DE RESULTADOS IPAQ (Formulario)
   ═══════════════════════════════════════════════════ */
.ipaq-results-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.ipaq-results-grid {
  display: grid;
  grid-template-columns: auto 1fr 1.5fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 768px) {
  .ipaq-results-grid {
    grid-template-columns: 1fr;
  }
}

.ipaq-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
}

.ipaq-card--gauge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
}

/* Gauge SVG */
.ipaq-gauge {
  position: relative;
  width: 120px;
  text-align: center;
}

.ipaq-gauge svg {
  width: 120px;
  height: 70px;
  overflow: visible;
  transition: stroke-dashoffset .6s ease;
}

#gauge-arc {
  transition: stroke-dashoffset .5s ease, stroke .4s ease;
}

.ipaq-gauge__value {
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: .25rem;
  transition: color .4s ease;
}

.ipaq-gauge__label {
  font-size: .7rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Semáforo */
.ipaq-semaforo {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
  border-radius: 8px;
  padding: .625rem 1rem;
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: .75rem;
  transition: background .4s ease;
}

.ipaq-semaforo i {
  font-size: 1.1rem;
}

.ipaq-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .3rem 0;
  border-bottom: 1px dashed #f1f5f9;
  font-size: .875rem;
}

.ipaq-meta-row:last-child { border-bottom: none; }

.ipaq-meta-label { color: #64748b; }
.ipaq-meta-value { font-weight: 700; }

/* Breakdown barras */
.ipaq-card--breakdown {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.ipaq-breakdown-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #475569;
  margin-bottom: .25rem;
}

.ipaq-bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 60px;
  align-items: center;
  gap: .5rem;
}

.ipaq-bar-label {
  font-size: .8rem;
  color: #475569;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: .3rem;
}

.ipaq-bar-track {
  background: #f1f5f9;
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
}

.ipaq-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .5s ease;
  min-width: 2px;
}

.ipaq-bar-num {
  font-size: .8rem;
  font-weight: 700;
  text-align: right;
  color: #334155;
}

/* ═══════════════════════════════════════════════════
   PANEL DETALLE (Vista de solo lectura)
   ═══════════════════════════════════════════════════ */
.ipaq-detail-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.ipaq-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: #fff;
}

.ipaq-detail-badge {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
  border-radius: 8px;
  padding: .625rem 1.25rem;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}

.ipaq-detail-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.ipaq-stat {
  text-align: center;
}

.ipaq-stat__value {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e293b;
}

.ipaq-stat__label {
  font-size: .75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.ipaq-detail-breakdown {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.ipaq-detail-breakdown .ipaq-bar-row {
  grid-template-columns: 160px 1fr 80px;
}

.ipaq-detail-raw {
  padding: 1rem 1.5rem;
  border-top: 1px solid #f1f5f9;
  background: #fff;
}

.ipaq-raw-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #475569;
  margin-bottom: .75rem;
}

.ipaq-raw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .5rem;
}

.ipaq-raw-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: .4rem .625rem;
  display: flex;
  flex-direction: column;
}

.ipaq-raw-item span {
  font-size: .75rem;
  color: #64748b;
}

.ipaq-raw-item strong {
  font-size: .875rem;
  color: #1e293b;
}

/* ═══════════════════════════════════════════════════
   BADGES EN TABLA
   ═══════════════════════════════════════════════════ */
.ipaq-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .625rem;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}

.ipaq-oms-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .825rem;
  font-weight: 600;
}

.ipaq-met-chip {
  display: inline-block;
  background: var(--color, #2980b9);
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
  padding: .2rem .5rem;
  border-radius: 6px;
}

.ipaq-factor-chip {
  display: inline-block;
  background: #eff6ff;
  color: #2980b9;
  font-weight: 700;
  font-size: .8rem;
  padding: .2rem .5rem;
  border-radius: 6px;
  border: 1px solid #bfdbfe;
}

/* ═══════════════════════════════════════════════════
   SECCIONES DE FORMULARIO
   ═══════════════════════════════════════════════════ */
.ni-form-section {
  margin-bottom: .75rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.ni-section-toggle {
  width: 100%;
  background: #f8fafc;
  border: none;
  padding: .75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  font-size: .9rem;
  color: #334155;
  transition: background .2s;
  text-align: left;
}

.ni-section-toggle:hover {
  background: #f1f5f9;
}

.ni-section-toggle--open .fa-chevron-down {
  transform: rotate(180deg);
}

.ni-section-toggle .fa-chevron-down {
  transition: transform .25s ease;
  color: #94a3b8;
  font-size: .85rem;
  flex-shrink: 0;
}

.ni-form-section__body {
  padding: 1rem;
}

/* Grid de campos */
.ni-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .875rem 1rem;
}

.ni-form-group {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.ni-form-group--full {
  grid-column: 1 / -1;
}

.ni-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  padding: 1rem 0 .5rem;
  border-top: 1px solid #e2e8f0;
  margin-top: .5rem;
}

/* Print */
@media print {
  .ni-header, .ni-toolbar, .ni-pagination, .ni-options-cell,
  #btn-new, #btn-export, #btn-print { display: none !important; }
  .ipaq-detail-panel { border: 1px solid #ccc; }
}
