/* WebMind HelpDesk — complementos a Tailwind CDN (Quill, dock, HTML enriquecido) */

/* Neural Slate / detalle ticket (referencia diseño) */
.glass-panel {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.primary-gradient {
  background: linear-gradient(135deg, #2a85ff 0%, #005cbd 100%);
}
.ghost-border {
  outline: 1px solid rgba(193, 198, 214, 0.15);
  outline-offset: -1px;
}
.ambient-shadow {
  box-shadow: 0px 10px 40px rgba(25, 28, 30, 0.06);
}

:root {
  --color-brand-blue: #2a85ff;
  --color-tech-grey: #a6a6a6;
  --color-bg-main: #f8fafc;
  --color-bg-panel: #f0f1f3;
  --color-white: #ffffff;
  --priority-high: #9b443b;
  --priority-medium: #d4a373;
  --priority-low: #4f6d61;
  --text-main: #1a1c1e;
  --text-secondary: #6c757d;
  --font-sans: 'Manrope', system-ui, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
}

/* Quill — alineado con tema */
.quill-editor {
  background: var(--color-white);
  border-radius: 6px;
  border: 1px solid var(--color-tech-grey);
}
.quill-editor:focus-within {
  border: 2px solid var(--color-brand-blue);
}
.quill-editor .ql-toolbar {
  border-radius: 6px 6px 0 0;
  border-color: rgba(166, 166, 166, 0.5);
  font-family: var(--font-sans);
}
.quill-editor .ql-container {
  border-radius: 0 0 6px 6px;
  border-color: rgba(166, 166, 166, 0.5);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  min-height: 140px;
}
.quill-reply .ql-container {
  min-height: 100px;
  max-height: 220px;
  overflow-y: auto;
}

/* Menú ⋮ del ticket */
.ticket-more-menu > summary {
  list-style: none;
}
.ticket-more-menu > summary::-webkit-details-marker {
  display: none;
}

/* Editor respuesta (mockup: tarjeta blanca, toolbar + área + pie) */
.reply-composer-card .reply-toolbar-host.ql-toolbar {
  border: none;
  padding: 0;
  background: transparent;
}
.reply-composer-card .reply-toolbar-host .ql-formats {
  margin-right: 0;
  display: inline-flex;
  align-items: center;
}
.ticket-thread-scroll {
  -webkit-overflow-scrolling: touch;
}
.reply-composer-card .reply-toolbar-host button {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 0.375rem;
}
.reply-composer-card .reply-toolbar-host button:hover,
.reply-composer-card .reply-toolbar-host button.ql-active {
  color: #2563eb;
  background: #f8fafc;
}
.reply-composer-card .reply-toolbar-host .ql-stroke {
  stroke: currentColor;
}
.reply-composer-card .reply-toolbar-host .ql-fill {
  fill: currentColor;
}
.reply-composer-card .ql-container {
  border: none !important;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
}
.reply-composer-card .ql-editor {
  padding: 1rem 1.25rem;
  min-height: 5rem;
  max-height: 10rem;
  overflow-y: auto;
  color: rgb(51 65 85);
  font-size: 0.8125rem;
}
.reply-composer-card .ql-editor.ql-blank::before {
  color: rgb(203 213 225);
  font-style: normal;
  left: 1.25rem;
  right: 1.25rem;
}
.reply-quill-root .ql-container {
  border: none !important;
}

.ticket-description-html p,
.reply-body p {
  margin: 0 0 0.5rem;
}
.ticket-description-html ul,
.reply-body ul {
  margin: 0.35rem 0;
  padding-left: 1.25rem;
}
.reply-body img {
  max-width: 100%;
  height: auto;
}

/* Editor de respuesta: en flujo dentro de la columna detalle (no fixed → no tapa filtros/lista) */
.reply-editor-dock {
  position: relative;
  flex-shrink: 0;
  z-index: 5;
}

/* Workspace tickets: altura útil bajo topbar + scroll interno en md+ */
.ticket-workspace {
  width: 100%;
  min-height: 0;
}
@media (min-width: 768px) {
  .ticket-workspace {
    height: calc(100dvh - 4.25rem);
    max-height: calc(100dvh - 4.25rem);
  }
}
@media (max-width: 767px) {
  .ticket-workspace {
    max-height: calc(100dvh - 4.25rem);
    overflow: hidden;
  }
}

/* Columna 2: filtros colapsables */
.tickets-filters-aside {
  width: 100%;
  max-width: 18rem;
}
@media (min-width: 1024px) {
  .tickets-filters-aside {
    width: 17.5rem;
    max-width: 17.5rem;
  }
  .tickets-filters-aside[data-collapsed='1'] {
    width: 2.75rem !important;
    min-width: 2.75rem !important;
    max-width: 2.75rem !important;
  }
  .tickets-filters-aside[data-collapsed='1'] .tickets-filters-aside__bar {
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    border-bottom-color: transparent;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
}
@media (max-width: 1023px) {
  .tickets-filters-aside[data-collapsed='1'] {
    max-height: 2.75rem;
    overflow: hidden;
  }
}
.tickets-filters-aside[data-collapsed='1'] .tickets-filters-aside__title,
.tickets-filters-aside[data-collapsed='1'] .tickets-filters-aside__inner {
  display: none !important;
}
.tickets-filters-aside[data-collapsed='1'] .tickets-filters-aside__chevron {
  transform: rotate(180deg);
}
.ticket-list-panel-scroll {
  -webkit-overflow-scrolling: touch;
}

/* Toasts flash (entrada desde la derecha, sin desplazar el layout) */
.hd-flash-toast {
  position: fixed;
  top: max(1rem, calc(env(safe-area-inset-top, 0px) + 4.75rem));
  right: 1rem;
  z-index: 99990;
  max-width: min(22rem, calc(100vw - 2rem));
  box-sizing: border-box;
  transform: translateX(calc(100% + 1.5rem));
  opacity: 0;
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease;
  pointer-events: none;
}
/* Login: sin topbar fijo */
body.login-viewport .hd-flash-toast {
  top: max(1rem, calc(env(safe-area-inset-top, 0px) + 1rem));
}
.hd-flash-toast.hd-flash-toast--visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.hd-flash-toast.hd-flash-toast--leave {
  transform: translateX(calc(100% + 1.5rem));
  opacity: 0;
  pointer-events: none;
}

/* Modal vista previa adjuntos */
.hd-attachment-modal__frame {
  width: 100%;
  height: min(85vh, 56rem);
  border: 1px solid rgb(226 232 240);
  border-radius: 0.5rem;
  background: #fff;
}
.hd-attachment-modal__img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  max-height: min(85vh, 56rem);
  object-fit: contain;
}
