/**
 * Ticket markdown toolbar + attachment chrome — shared by
 * Abrir ticket (.hx-tk) and Ver ticket (.hx-vt).
 * Beats Hexa/city .btn-default (white text on light toolbar).
 */

.hx-tk .md-editor,
.hx-vt .md-editor {
  display: block;
  border: 1px solid var(--svc-border) !important;
  border-radius: 9px;
  overflow: hidden;
  background: var(--svc-surface);
  box-shadow: none !important;
}

.hx-tk .md-editor.active,
.hx-vt .md-editor.active {
  border-color: var(--svc-accent) !important;
  box-shadow: 0 0 0 3px rgba(31, 95, 168, 0.12) !important;
}

.hx-tk .md-editor > .md-header,
.hx-vt .md-editor > .md-header,
.hx-tk .md-editor .md-footer,
.hx-vt .md-editor .md-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 10px !important;
  background: var(--svc-soft) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--svc-border) !important;
  color: var(--svc-ink-2) !important;
}

.hx-tk .md-editor .md-footer,
.hx-vt .md-editor .md-footer {
  border-bottom: 0 !important;
  border-top: 1px solid var(--svc-border) !important;
  justify-content: flex-end;
}

.hx-tk .md-editor .md-header .btn-group,
.hx-vt .md-editor .md-header .btn-group {
  float: none;
  display: inline-flex;
  gap: 4px;
  margin: 0;
}

.hx-tk .md-editor .md-header .btn,
.hx-vt .md-editor .md-header .btn,
.hx-tk .md-editor .btn-default,
.hx-vt .md-editor .btn-default,
.hx-tk .md-editor .btn-primary,
.hx-vt .md-editor .btn-primary {
  float: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 32px;
  height: 30px;
  margin: 0;
  padding: 0 9px !important;
  border: 1px solid var(--svc-border) !important;
  border-radius: 7px !important;
  background: var(--svc-surface) !important;
  color: var(--svc-ink-2) !important;
  font-size: 13px !important;
  line-height: 1 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  opacity: 1 !important;
  /* Hexa .btn: uppercase + letter-spacing — trial sin tracking ni mayúsculas */
  letter-spacing: normal !important;
  text-transform: none !important;
}

.hx-tk .md-editor .md-header .btn .glyphicon,
.hx-vt .md-editor .md-header .btn .glyphicon,
.hx-tk .md-editor .md-header .btn .fas,
.hx-vt .md-editor .md-header .btn .fas,
.hx-tk .md-editor .md-header .btn .fal,
.hx-vt .md-editor .md-header .btn .fal,
.hx-tk .md-editor .md-header .btn .fa,
.hx-vt .md-editor .md-header .btn .fa {
  color: inherit !important;
  opacity: 1 !important;
}

.hx-tk .md-editor .md-header .btn:hover,
.hx-vt .md-editor .md-header .btn:hover,
.hx-tk .md-editor .md-header .btn:focus,
.hx-vt .md-editor .md-header .btn:focus {
  background: #eaf1f9 !important;
  border-color: #b7cce3 !important;
  color: var(--svc-accent) !important;
  outline: none;
}

.hx-tk .md-editor .md-header .btn:active,
.hx-vt .md-editor .md-header .btn:active,
.hx-tk .md-editor .md-header .btn.active,
.hx-vt .md-editor .md-header .btn.active {
  background: #eaf1f9 !important;
  border-color: var(--svc-accent) !important;
  color: var(--svc-accent) !important;
  box-shadow: none !important;
}

.hx-tk .md-editor .btn-primary,
.hx-vt .md-editor .btn-primary {
  background: var(--svc-accent) !important;
  border-color: var(--svc-accent) !important;
  color: #fff !important;
  font-weight: 600;
  padding: 0 12px !important;
}

.hx-tk .md-editor .btn-primary:hover,
.hx-vt .md-editor .btn-primary:hover,
.hx-tk .md-editor .btn-primary:focus,
.hx-vt .md-editor .btn-primary:focus,
.hx-tk .md-editor .btn-primary.active,
.hx-vt .md-editor .btn-primary.active {
  background: #1a528f !important;
  border-color: #1a528f !important;
  color: #fff !important;
}

.hx-tk .md-editor .md-controls,
.hx-vt .md-editor .md-controls {
  float: none;
  margin-left: auto;
  padding: 0;
}

