/* ============================================================
   SOPORTE — Estilos para usuario y admin
   ============================================================ */

.support-wrap,
.asup-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.support-topbar,
.asup-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--purple);
  border-radius: 12px;
}

.support-topbar h2,
.asup-topbar h3 {
  margin: 0;
}

.support-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ---------- TABS ---------- */
.support-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.support-tabs::-webkit-scrollbar { display: none; }

.sup-tab {
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all .2s;
}

.sup-tab:hover { color: var(--text); }
.sup-tab.active {
  color: var(--purple);
  border-bottom-color: var(--purple);
}

.sup-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 900;
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}

.sup-tab.active .sup-badge {
  background: rgba(187, 136, 255, .2);
  color: var(--purple);
}

/* ---------- LISTA TICKETS ---------- */
#sup-list,
.asup-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sup-card,
.asup-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all .2s;
  position: relative;
}

.sup-card:hover,
.asup-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.sup-card.no-leido,
.asup-card.no-leido {
  border-left: 4px solid var(--gold);
  background: linear-gradient(90deg, rgba(255, 204, 68, .05) 0%, var(--bg-1) 40%);
}

.sup-card.cerrado {
  opacity: .65;
}

.sup-card-header,
.asup-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.sup-card-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.sup-card-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.sup-card-asunto,
.asup-card-asunto {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sup-card-meta,
.asup-card-meta {
  font-size: 11px;
  color: var(--text-dim);
}

.sup-card-badges,
.asup-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.sup-badge-pri,
.sup-badge-status {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid currentColor;
  white-space: nowrap;
  letter-spacing: .3px;
}

.sup-badge-new {
  font-size: 9px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--gold);
  color: #1a1a1a;
  letter-spacing: .5px;
  animation: supPulse 2s ease-in-out infinite;
}

@keyframes supPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}

.sup-card-footer,
.asup-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.sup-card-msgs {
  font-size: 11px;
  color: var(--text-dim);
}

/* ---------- EMPTY ---------- */
.support-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.support-empty h3 {
  font-size: 16px;
  color: var(--text);
  margin: 12px 0 6px;
}
.support-empty p {
  font-size: 13px;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ---------- CHAT ---------- */
.sup-chat {
  flex: 1;
  overflow-y: auto;
  padding: 12px 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 220px;
  max-height: 45vh;
  background: rgba(0, 0, 0, .15);
  border-radius: 10px;
  margin: 10px 0;
  -webkit-overflow-scrolling: touch;
}

.sup-chat::-webkit-scrollbar { width: 6px; }
.sup-chat::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.sup-msg {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 85%;
  align-self: flex-start;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.sup-msg.user {
  background: rgba(128, 224, 255, .08);
  border: 1px solid rgba(128, 224, 255, .2);
  border-bottom-left-radius: 4px;
}

.sup-msg.staff {
  background: rgba(187, 136, 255, .1);
  border: 1px solid rgba(187, 136, 255, .3);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.sup-msg-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 11px;
}

.sup-msg.staff .sup-msg-head b { color: var(--purple); }
.sup-msg.user .sup-msg-head b { color: var(--accent-2); }

.sup-msg-time {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.sup-msg-body {
  color: var(--text);
  white-space: pre-wrap;
}

/* ---------- INPUT BAR ---------- */
.sup-input-bar {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.sup-input-bar input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.sup-input-bar input:focus { border-color: var(--accent-2); }

/* ---------- ADMIN SUPPORT ---------- */
.asup-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.asup-stat {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.asup-stat.green { border-color: rgba(64, 208, 144, .35); }
.asup-stat.gold  { border-color: rgba(255, 204, 68, .35); }
.asup-stat.red   { border-color: rgba(255, 85, 102, .35); }

.asup-stat-num {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.asup-stat-lbl {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
  font-weight: 700;
}

.asup-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 700px) {
  .support-topbar,
  .asup-topbar { flex-direction: column; align-items: stretch; }
  .support-topbar h2 { font-size: 18px; }

  .sup-card-header,
  .asup-card-header { flex-direction: column; }

  .sup-card-footer,
  .asup-card-footer { flex-direction: column; }
  .sup-card-footer .btn,
  .asup-card-footer .btn { width: 100%; }

  .sup-badge-pri,
  .sup-badge-status { font-size: 9px; padding: 2px 6px; }

  .sup-msg { max-width: 92%; }

  .asup-stats { grid-template-columns: repeat(2, 1fr); }
  .asup-filters { flex-direction: column; align-items: stretch; }
  .asup-filters .as-input { width: 100%; min-width: auto; }
  .asup-filters .btn { width: 100%; }

  .sup-chat { max-height: 40vh; min-height: 180px; }

  .sup-input-bar { flex-wrap: wrap; }
  .sup-input-bar input { width: 100%; }
  .sup-input-bar .btn { flex: 1; }
}