/**
 * Abrir ticket — Paginas Internas 2 (hx-tk)
 */

.hx-tk {
  --svc-accent: #1f5fa8;
  --svc-ink: #111a24;
  --svc-ink-2: #2c3d52;
  --svc-muted: #5d6c80;
  --svc-muted-2: #8d9aab;
  --svc-border: #e3e8ee;
  --svc-line: #f0f3f7;
  --svc-surface: #ffffff;
  --svc-soft: #f5f9fd;
  --svc-radius: 16px;
  --svc-shadow: 0 1px 2px rgba(16, 26, 40, 0.05);
  margin: 8px 0 40px;
  color: var(--svc-ink);
}

html.dark .hx-tk {
  --svc-ink: #e8edf4;
  --svc-ink-2: #c5ced8;
  --svc-muted: #9aa8b8;
  --svc-muted-2: #7a8799;
  --svc-border: #3a4454;
  --svc-line: #2a3140;
  --svc-surface: #1c212b;
  --svc-soft: #161b24;
  --svc-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.hx-tk__head { margin-bottom: 22px; }

.hx-tk__intro {
  margin: 0;
  font-size: 14px;
  color: var(--svc-muted);
  max-width: 620px;
  line-height: 1.55;
}

.hx-tk-card {
  background: var(--svc-surface);
  border-radius: var(--svc-radius);
  padding: 26px 28px;
  box-shadow: var(--svc-shadow);
  margin-bottom: 16px;
}

.hx-tk-section__label {
  font-size: 11px;
  color: var(--svc-muted-2);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 16px;
}

.hx-tk-depts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.hx-tk-dept {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 17px 18px;
  border-radius: 12px;
  background: var(--svc-surface);
  box-shadow: inset 0 0 0 1px var(--svc-border);
  text-decoration: none !important;
  color: inherit !important;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}

.hx-tk-dept:hover {
  background: var(--svc-soft);
  box-shadow: inset 0 0 0 1.5px var(--svc-accent);
}

.hx-tk-dept__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eaf1f9;
  color: #1f5fa8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
}

html.dark .hx-tk-dept__icon { background: #1a2838; }

.hx-tk-dept__body { flex: 1; min-width: 0; }

.hx-tk-dept__name {
  font-size: 14px;
  font-weight: 600;
}

.hx-tk-dept__desc {
  font-size: 12.5px;
  color: var(--svc-muted);
  line-height: 1.55;
  margin-top: 8px;
}

.hx-tk-dept__chev {
  color: var(--svc-muted-2);
  margin-top: 8px;
}

.hx-tk-empty {
  grid-column: 1 / -1;
  padding: 20px;
  text-align: center;
  color: var(--svc-muted);
}

.hx-tk-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

.hx-tk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.hx-tk-grid--name.is-hidden { display: none; }

.hx-tk-field {
  margin-bottom: 16px;
}

.hx-tk-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--svc-muted);
  margin-bottom: 6px;
}

.hx-tk-field__hint {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--svc-muted-2);
  line-height: 1.45;
}

/* Custom fields (incl. AJAX refresh that may still emit .form-group) */
#customFieldsContainer .form-group {
  margin-bottom: 16px;
}

#customFieldsContainer .form-group > label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--svc-muted);
  margin-bottom: 6px;
}

.hx-tk-field .form-control,
.hx-tk-field select,
.hx-tk-field textarea,
.hx-tk-field input[type="text"],
.hx-tk-field input[type="email"],
.hx-tk-field input[type="tel"],
.hx-tk-field input[type="number"],
.hx-tk-field input[type="password"],
#customFieldsContainer .form-control,
#customFieldsContainer select,
#customFieldsContainer textarea,
#customFieldsContainer input[type="text"],
#customFieldsContainer input[type="email"],
#customFieldsContainer input[type="tel"],
#customFieldsContainer input[type="number"],
#customFieldsContainer input[type="password"] {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 9px !important;
  border: 1px solid var(--svc-border) !important;
  background: var(--svc-surface) !important;
  color: var(--svc-ink) !important;
  min-height: 42px;
  padding: 10px 14px !important;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: none !important;
}

.hx-tk-field .form-control:focus,
.hx-tk-field select:focus,
.hx-tk-field textarea:focus,
.hx-tk-field input:focus,
#customFieldsContainer .form-control:focus,
#customFieldsContainer select:focus,
#customFieldsContainer textarea:focus,
#customFieldsContainer input:focus {
  border-color: var(--svc-accent) !important;
  box-shadow: 0 0 0 3px rgba(31, 95, 168, 0.12) !important;
  outline: none;
}

.hx-tk-field textarea.form-control,
#customFieldsContainer textarea.form-control {
  min-height: 180px;
  padding: 12px 14px !important;
}

.hx-tk-priority {
  display: flex;
  gap: 8px;
}

.hx-tk-priority__opt {
  flex: 1;
  margin: 0;
  cursor: pointer;
}

.hx-tk-priority__opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hx-tk-priority__opt span {
  display: block;
  text-align: center;
  border-radius: 8px;
  padding: 11px 0;
  font-size: 13px;
  color: var(--svc-ink-2);
  box-shadow: inset 0 0 0 1px #dbe2ea;
  background: var(--svc-surface);
}

html.dark .hx-tk-priority__opt span {
  box-shadow: inset 0 0 0 1px var(--svc-border);
}

.hx-tk-priority__opt input:checked + span {
  background: #111a24;
  color: #fff;
  font-weight: 500;
  box-shadow: none;
}

html.dark .hx-tk-priority__opt input:checked + span {
  background: #e8edf4;
  color: #111a24;
}

.hx-tk-attach__hint {
  font-size: 12px;
  color: var(--svc-muted-2);
  margin-top: 8px;
  line-height: 1.45;
}

.hx-tk-file {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hx-tk-file__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--svc-soft);
  box-shadow: inset 0 0 0 1px var(--svc-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--svc-ink-2);
  cursor: pointer;
  line-height: 1.2;
}

.hx-tk-file__btn:hover {
  background: #eaf1f9;
  color: var(--svc-accent);
  box-shadow: inset 0 0 0 1px #b7cce3;
}

html.dark .hx-tk-file__btn {
  background: rgba(255, 255, 255, 0.04);
}

.hx-tk-file__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.hx-tk-file__name {
  flex: 1 1 auto;
  min-width: 120px;
  font-size: 12.5px;
  color: var(--svc-muted-2);
}

.hx-tk-file__more {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--svc-accent);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}

.hx-tk-file__more:hover {
  color: #174a86;
}

.hx-tk-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.hx-tk-submit {
  background: var(--svc-accent);
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 13px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.hx-tk-submit:hover { filter: brightness(0.92); }

.hx-tk-back {
  font-size: 13px;
  color: var(--svc-muted) !important;
  text-decoration: none !important;
}

.hx-tk-side { position: sticky; top: 98px; }

.hx-tk-side__title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.hx-tk-tips {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--svc-muted);
  line-height: 1.65;
}

.hx-tk-side__link {
  display: block;
  font-size: 13.5px;
  color: var(--svc-accent) !important;
  text-decoration: none !important;
  padding: 8px 0;
  border-bottom: 1px solid var(--svc-line);
}

.hx-tk-side__link:last-child { border-bottom: 0; }

.hx-tk-kb-inline {
  background: var(--svc-soft);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13px;
}

@media (max-width: 991px) {
  .hx-tk-layout,
  .hx-tk-depts,
  .hx-tk-grid {
    grid-template-columns: 1fr;
  }

  .hx-tk-side { position: static; }

  .hx-tk-priority { flex-direction: column; }
}
