/* Widget encapsulado: no toca nada fuera */
.sqlbox{
  width: 100%;
  height: 100%;              /* ocupa el alto del recuadro */
  display: flex;
  flex-direction: column;
  gap: 10px;

  background: #f6f8fb;       /* similar a tu panel */
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  padding: 12px;
}

.sqlbox__head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 0;
}

.sqlbox__head h3{
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1f2a37;
}

.sqlbox__hint{
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sqlbox__form{
  flex: 1;                   /* el form estira dentro del recuadro */
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;             /* clave para que el textarea pueda crecer */
}

.sqlbox__textarea{
  flex: 1;                   /* ocupa todo el espacio disponible */
  min-height: 0;
  width: 100%;
  resize: none;              /* para que no rompa el layout del panel */
  padding: 10px 12px;

  border: 1px solid #cfd8e3;
  border-radius: 10px;
  background: #ffffff;

  font-size: 13px;
  line-height: 1.35;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  outline: none;
}

.sqlbox__textarea:focus{
  border-color: rgba(47, 63, 82, .55);
  box-shadow: 0 0 0 4px rgba(47, 63, 82, .10);
}

.sqlbox__actions{
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.sqlbox__btn{
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;

  background: #2f3f52;
  color: #fff;
}

.sqlbox__btn:hover{ filter: brightness(1.06); }
.sqlbox__btn:active{ transform: translateY(1px); }

.sqlbox__btn--ghost{
  background: transparent;
  color: #2f3f52;
  border: 1px solid #cfd8e3;
}
.sqlbox__btn--ghost:hover{
  background: rgba(47, 63, 82, .06);
}

.sqlbox__guard{
  margin: -2px 0 0;
  color: #7c2d12;
  font-size: 12px;
  font-weight: 700;
}

.sqlbox__password-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 24, 39, .38);
}

.sqlbox__password-overlay[hidden]{
  display: none;
}

.sqlbox__password-dialog{
  width: min(360px, 100%);
  padding: 18px;
  border: 1px solid #cfd8e3;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(17, 24, 39, .28);
}

.sqlbox__password-title{
  margin: 0 0 6px;
  color: #1f2a37;
  font-size: 18px;
  font-weight: 800;
}

.sqlbox__password-copy{
  margin: 0 0 12px;
  color: #5d6d7e;
  font-size: 13px;
}

.sqlbox__password-input{
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
}

.sqlbox__password-input:focus{
  border-color: rgba(47, 63, 82, .55);
  box-shadow: 0 0 0 4px rgba(47, 63, 82, .10);
}

.sqlbox__password-error{
  min-height: 18px;
  margin: 8px 0 10px;
  color: #8f1d1d;
  font-size: 12px;
  font-weight: 700;
}

.sqlbox__password-actions{
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.sqlbox__result-overlay{
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 24, 39, .22);
}

.sqlbox__result-overlay[hidden]{
  display: none;
}

.sqlbox__result-dialog{
  width: min(360px, 100%);
  padding: 18px;
  border: 1px solid #cfd8e3;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(17, 24, 39, .24);
  text-align: center;
}

.sqlbox__result-message{
  margin: 0;
  color: #1e6a3c;
  font-size: 15px;
  font-weight: 800;
}

.sqlbox__result-overlay.is-error .sqlbox__result-message{
  color: #8f1d1d;
}

.sqlbox__result-copy{
  margin: 8px 0 0;
  color: #5d6d7e;
  font-size: 12px;
  font-weight: 700;
}
