/* El botón flotante de ayuda y su formulario de ticket
 *
 * POR QUÉ EXISTE ESTE ARCHIVO
 *
 * `public/javascripts/support-help-widget.js` inyecta este widget en TODAS las
 * páginas (va en `views/partials/footer.ejs`). Usa 24 clases propias y 23 no
 * tenían ni una regla en ninguna hoja.
 *
 * El resultado se veía en cada pantalla del módulo: el botón salía como una
 * franja gris de ancho completo al pie de la página, con el texto pegado
 * «?Ayuda», porque sin `position` un botón flotante no flota. Y el formulario de
 * ticket —categoría, asunto, mensaje, captura de pantalla— se habría dibujado
 * dentro del flujo del documento, igual que le pasaba al asistente de crear
 * presupuesto antes de escribirle su hoja.
 *
 * Es el tercer caso del mismo patrón: 105 reglas de /admin/soporte el 21 de
 * agosto, 29 clases del asistente, y estas 23. Por eso, igual que las otras dos
 * veces, este archivo se escribe a mano y NO se genera con Sass.
 *
 * El botón se apila encima del de WhatsApp (que está en bottom 28 / right 28,
 * 58×58, z-index 10080) para no taparlo.
 */

/* ── El botón flotante ────────────────────────────────────────────── */
.inside-support-help-float {
  position: fixed;
  bottom: 98px;
  right: 28px;
  z-index: 10080;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem 0.6rem 0.6rem;
  border: 1px solid rgba(0, 200, 150, 0.35);
  border-radius: 999px;
  background: rgba(15, 27, 27, 0.94);
  color: #d8f3ed;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.inside-support-help-float:hover {
  border-color: rgba(0, 200, 150, 0.7);
  background: rgba(10, 30, 35, 0.98);
}

.inside-support-help-icon {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: var(--inside-dark-accent, #00c896);
  color: #04201a;
  font-weight: 700;
}

.inside-support-help-text { white-space: nowrap; }

/* ── La ventana del ticket ────────────────────────────────────────── */
.inside-support-modal {
  position: fixed;
  inset: 0;
  z-index: 12200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 3vw, 2.5rem);
}

.inside-support-modal[hidden] { display: none; }

.inside-support-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 10, 10, 0.72);
  backdrop-filter: blur(6px);
}

.inside-support-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: min(560px, 100%);
  /* Con la captura de pantalla adjunta el formulario crece. El alto se limita
     para que el contenido se desplace por dentro y el botón de enviar quede
     siempre alcanzable. */
  max-height: min(88vh, 860px);
  overflow-y: auto;
  padding: 1.4rem 1.5rem 1.5rem;
  background: rgba(15, 27, 27, 0.98);
  border: 1px solid rgba(0, 200, 150, 0.18);
  border-radius: 1.1rem;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  color: #e8ecef;
}

.inside-support-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}

.inside-support-close:hover { background: rgba(255, 255, 255, 0.16); }

.inside-support-dialog-header { padding-right: 2.5rem; }

.inside-support-kicker {
  margin: 0 0 0.3rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(120, 214, 195, 0.85);
}

.inside-support-dialog-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 650;
}

.inside-support-dialog-header p {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(224, 244, 240, 0.68);
}

/* ── El formulario ────────────────────────────────────────────────── */
.inside-support-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.inside-support-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.inside-support-field > span,
.inside-support-field > label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(120, 214, 195, 0.85);
}

.inside-support-field input[type="text"],
.inside-support-field select,
.inside-support-field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(0, 200, 150, 0.22);
  background: rgba(3, 14, 18, 0.85);
  color: inherit;
  font: inherit;
  font-size: 0.92rem;
}

.inside-support-field textarea {
  min-height: 6.5rem;
  resize: vertical;
}

.inside-support-field input[type="text"]:focus,
.inside-support-field select:focus,
.inside-support-field textarea:focus {
  outline: none;
  border-color: rgba(0, 200, 150, 0.62);
  box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.14);
}

.inside-support-field-hint {
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(224, 244, 240, 0.6);
}

/* ── La captura adjunta ───────────────────────────────────────────── */
/* El input de archivo se esconde y se maneja con el botón de al lado, que sí
   se puede vestir. Sigue en el DOM y sigue siendo el que guarda el archivo. */
.inside-support-file-control input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.inside-support-file-control { position: relative; }

.inside-support-file-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.inside-support-file-label {
  border: 1px solid rgba(0, 200, 150, 0.28);
  border-radius: 0.55rem;
  padding: 0.45rem 0.9rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.inside-support-file-label:hover { background: rgba(0, 200, 150, 0.12); }

.inside-support-file-name {
  font-size: 0.8rem;
  color: rgba(224, 244, 240, 0.6);
}

.inside-support-screenshot-preview {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-top: 0.7rem;
  padding: 0.7rem;
  border: 1px solid rgba(0, 200, 150, 0.16);
  border-radius: 0.6rem;
  background: rgba(3, 14, 18, 0.6);
}

.inside-support-screenshot-preview[hidden] { display: none; }

.inside-support-screenshot-preview-image {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 0.4rem;
  border: 1px solid rgba(0, 200, 150, 0.16);
}

.inside-support-screenshot-preview-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  font-size: 0.82rem;
}