.hx-tk .md-editor .md-controls .md-control,
.hx-vt .md-editor .md-controls .md-control {
  color: var(--svc-muted-2) !important;
  padding: 4px 6px;
}

.hx-tk .md-editor .md-controls .md-control:hover,
.hx-vt .md-editor .md-controls .md-control:hover {
  color: var(--svc-accent) !important;
  text-decoration: none;
}

.hx-tk .md-editor > textarea,
.hx-vt .md-editor > textarea,
.hx-tk .md-editor > .md-preview,
.hx-vt .md-editor > .md-preview {
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--svc-surface) !important;
  color: var(--svc-ink) !important;
  box-shadow: none !important;
  padding: 14px 16px !important;
  min-height: 180px;
  font-size: 14px;
  line-height: 1.55;
}

.hx-tk .md-editor > textarea:focus,
.hx-vt .md-editor > textarea:focus {
  background: var(--svc-surface) !important;
  box-shadow: none !important;
}

.hx-tk .md-editor > .md-preview,
.hx-vt .md-editor > .md-preview {
  border-top: 1px dashed var(--svc-border) !important;
  border-bottom: 1px dashed var(--svc-border) !important;
}

.hx-tk .markdown-editor-status,
.hx-vt .markdown-editor-status,
.hx-tk .markdown-editor-status .small-font,
.hx-vt .markdown-editor-status .small-font {
  color: var(--svc-muted-2) !important;
  font-size: 11px;
}

.hx-tk .markdown-editor-status .markdown-save,
.hx-vt .markdown-editor-status .markdown-save {
  color: #2a7549;
}

/* Attachments — legacy input-group (viewticket / old markup) + new hx-tk-file */
.hx-tk-attach .input-group {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  margin: 0;
}

.hx-tk-attach .input-group::before,
.hx-tk-attach .input-group::after {
  display: none !important;
  content: none !important;
}

.hx-tk-attach .input-group-btn,
.hx-tk-attach .input-group-append,
.hx-tk-attach .input-group-prepend {
  display: block;
  width: auto;
  font-size: inherit;
  white-space: nowrap;
  flex: 0 0 auto;
}

.hx-tk-attach .input-group .form-control {
  float: none;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  border-radius: 8px !important;
  border: 1px solid var(--svc-border) !important;
  background: var(--svc-surface) !important;
  color: var(--svc-muted) !important;
  box-shadow: none !important;
  height: 38px;
}

.hx-tk-attach .btn-default,
.hx-tk-attach .btn-file {
  background: var(--svc-soft) !important;
  border: 1px solid var(--svc-border) !important;
  color: var(--svc-ink-2) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  font-size: 13px;
  font-weight: 500;
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
  padding: 0 12px !important;
}

.hx-tk-attach .btn-default:hover,
.hx-tk-attach .btn-file:hover {
  background: #eaf1f9 !important;
  border-color: #b7cce3 !important;
  color: var(--svc-accent) !important;
}

html.dark .hx-tk .md-editor .md-header .btn:hover,
html.dark .hx-vt .md-editor .md-header .btn:hover,
html.dark .hx-tk .md-editor .md-header .btn:focus,
html.dark .hx-vt .md-editor .md-header .btn:focus,
html.dark .hx-tk .md-editor .md-header .btn:active,
html.dark .hx-vt .md-editor .md-header .btn:active,
html.dark .hx-tk .md-editor .md-header .btn.active,
html.dark .hx-vt .md-editor .md-header .btn.active {
  background: rgba(31, 95, 168, 0.22) !important;
  border-color: rgba(31, 95, 168, 0.45) !important;
  color: #8eb7e4 !important;
}

html.dark .hx-tk .md-editor .btn-primary,
html.dark .hx-vt .md-editor .btn-primary,
html.dark .hx-tk .md-editor .btn-primary:hover,
html.dark .hx-vt .md-editor .btn-primary:hover,
html.dark .hx-tk .md-editor .btn-primary.active,
html.dark .hx-vt .md-editor .btn-primary.active {
  background: var(--svc-accent) !important;
  border-color: var(--svc-accent) !important;
  color: #fff !important;
}

html.dark .hx-tk-attach .btn-default,
html.dark .hx-tk-attach .btn-file {
  background: rgba(255, 255, 255, 0.04) !important;
}
