/* ============================================================
   modules.css — Panter Studio
   Módulos: Font Awesome · Roles/Badges · Personal · Soporte · Admin
   Se carga después de style.css para no alterar la base visual.
   ============================================================ */

/* ── Tipografía: tildes/ñ consistentes ─────────────────────── */
:root {
    --font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-display: 'Inter', 'Moderniz', 'Segoe UI', system-ui, sans-serif;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body,
button,
input,
select,
textarea,
optgroup {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.nav-logo span,
.staff-name,
.team-simple-header h1,
.sp-card-title,
.admin-card h3 {
    font-family: 'Inter', 'Moderniz', 'Segoe UI', system-ui, sans-serif;
    font-synthesis: none;
}

/* Los glyphs acentuados deben usar la misma métrica que el resto. */
:lang(es) {
    font-variant-ligatures: normal;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

/* ── Font Awesome: alineación base ─────────────────────────── */
.fa-solid,
.fa-regular,
.fa-brands,
.fas,
.far,
.fab {
    line-height: 1;
    vertical-align: -0.075em;
}

.ps-icon-gap {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
}

/* ── Badges de rol (estilo GTAHUB) ─────────────────────────── */
.ps-role-badge,
.auth-role-badge.ps-role-badge-host .ps-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    line-height: 1.25;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--ps-role-color, #94a3b8);
    background: var(--ps-role-bg, rgba(148, 163, 184, 0.12));
    border: 1px solid var(--ps-role-border, rgba(148, 163, 184, 0.3));
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08) inset;
}

.ps-role-badge i {
    font-size: 0.72em;
}

.ps-role-badge-host {
    display: inline-flex;
    padding: 0 !important;
    background: none !important;
    box-shadow: none !important;
    border-radius: 999px;
}

.auth-role-badge.ps-role-badge-host {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.ps-role-badge-nav {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fallback por si el badge se construye sólo con clases (paleta oficial).
   Las variables en línea que imprime roles.js#badgeHtml mandan siempre;
   si no hay inline, se usa la paleta global de role-colors.js y, como
   último recurso, el hexadecimal oficial de cada rango. Así el texto de
   Administrador es rojo (#ff0000), nunca amarillo. */
.ps-role-admin_owner,
.ps-role-founder_ceo {
    color: var(--ps-role-color, var(--ps-role-founder_ceo, #f1c40f));
    background: var(--ps-role-bg, var(--ps-role-founder_ceo-bg, rgba(241, 196, 15, 0.12)));
    border-color: var(--ps-role-border, var(--ps-role-founder_ceo-border, rgba(241, 196, 15, 0.35)));
}
.ps-role-administrador,
.ps-role-director {
    color: var(--ps-role-color, var(--ps-role-administrador, #ff0000));
    background: var(--ps-role-bg, var(--ps-role-administrador-bg, rgba(255, 0, 0, 0.12)));
    border-color: var(--ps-role-border, var(--ps-role-administrador-border, rgba(255, 0, 0, 0.35)));
}
.ps-role-programador {
    color: var(--ps-role-color, var(--ps-role-programador, #ffbc00));
    background: var(--ps-role-bg, var(--ps-role-programador-bg, rgba(255, 188, 0, 0.12)));
    border-color: var(--ps-role-border, var(--ps-role-programador-border, rgba(255, 188, 0, 0.35)));
}
.ps-role-modelador {
    color: var(--ps-role-color, var(--ps-role-modelador, #6f5cff));
    background: var(--ps-role-bg, var(--ps-role-modelador-bg, rgba(111, 92, 255, 0.12)));
    border-color: var(--ps-role-border, var(--ps-role-modelador-border, rgba(111, 92, 255, 0.35)));
}
.ps-role-moderador {
    color: var(--ps-role-color, var(--ps-role-moderador, #e67e22));
    background: var(--ps-role-bg, var(--ps-role-moderador-bg, rgba(230, 126, 34, 0.12)));
    border-color: var(--ps-role-border, var(--ps-role-moderador-border, rgba(230, 126, 34, 0.35)));
}
.ps-role-soporte {
    color: var(--ps-role-color, var(--ps-role-soporte, #00a715));
    background: var(--ps-role-bg, var(--ps-role-soporte-bg, rgba(0, 167, 21, 0.12)));
    border-color: var(--ps-role-border, var(--ps-role-soporte-border, rgba(0, 167, 21, 0.35)));
}
.ps-role-creador_contenido {
    color: var(--ps-role-color, var(--ps-role-creador_contenido, #9d00ff));
    background: var(--ps-role-bg, var(--ps-role-creador_contenido-bg, rgba(157, 0, 255, 0.12)));
    border-color: var(--ps-role-border, var(--ps-role-creador_contenido-border, rgba(157, 0, 255, 0.35)));
}
.ps-role-vip {
    color: var(--ps-role-color, var(--ps-role-vip, #ff7ddf));
    background: var(--ps-role-bg, var(--ps-role-vip-bg, rgba(255, 125, 223, 0.12)));
    border-color: var(--ps-role-border, var(--ps-role-vip-border, rgba(255, 125, 223, 0.35)));
}
.ps-role-usuario {
    color: var(--ps-role-color, var(--ps-role-usuario, #0055ff));
    background: var(--ps-role-bg, var(--ps-role-usuario-bg, rgba(0, 85, 255, 0.12)));
    border-color: var(--ps-role-border, var(--ps-role-usuario-border, rgba(0, 85, 255, 0.3)));
}

/* Nav: el nombre no debe romper el layout con badges largos. */
.nav-user-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-user-pill {
    max-width: min(92vw, 360px);
}

/* ── Página Personal / Equipo ──────────────────────────────── */
.ps-team-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 auto 2rem;
    max-width: 900px;
}

.ps-team-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(22, 27, 40, 0.7);
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ps-team-filter:hover {
    border-color: rgba(0, 176, 255, 0.4);
    color: #e2e8f0;
    transform: translateY(-1px);
}

.ps-team-filter.active {
    color: #7dd3fc;
    border-color: rgba(0, 176, 255, 0.55);
    background: rgba(0, 176, 255, 0.12);
    box-shadow: 0 0 18px rgba(0, 176, 255, 0.12);
}

.ps-team-count {
    margin-left: 0.35rem;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.68rem;
    background: rgba(255, 255, 255, 0.07);
}

.ps-team-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1.25rem;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: #94a3b8;
    background: rgba(22, 27, 40, 0.5);
}

.ps-team-empty i {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: #38bdf8;
}

.staff-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)) !important;
}

.staff-card {
    min-width: 0;
}

.avatar-frame {
    overflow: visible;
}

.avatar-frame > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.avatar-frame > i {
    font-size: 2.2rem;
}

.ps-presence {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid #161b28;
    background: #64748b;
}

.ps-presence.online {
    background: #4ade80;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.75);
}

.ps-presence.offline {
    background: #64748b;
}

.staff-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.staff-desc {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.staff-meta .meta-label,
.staff-meta .meta-value {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.staff-meta .meta-label i {
    color: #38bdf8;
    font-size: 0.8em;
}

.status-offline {
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-offline .status-dot {
    background-color: #64748b;
    box-shadow: none;
}

.ps-staff-edit-btn {
    margin-top: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 7px 13px;
    border-radius: 9px;
    border: 1px solid rgba(0, 176, 255, 0.3);
    background: rgba(0, 176, 255, 0.08);
    color: #7dd3fc;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 200ms ease;
}

.ps-staff-edit-btn:hover {
    background: rgba(0, 176, 255, 0.18);
    border-color: rgba(0, 176, 255, 0.6);
}

.ps-staff-editor {
    width: 100%;
    margin-top: 0.9rem;
    padding: 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 176, 255, 0.22);
    background: rgba(9, 13, 23, 0.7);
    text-align: left;
    display: grid;
    gap: 0.55rem;
}

.ps-staff-editor label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.ps-staff-editor input,
.ps-staff-editor textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.8);
    color: #e2e8f0;
    font-size: 0.82rem;
    resize: vertical;
}

.ps-staff-editor-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.ps-btn-mini {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    transition: all 180ms ease;
}

.ps-btn-mini:hover { border-color: rgba(0, 176, 255, 0.45); color: #e2e8f0; }
.ps-btn-mini.primary { border-color: rgba(34, 197, 94, 0.45); background: rgba(34, 197, 94, 0.12); color: #86efac; }
.ps-btn-mini.danger  { border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.1); color: #fca5a5; }

/* ── Soporte: iconos y panel staff ─────────────────────────── */
.cat-icon i,
.ticket-card-icon i,
.sp-tab i,
.sp-card-title i {
    pointer-events: none;
}

.ticket-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}

.sp-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.ps-staff-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 1rem;
}

.ps-staff-toolbar input,
.ps-staff-toolbar select {
    padding: 9px 12px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.75);
    color: #e2e8f0;
    font-size: 0.82rem;
}

.ps-staff-toolbar input { flex: 1 1 190px; min-width: 0; }

.ps-staff-ticket-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.55rem;
}

.ps-ticket-user {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #94a3b8;
    font-size: 0.76rem;
}

.ps-ticket-user i { color: #38bdf8; }

.ps-support-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #94a3b8;
}

.ps-support-stat i { color: #38bdf8; }

/* ── Nav en tablets: evita desbordamiento horizontal ────────── */
@media (max-width: 1180px) and (min-width: 769px) {
    .nav-middle {
        gap: 0.25rem;
        padding: 0 0.35rem;
        min-width: 0;
    }

    nav a,
    .nav-dropdown-toggle {
        padding: 0.55rem 0.5rem;
        font-size: 0.86rem;
    }

    nav { gap: 0.35rem; }
}

@media (max-width: 720px) {
    .ps-staff-toolbar { flex-direction: column; align-items: stretch; }
    .ps-staff-toolbar input,
    .ps-staff-toolbar select,
    .ps-staff-toolbar .ps-btn-mini { width: 100%; justify-content: center; }
    .ps-staff-ticket-actions .ps-btn-mini { flex: 1 1 100%; justify-content: center; }
    .ps-role-badge { font-size: 0.6rem; padding: 2px 7px; }
    .nav-user-name { max-width: 92px; }
    .ps-role-badge-nav { max-width: 110px; }
}

/* ── Admin: gestor de personal / mapeo Discord ─────────────── */
.ps-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 1rem;
}

.ps-admin-staff-card {
    display: grid;
    gap: 0.55rem;
    padding: 1rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.55);
}

.ps-admin-staff-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.ps-admin-staff-head img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0, 176, 255, 0.35);
    flex: 0 0 auto;
}

.ps-admin-staff-head strong {
    display: block;
    color: #f8fafc;
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-admin-staff-head small {
    display: block;
    color: #64748b;
    font-size: 0.7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-admin-staff-card label {
    display: grid;
    gap: 0.25rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

.ps-admin-staff-card input,
.ps-admin-staff-card select,
.ps-admin-staff-card textarea {
    width: 100%;
    padding: 7px 9px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(9, 13, 23, 0.75);
    color: #e2e8f0;
    font-size: 0.8rem;
    resize: vertical;
}

.ps-admin-staff-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.2rem;
}

.ps-admin-staff-actions .btn {
    flex: 1 1 44%;
    justify-content: center;
    font-size: 0.72rem;
    padding: 7px 10px;
}

.ps-admin-staff-card[data-local="true"] {
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.05);
}

.ps-admin-local-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 100px;
    border: 1px solid rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ps-staff-card-meta {
    display: grid;
    gap: 3px;
}

.ps-staff-card-meta small {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 0.72rem;
}

.ps-discord-map {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.ps-discord-map h4 {
    margin-bottom: 0.35rem;
    color: #40c4ff;
    font-size: 0.95rem;
}

.ps-discord-map p {
    margin-bottom: 0.85rem;
    color: #94a3b8;
    font-size: 0.8rem;
}

.ps-discord-map textarea {
    width: 100%;
    min-height: 130px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(9, 13, 23, 0.75);
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.55;
    resize: vertical;
}

.ps-field-help {
    display: block;
    margin-top: 0.35rem;
    color: #64748b;
    font-size: 0.72rem;
    line-height: 1.45;
}

/* ── Admin: selector de usuario y gestor de roles ──────────── */
.ps-staff-picker {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 14px;
    border: 1px solid rgba(0, 176, 255, 0.18);
    background: rgba(0, 176, 255, 0.04);
}

.ps-staff-picker > label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

.ps-staff-picker-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ps-staff-picker-row select {
    flex: 1 1 260px;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(9, 13, 23, 0.8);
    color: #e2e8f0;
    font-size: 0.82rem;
}

.ps-staff-picker-row .btn {
    flex: 0 0 auto;
    font-size: 0.74rem;
    padding: 8px 12px;
}

.ps-admin-subtitle {
    margin: 1.5rem 0 0;
    color: #40c4ff;
    font-size: 1rem;
}

.ps-role-manager {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.ps-role-manager-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.ps-role-manager-head h4 {
    margin: 0 0 0.25rem;
    color: #40c4ff;
    font-size: 1rem;
}

.ps-role-manager-head p {
    margin: 0;
    max-width: 720px;
    color: #94a3b8;
    font-size: 0.8rem;
    line-height: 1.5;
}

.ps-role-manager-list {
    display: grid;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.ps-role-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.55);
    border-left: 4px solid var(--ps-role-item-color, #64748b);
}

.ps-role-item.is-custom {
    border-style: dashed;
    border-left-style: solid;
}

.ps-role-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    flex: 0 0 auto;
    color: #0b0f17;
    font-size: 0.95rem;
    box-shadow: 0 0 18px var(--ps-role-item-color, rgba(148, 163, 184, 0.25));
}

.ps-role-item-info {
    flex: 1 1 220px;
    min-width: 0;
}

.ps-role-item-info strong {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    color: #f8fafc;
    font-size: 0.88rem;
}

.ps-role-item-info small {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-role-item-rank {
    color: #94a3b8;
    font-size: 0.66rem;
    font-weight: 700;
}

.ps-role-custom-pill {
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.12);
    color: #d8b4fe;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ps-role-item-perms {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.ps-role-perm {
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #64748b;
    font-size: 0.6rem;
    font-weight: 700;
}

.ps-role-perm.active {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}

.ps-role-item-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ps-role-item-actions .btn {
    font-size: 0.68rem;
    padding: 6px 9px;
}

.ps-role-editor {
    padding: 1rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(9, 13, 23, 0.5);
}

.ps-role-editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 0.75rem;
}

.ps-role-editor-grid label {
    display: grid;
    gap: 0.25rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

.ps-role-editor-grid input,
.ps-role-editor-grid select {
    width: 100%;
    padding: 7px 9px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(9, 13, 23, 0.75);
    color: #e2e8f0;
    font-size: 0.8rem;
}

.ps-role-editor-grid input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ps-role-editor-wide {
    grid-column: 1 / -1;
}

.ps-role-color-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.ps-role-color-row input[type="color"] {
    width: 42px;
    min-width: 42px;
    height: 34px;
    padding: 2px;
    cursor: pointer;
}

.ps-role-permissions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0.9rem 0 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.ps-role-permissions legend {
    padding: 0 0.4rem;
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ps-role-permissions label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #cbd5e1;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
}

.ps-role-permissions input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #00b0ff;
    cursor: pointer;
}

/* ── Gate de acceso con Discord (index.html) ───────────────── */
html.ps-auth-locked,
html.ps-auth-locked body {
    overflow: hidden !important;
    height: 100%;
    overscroll-behavior: none;
}

.ps-auth-gate {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 2.5rem);
    overflow-y: auto;
    background: rgba(4, 7, 13, 0.82);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    backdrop-filter: blur(14px) saturate(120%);
    animation: ps-gate-fade 0.35s ease both;
}

.ps-auth-gate[hidden] {
    display: none !important;
}

.ps-auth-gate-backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 0%, rgba(0, 176, 255, 0.16), transparent 55%),
        radial-gradient(circle at 80% 90%, rgba(88, 101, 242, 0.16), transparent 50%),
        radial-gradient(circle at 10% 80%, rgba(16, 185, 129, 0.1), transparent 55%);
}

.ps-auth-gate-card {
    position: relative;
    width: min(440px, 100%);
    padding: clamp(1.6rem, 5vw, 2.4rem);
    border-radius: 26px;
    border: 1px solid rgba(0, 210, 255, 0.22);
    background:
        linear-gradient(180deg, rgba(13, 20, 34, 0.96), rgba(8, 12, 22, 0.97));
    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.75),
        0 0 40px rgba(0, 176, 255, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    text-align: center;
    overflow: hidden;
    animation: ps-gate-rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.ps-auth-gate-glow {
    position: absolute;
    top: -140px;
    left: 50%;
    width: 320px;
    height: 320px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.28), transparent 65%);
    pointer-events: none;
    animation: ps-gate-pulse 5s ease-in-out infinite;
}

.ps-auth-gate-logo {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 0.9rem;
}

.ps-auth-gate-logo img {
    width: 92px;
    height: 92px;
    object-fit: contain;
    filter: drop-shadow(0 0 22px rgba(0, 210, 255, 0.55));
    animation: ps-gate-float 6s ease-in-out infinite;
}

.ps-auth-gate-kicker {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.55rem;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0, 210, 255, 0.3);
    background: rgba(0, 176, 255, 0.08);
    color: #67e8f9;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.ps-auth-gate-kicker .fa-discord {
    color: #8ea1ff;
    font-size: 0.8rem;
}

.ps-auth-gate-card h1 {
    position: relative;
    margin: 0 0 0.6rem;
    font-family: var(--font-display, 'Inter', sans-serif);
    font-size: clamp(1.35rem, 4vw, 1.8rem);
    font-weight: 900;
    line-height: 1.18;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.ps-auth-gate-text {
    position: relative;
    margin: 0 auto 1.2rem;
    max-width: 34ch;
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.6;
}

.ps-auth-gate-text strong {
    color: #e2e8f0;
    font-weight: 700;
}

.ps-auth-gate-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0 0 1.1rem;
    padding: 0.65rem 0.8rem;
    border-radius: 16px;
    border: 1px solid rgba(0, 210, 255, 0.18);
    background: rgba(0, 176, 255, 0.07);
    text-align: left;
}

.ps-auth-gate-profile[hidden] {
    display: none !important;
}

.ps-auth-gate-profile img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(0, 210, 255, 0.45);
    object-fit: cover;
    flex: 0 0 auto;
    background: #0b1220;
}

.ps-auth-gate-profile-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ps-auth-gate-profile-info strong {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-auth-gate-profile-info .ps-role-badge {
    align-self: flex-start;
}

.ps-auth-gate-actions {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ps-auth-gate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.ps-auth-gate-btn[hidden] {
    display: none !important;
}

.ps-auth-gate-btn:focus-visible {
    outline: 2px solid #67e8f9;
    outline-offset: 3px;
}

.ps-auth-gate-btn-discord {
    background: linear-gradient(135deg, #5865F2, #4752c4);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 26px rgba(88, 101, 242, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.ps-auth-gate-btn-discord:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 34px rgba(88, 101, 242, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.ps-auth-gate-btn-discord:active {
    transform: translateY(0);
}

.ps-auth-gate-btn-discord:disabled {
    cursor: default;
    opacity: 0.75;
    transform: none;
}

.ps-auth-gate-btn-ghost {
    background: rgba(0, 176, 255, 0.06);
    border-color: rgba(0, 210, 255, 0.28);
    color: #7dd3fc;
}

.ps-auth-gate-btn-ghost:hover {
    background: rgba(0, 176, 255, 0.14);
    border-color: rgba(0, 210, 255, 0.5);
    color: #e0f2fe;
    transform: translateY(-1px);
}

.ps-auth-gate-link {
    align-self: center;
    margin-top: 0.15rem;
    padding: 4px 6px;
    border: none;
    background: none;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.18s ease;
}

.ps-auth-gate-link:hover {
    color: #94a3b8;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ps-auth-gate-link[hidden] {
    display: none !important;
}

.ps-auth-gate-status {
    position: relative;
    min-height: 1.1em;
    margin: 0.85rem 0 0;
    color: #67e8f9;
    font-size: 0.78rem;
    line-height: 1.5;
}

.ps-auth-gate-foot {
    position: relative;
    margin: 0.9rem 0 0;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: #475569;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
}

.ps-auth-gate-spinner {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 0.2rem 0 0.9rem;
}

.ps-auth-gate-spinner[hidden] {
    display: none !important;
}

.ps-auth-gate-spinner span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22d3ee;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.7);
    animation: ps-gate-dot 1.1s ease-in-out infinite;
}

.ps-auth-gate-spinner span:nth-child(2) { animation-delay: 0.15s; }
.ps-auth-gate-spinner span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ps-gate-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ps-gate-rise {
    from { opacity: 0; transform: translateY(16px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ps-gate-pulse {
    0%, 100% { opacity: 0.65; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.95; transform: translateX(-50%) scale(1.08); }
}

@keyframes ps-gate-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes ps-gate-dot {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
    40% { transform: translateY(-5px); opacity: 1; }
}

@media (max-width: 480px) {
    .ps-auth-gate {
        padding: 0.9rem;
        align-items: center;
    }

    .ps-auth-gate-card {
        border-radius: 20px;
        padding: 1.4rem 1.1rem;
    }

    .ps-auth-gate-logo img {
        width: 72px;
        height: 72px;
    }

    .ps-auth-gate-text {
        font-size: 0.85rem;
    }
}

/* ── Accesibilidad / movimiento reducido ───────────────────── */
@media (prefers-reduced-motion: reduce) {
    .ps-team-filter,
    .ps-staff-edit-btn,
    .ps-btn-mini,
    .staff-card {
        transition: none !important;
    }

    .ps-auth-gate,
    .ps-auth-gate-card,
    .ps-auth-gate-logo img,
    .ps-auth-gate-glow,
    .ps-auth-gate-spinner span {
        animation: none !important;
    }
}