.inside-support-screenshot-preview-name {
  color: rgba(224, 244, 240, 0.62);
  overflow-wrap: anywhere;
}

.inside-support-remove-screenshot {
  align-self: flex-start;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--pres-peligro, #ffb4a8);
  font: inherit;
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}

/* ── Respuesta y envío ────────────────────────────────────────────── */
.inside-support-feedback {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #b8ece0;
}

.inside-support-feedback[hidden] { display: none; }

.inside-support-actions {
  display: flex;
  justify-content: flex-end;
}

.inside-support-submit {
  border: 1px solid var(--inside-dark-accent, #00c896);
  border-radius: 0.6rem;
  padding: 0.6rem 1.3rem;
  background: var(--inside-dark-accent, #00c896);
  color: #04201a;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
}

.inside-support-submit:hover { background: var(--inside-dark-accent-hover, #00e0a8); }

.inside-support-submit[disabled] { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 620px) {
  .inside-support-help-float {
    bottom: 92px;
    right: 16px;
    padding: 0.5rem;
  }

  .inside-support-help-text { display: none; }

  .inside-support-dialog { max-height: 94vh; padding: 1.2rem 1rem 1.3rem; }
}

/* ── Tema claro ───────────────────────────────────────────────────── */
body.theme-light .inside-support-help-float {
  background: var(--light-card, #ffffff);
  border-color: var(--light-border, rgba(12, 60, 52, 0.18));
  color: var(--light-text, #10231f);
}

body.theme-light .inside-support-backdrop { background: rgba(12, 28, 26, 0.45); }

body.theme-light .inside-support-dialog {
  background: var(--light-card, #ffffff);
  border-color: var(--light-border, rgba(12, 60, 52, 0.16));
  color: var(--light-text, #10231f);
}

body.theme-light .inside-support-kicker,
body.theme-light .inside-support-field > span,
body.theme-light .inside-support-field > label { color: var(--light-accent, #1a6b5a); }

body.theme-light .inside-support-dialog-header p,
body.theme-light .inside-support-field-hint,
body.theme-light .inside-support-file-name,
body.theme-light .inside-support-screenshot-preview-name { color: var(--light-text-soft, #4a635e); }

body.theme-light .inside-support-close,
body.theme-light .inside-support-screenshot-preview { background: var(--light-card-2, #eef6f4); }

body.theme-light .inside-support-field input[type="text"],
body.theme-light .inside-support-field select,
body.theme-light .inside-support-field textarea {
  background: var(--light-card-2, #f6fbfa);
  border-color: var(--light-border, rgba(12, 60, 52, 0.18));
  color: var(--light-text, #10231f);
}

body.theme-light .inside-support-feedback { color: var(--light-accent, #1a6b5a); }

/* ── El bloque de soporte del dashboard ───────────────────────────
 *
 * Mismo problema, otra pantalla: de las 11 clases que usa este bloque, 8 no
 * tenían ninguna regla. Los tres tickets se dibujaban como `display: inline`,
 * o sea encimados en una sola corrida de texto de 1 359 píxeles de ancho, con
 * las etiquetas de estado pegadas al título. Es lo primero que se ve al entrar.
 *
 * Las tres que sí tenían regla —overview, overview-card, overview-main— quedan
 * como están; acá van solo las que faltaban.
 */
.dashboard-support-overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.dashboard-support-overview-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.dashboard-support-mini-ticket {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 0.3rem 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(0, 200, 150, 0.14);
  border-radius: 0.6rem;
  background: rgba(3, 14, 18, 0.45);
  color: inherit;
  text-decoration: none;
}

.dashboard-support-mini-ticket:hover {
  border-color: rgba(0, 200, 150, 0.4);
  background: rgba(0, 200, 150, 0.08);
}

/* El texto del ticket es el <span> sin clase que va después del estado. */
.dashboard-support-mini-ticket > span:not([class]) {
  font-size: 0.85rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.dashboard-support-mini-ticket em {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  font-style: normal;
  color: rgba(224, 244, 240, 0.55);
}

.dashboard-ticket-status {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Abierto = todavía nadie lo miró; en progreso = alguien lo está viendo. Los
   colores dicen eso y no «bueno/malo»: un ticket abierto no es un error. */
.dashboard-ticket-status-abierto {
  background: rgba(255, 190, 92, 0.18);
  color: #ffcf85;
}

.dashboard-ticket-status-en_progreso {
  background: rgba(0, 200, 150, 0.18);
  color: #7fe0c8;
}

.dashboard-support-primary-link,
.dashboard-support-secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(0, 200, 150, 0.28);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.dashboard-support-primary-link:hover,
.dashboard-support-secondary-button:hover { background: rgba(0, 200, 150, 0.12); }

body.theme-light .dashboard-support-mini-ticket {
  background: var(--light-card-2, #f6fbfa);
  border-color: var(--light-border, rgba(12, 60, 52, 0.14));
}

body.theme-light .dashboard-support-mini-ticket em { color: var(--light-text-soft, #4a635e); }

body.theme-light .dashboard-ticket-status-abierto { background: rgba(197, 120, 0, 0.14); color: #8a5300; }

body.theme-light .dashboard-ticket-status-en_progreso { background: var(--inside-light-accent-soft, rgba(26, 107, 90, 0.10)); color: var(--inside-light-accent, #1a6b5a); }
