/* Estilos específicos para la encuesta de personal y el panel de administración */

/* Barra de estado y confidencialidad en personal */
.confidential-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--verde-900);
  color: var(--blanco);
  border-radius: calc(var(--radio) - 4px);
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.confidential-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #a9d4b7;
}

.confidential-tag::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #4cd964;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(76, 217, 100, 0.8);
}

.timer-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  color: var(--arena);
}

/* Tarjeta de acceso con código */
.access-shell {
  width: min(560px, calc(100% - 2rem));
  margin: 3rem auto;
}

.access-card {
  padding: 1.8rem;
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}

.code-input-group {
  margin: 1.5rem 0;
}

.code-input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 750;
  color: var(--verde-900);
}

.code-input {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
  padding: 0.85rem;
  border: 2px solid var(--borde);
  border-radius: 8px;
  background: #fffefa;
  color: var(--tinta);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.code-input:focus {
  border-color: var(--verde-600);
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 122, 84, 0.18);
}

.code-hint {
  font-size: 0.82rem;
  color: #526158;
  margin-top: 0.45rem;
  line-height: 1.4;
}

/* Panel de administración */
.admin-shell {
  width: min(1160px, calc(100% - 2rem));
  margin: 2rem auto 4rem;
}

.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-nav-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--borde);
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.65rem 1.2rem;
  font-size: 0.92rem;
  font-weight: 750;
  color: #526158;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--verde-900);
  background: var(--verde-100);
}

.tab-btn.active {
  color: var(--verde-900);
  background: var(--verde-100);
  box-shadow: inset 0 -3px 0 var(--verde-600);
}

/* Métricas del admin */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1.3rem;
  box-shadow: var(--sombra);
}

.metric-card .metric-label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #526158;
  margin-bottom: 0.4rem;
}

.metric-card .metric-value {
  font-size: 2.2rem;
  font-weight: 850;
  color: var(--verde-900);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.metric-card .metric-detail {
  font-size: 0.8rem;
  color: #58655d;
}

/* Resultados en tarjetas */
.results-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.survey-toggle {
  display: inline-flex;
  background: #e3e1d9;
  padding: 0.25rem;
  border-radius: 999px;
  gap: 0.25rem;
}

.toggle-option {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 750;
  color: #526158;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-option.active {
  background: var(--blanco);
  color: var(--verde-900);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.question-result-card {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1.4rem;
  margin-bottom: 1.3rem;
  box-shadow: var(--sombra);
}

.question-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.question-header h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.3;
}

.badge-tipo {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  background: var(--verde-100);
  color: var(--verde-900);
}

/* Barras de distribución */
.distribution-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.4fr) minmax(120px, 2.5fr) 55px;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  font-size: 0.84rem;
}

.dist-label {
  font-weight: 650;
  color: var(--tinta);
  word-break: break-word;
}

.dist-bar-track {
  height: 0.65rem;
  background: #e9e7e1;
  border-radius: 999px;
  overflow: hidden;
}

.dist-bar-fill {
  height: 100%;
  background: var(--verde-600);
  border-radius: inherit;
  transition: width 0.3s ease;
}

.dist-bar-fill.amber {
  background: var(--ambar);
}

.dist-count {
  text-align: right;
  font-weight: 750;
  color: #526158;
}

.scale-summary-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--verde-100);
  border-radius: 8px;
}

.scale-average-num {
  font-size: 1.7rem;
  font-weight: 850;
  color: var(--verde-900);
}

.scale-average-label {
  font-size: 0.8rem;
  color: #375344;
  line-height: 1.3;
}

/* Respuestas de texto abierto */
.text-responses-container {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: #faf8f3;
  padding: 0.75rem;
}

.text-response-quote {
  padding: 0.7rem 0.85rem;
  background: var(--blanco);
  border-radius: 6px;
  border-left: 3px solid var(--ambar);
  margin-bottom: 0.5rem;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--tinta);
}

.text-response-quote:last-child {
  margin-bottom: 0;
}

.no-responses-msg {
  color: #778179;
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.5rem;
}

/* Gestión de códigos */
.codes-generator-card {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--sombra);
}

.codes-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) auto;
  gap: 1rem;
  align-items: flex-end;
  margin-top: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 750;
  color: var(--verde-900);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--borde);
  border-radius: 6px;
  background: #fffefa;
}

.generated-codes-box {
  margin-top: 1.5rem;
  padding: 1.2rem;
  background: #fcf9f2;
  border: 1px solid #e6be79;
  border-radius: 8px;
}

.generated-codes-box h4 {
  margin: 0 0 0.5rem;
  color: #65400d;
}

.generated-codes-textarea {
  width: 100%;
  height: 130px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.9rem;
  padding: 0.75rem;
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: 6px;
  resize: vertical;
}

/* Tabla de códigos */
.codes-table-container {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1.3rem;
  box-shadow: var(--sombra);
  overflow-x: auto;
}

.table-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.codes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}

.codes-table th {
  padding: 0.75rem 0.85rem;
  background: var(--arena);
  color: var(--verde-900);
  font-weight: 800;
  border-bottom: 2px solid var(--borde);
}

.codes-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #ebe7df;
  color: var(--tinta);
}

.codes-table tr:hover td {
  background: #fbf9f4;
}

.badge-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-disponible {
  background: #e2f4ea;
  color: #126639;
}

.badge-usado {
  background: #eeebe6;
  color: #6d7570;
}

/* Export card */
.export-shell {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem;
}

.export-card {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1.5rem;
  box-shadow: var(--sombra);
}

.export-card h3 {
  margin-bottom: 0.5rem;
}

.export-card p {
  font-size: 0.88rem;
  color: #526158;
  margin-bottom: 1.25rem;
}

/* Responsive adjustments */
@media (max-width: 680px) {
  .distribution-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .dist-count {
    text-align: left;
  }
  .codes-form-grid {
    grid-template-columns: 1fr;
  }
}
