/* =====================================================
   Módulo Gestionar Versiones — OrganizaBox Admin
   UTF-8 sin BOM
   ===================================================== */

.av-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ── Advertencia deploy ── */
.av-warning {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
  border: 1px solid rgba(245, 158, 11, .38);
  color: #92400e;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
  margin-bottom: 18px;
}

.av-warning-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Carga ── */
.av-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

/* ── Card config actual (read-only) ── */
.av-display-card {
  border: 1px solid rgba(15, 23, 42, .10);
  background: rgba(255, 255, 255, .86);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.av-card-title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.av-row {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
  font-size: 12px;
}

.av-row:last-child { border-bottom: 0; }

.av-row-label {
  color: var(--muted);
  font-weight: 800;
}

.av-row-value {
  font-weight: 900;
  color: #0f172a;
  word-break: break-word;
}

.av-badge-block {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid rgba(220, 38, 38, .28);
  background: #fef2f2;
  color: #991b1b;
}

.av-badge-open {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid rgba(148, 163, 184, .35);
  background: #f8fafc;
  color: #475569;
}

.av-version-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: #eff6ff;
  border: 1px solid rgba(59, 130, 246, .25);
  color: #1d4ed8;
  font-family: monospace;
  letter-spacing: .04em;
}

/* ── Card formulario ── */
.av-form-card {
  border: 1px solid rgba(148, 0, 124, .16);
  background: rgba(255, 255, 255, .92);
  border-radius: 16px;
  padding: 14px 16px;
}

.av-fields {
  display: grid;
  gap: 14px;
}

.av-version-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 640px) {
  .av-version-row { grid-template-columns: 1fr; }
  .av-row { grid-template-columns: 1fr; gap: 3px; }
}

.av-field-group {
  display: grid;
  gap: 5px;
}

.av-field-label {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
}

.av-field-hint {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.av-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, .14);
  font-weight: 800;
  font-size: 13px;
  font-family: monospace;
  background: #fff;
  box-sizing: border-box;
}

.av-input:focus {
  outline: 2px solid rgba(148, 0, 124, .38);
  border-color: rgba(148, 0, 124, .28);
}

.av-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, .14);
  font-weight: 750;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  min-height: 80px;
  resize: vertical;
  box-sizing: border-box;
}

.av-textarea:focus {
  outline: 2px solid rgba(148, 0, 124, .38);
  border-color: rgba(148, 0, 124, .28);
}

.av-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, .72);
}

.av-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--obx-primary);
}

.av-checkbox-label {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.4;
}

/* ── Errores de validación ── */
.av-validation-errors {
  display: none;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid rgba(220, 38, 38, .22);
  color: #991b1b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.8;
}

.av-validation-errors.show { display: block; }

/* ── Acciones ── */
.av-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ── Botón guardar ── */
.av-save-btn {
  border: 1px solid var(--btn-border);
  background: linear-gradient(180deg, var(--btn), var(--btn-2));
  color: #fff;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  min-width: 160px;
  transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease;
}

.av-save-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 0, 124, .45);
  box-shadow: 0 12px 26px rgba(15, 23, 42, .14);
}

.av-save-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Botón recargar ── */
.av-reload-btn {
  border: 1px solid rgba(15, 23, 42, .14);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .10s ease;
}

.av-reload-btn:hover { border-color: rgba(148, 0, 124, .32); }

/* ── Estado (ok / error) ── */
.av-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 900;
  display: none;
}

.av-status.ok {
  display: block;
  background: #f0fdf4;
  border: 1px solid rgba(34, 197, 94, .25);
  color: #166534;
}

.av-status.error {
  display: block;
  background: #fef2f2;
  border: 1px solid rgba(220, 38, 38, .22);
  color: #991b1b;
}

/* === Estado de coherencia de versiones === */
.av-coherence-item {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.4;
}

.av-coherence-item:last-child { margin-bottom: 0; }

.av-coherence-item--ok {
  background: #f0fdf4;
  border: 1px solid rgba(34, 197, 94, .25);
  color: #166534;
}

.av-coherence-item--warn {
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
  border: 1px solid rgba(245, 158, 11, .38);
  color: #92400e;
}

.av-coherence-item--error {
  background: #fef2f2;
  border: 1px solid rgba(220, 38, 38, .22);
  color: #991b1b;
}
