/* ==========================================================================
   PORTAL OFICIAL DE SOPORTE & APELACIONES - OASIS
   Diseño de Vanguardia: Glassmorphism, Micro-interacciones y Chat en Vivo
   ========================================================================== */

:root {
    --bg-dark: #070A10;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --bg-input: rgba(11, 17, 32, 0.85);
    
    --primary-cyan: #00E5FF;
    --primary-cyan-glow: rgba(0, 229, 255, 0.25);
    --primary-cyan-subtle: rgba(0, 229, 255, 0.08);
    
    --accent-blue: #3B82F6;
    --accent-purple: #8B5CF6;
    --accent-red: #EF4444;
    --accent-green: #10B981;
    --accent-amber: #F59E0B;
    
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(0, 229, 255, 0.35);
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
    --shadow-cyan: 0 0 25px rgba(0, 229, 255, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Luces Ambientales de Fondo */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
}
.glow-1 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #00E5FF 0%, transparent 70%);
    top: -100px;
    left: -100px;
}
.glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #6366F1 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
}
.glow-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #0284C7 0%, transparent 70%);
    top: 40%;
    left: 35%;
}

/* Utilidades Glassmorphism */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
}

.view-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   PANTALLA 1: LOGIN HERO
   ========================================================================== */
.public-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
    object-fit: cover;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #FFF 30%, var(--primary-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    line-height: 1.1;
}

.brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary-cyan);
    letter-spacing: 1.5px;
}

.login-hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.login-card {
    max-width: 680px;
    width: 100%;
    padding: 48px;
    text-align: center;
    border-radius: 28px;
    border: 1px solid rgba(0, 229, 255, 0.15);
    animation: fadeInScale 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--primary-cyan-subtle);
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-cyan);
    letter-spacing: 1px;
    margin-bottom: 24px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-cyan);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 229, 255, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); }
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 36px;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    text-align: left;
    margin-bottom: 36px;
}

@media (min-width: 600px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feature-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 18px 16px;
    transition: all 0.25s ease;
}

.feature-item:hover {
    border-color: rgba(0, 229, 255, 0.3);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}

.feature-icon {
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.feature-content h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-main);
}

.feature-content p {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.4;
}

.login-action-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.btn-discord {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 360px;
    padding: 16px 28px;
    background: linear-gradient(135deg, #5865F2, #4752C4);
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(88, 101, 242, 0.4);
    transition: all 0.25s ease;
}

.btn-discord:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(88, 101, 242, 0.6);
    background: linear-gradient(135deg, #6774F4, #5865F2);
}

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

.discord-icon {
    width: 24px;
    height: 24px;
}

.login-disclaimer {
    font-size: 0.75rem;
    color: var(--text-dim);
    max-width: 440px;
}

/* ==========================================================================
   PANTALLA 2: DASHBOARD
   ========================================================================== */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 28px;
    margin: 16px 24px 0 24px;
    border-radius: var(--radius-lg);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-small {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.nav-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    display: block;
    line-height: 1.1;
    color: var(--text-main);
}

.nav-subtitle {
    font-size: 0.72rem;
    color: var(--text-dim);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-profile-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-glass);
}

.user-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.1;
}

.user-id {
    font-size: 0.68rem;
    color: var(--text-dim);
    font-family: monospace;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.status-pill.status-clean {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.status-banned {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.4);
    animation: alertPulse 2s infinite;
}

.status-pill.status-muted {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

@keyframes alertPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
    50% { box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-dim);
    padding: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-logout:hover {
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

/* Cuerpo del Dashboard */
.dashboard-body {
    padding: 20px 24px 30px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    max-width: 1500px;
    margin: 0 auto;
    width: 100%;
}

/* Banner de Estado de Cuenta */
.account-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 22px 28px;
    border-radius: var(--radius-lg);
    transition: all 0.3s;
}

.account-banner.banner-clean {
    border-color: rgba(16, 185, 129, 0.2);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), var(--bg-card));
}

.account-banner.banner-banned {
    border-color: rgba(239, 68, 68, 0.35);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), var(--bg-card));
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.15);
}

.account-banner.banner-muted {
    border-color: rgba(245, 158, 11, 0.35);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), var(--bg-card));
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.15);
}

.banner-icon-box {
    font-size: 2.2rem;
    min-width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
}

.banner-content {
    flex: 1;
}

.banner-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.banner-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Layout del Espacio de Soporte: Sidebar + Chat */
.support-workspace {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    flex: 1;
    min-height: 580px;
}

@media (max-width: 900px) {
    .support-workspace {
        grid-template-columns: 1fr;
    }
}

/* Sidebar de Tickets */
.tickets-sidebar {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-radius: var(--radius-lg);
    max-height: 680px;
}

.sidebar-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.sidebar-title-row h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
}

.tickets-filter-bar {
    display: flex;
    background: rgba(11, 17, 32, 0.7);
    padding: 4px;
    border-radius: var(--radius-md);
    gap: 4px;
    margin-bottom: 16px;
    border: 1px solid var(--border-glass);
}

.filter-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 8px 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.filter-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.filter-tab.active {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.18), rgba(2, 132, 199, 0.25));
    color: var(--primary-cyan);
    border: 1px solid rgba(0, 229, 255, 0.35);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.15);
}

.tickets-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 6px;
}

/* Tarjetas de Ticket (Soporta .ticket-card y .ticket-item) */
.ticket-card, .ticket-item {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    user-select: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

/* Indicador lateral luminoso de estado */
.ticket-card::before, .ticket-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3.5px;
    border-radius: 0 4px 4px 0;
    background: #475569;
    transition: all 0.2s ease;
}

.ticket-card.is-open::before, .ticket-item.is-open::before {
    background: #00E5FF;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.8);
}

.ticket-card.is-closed::before, .ticket-item.is-closed::before {
    background: #475569;
}

.ticket-card:hover, .ticket-item:hover {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(0, 229, 255, 0.35);
    transform: translateY(-2px) translateX(2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(0, 229, 255, 0.12);
}

.ticket-card.active, .ticket-item.active {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.12), rgba(15, 23, 42, 0.9));
    border-color: var(--primary-cyan);
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.22), inset 0 0 15px rgba(0, 229, 255, 0.05);
}

.ticket-card.active::before, .ticket-item.active::before {
    top: 6px;
    bottom: 6px;
    width: 4px;
    background: var(--primary-cyan);
    box-shadow: 0 0 14px var(--primary-cyan);
}

/* Encabezado: ID y Badge de Estado */
.ticket-card-header, .ticket-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-id-tag, .ticket-card-id, .ticket-item-num {
    font-family: 'Outfit', monospace;
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--primary-cyan);
    display: flex;
    align-items: center;
    gap: 1px;
    letter-spacing: 0.5px;
}

.ticket-id-tag .ticket-hash {
    opacity: 0.6;
    font-size: 0.85em;
}

.ticket-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ticket-status-pill.status-open {
    background: rgba(0, 230, 118, 0.12);
    color: #00E676;
    border: 1px solid rgba(0, 230, 118, 0.35);
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.15);
}

.ticket-status-pill.status-open .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #00E676;
    box-shadow: 0 0 6px #00E676;
    animation: pulseGlow 1.8s infinite;
}

.ticket-status-pill.status-closed {
    background: rgba(100, 116, 139, 0.15);
    color: #94A3B8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.ticket-status-pill.status-closed .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #64748B;
}

/* Categoría del Ticket */
.ticket-card-category, .ticket-item-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
}

/* Resumen del motivo */
.ticket-card-snippet, .ticket-item-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 2px 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

/* Pie de Tarjeta */
.ticket-card-footer, .ticket-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
    margin-top: 3px;
    font-size: 0.72rem;
}

.ticket-staff-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
}

.ticket-staff-badge.staff-waiting {
    background: rgba(245, 158, 11, 0.12);
    color: #FBBF24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.ticket-staff-badge.staff-assigned {
    background: rgba(0, 229, 255, 0.12);
    color: var(--primary-cyan);
    border: 1px solid rgba(0, 229, 255, 0.25);
}

.ticket-staff-badge.ticket-closed-tag {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
}

.ticket-date-tag {
    color: var(--text-dim);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ticket-date-tag .date-icon {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Estado Vacío de Tickets */
.empty-tickets {
    padding: 36px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    margin: 10px 0;
}

.empty-tickets .empty-icon {
    font-size: 2.2rem;
    opacity: 0.6;
}

.empty-tickets p {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.empty-tickets .empty-sub {
    font-size: 0.72rem;
    color: var(--text-dim);
}

/* Área Central de Chat */
.chat-main {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 600px;
    max-height: 680px;
}

.empty-state-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.empty-state-graphic {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.7;
}

.empty-state-box h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.empty-state-box p {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 440px;
    margin-bottom: 24px;
}

.active-ticket-box {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
}

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(11, 17, 32, 0.6);
}

.chat-ticket-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.category-badge {
    background: var(--primary-cyan-subtle);
    border: 1px solid rgba(0, 229, 255, 0.25);
    color: var(--primary-cyan);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.chat-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
}

.chat-ticket-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.meta-separator {
    opacity: 0.4;
}

.live-bridge-badge {
    color: var(--primary-cyan);
    font-weight: 600;
}

.chat-header-actions {
    display: flex;
    gap: 10px;
}

/* Flujo de Mensajes */
.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.4) 0%, transparent 100%);
}

/* Mensajes del Sistema */
.system-bubble {
    align-self: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 80%;
}

/* Mensajes del Usuario (Derecha) */
.user-message-row {
    display: flex;
    flex-direction: row-reverse;
    gap: 12px;
    align-self: flex-end;
    max-width: 75%;
}

.user-bubble {
    background: linear-gradient(135deg, #0284c7, #00B4D8);
    color: #FFFFFF;
    padding: 12px 18px;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 4px 15px rgba(0, 180, 216, 0.25);
    font-size: 0.92rem;
    line-height: 1.45;
    word-break: break-word;
}

.message-meta-right {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 4px;
    text-align: right;
}

/* Mensajes del Staff (Izquierda) */
.staff-message-row {
    display: flex;
    gap: 12px;
    align-self: flex-start;
    max-width: 75%;
}

.staff-bubble {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(0, 229, 255, 0.25);
    color: var(--text-main);
    padding: 14px 18px;
    border-radius: 18px 18px 18px 4px;
    box-shadow: var(--shadow-glass);
    font-size: 0.92rem;
    line-height: 1.45;
    word-break: break-word;
}

.staff-header-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.staff-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.staff-badge-tag {
    font-size: 0.65rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0284c7, #00E5FF);
    color: black;
    padding: 1px 7px;
    border-radius: 4px;
}

.message-meta-left {
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-top: 6px;
}

.avatar-bubble {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-glass);
}

/* Barra de Entrada de Mensajes */
.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--border-glass);
    background: rgba(11, 17, 32, 0.8);
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 6px 8px 6px 14px;
    transition: all 0.25s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.input-wrapper textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.92rem;
    resize: none;
    outline: none;
    max-height: 120px;
}

.input-wrapper textarea::placeholder {
    color: var(--text-dim);
}

.btn-send {
    background: linear-gradient(135deg, #0284c7, var(--primary-cyan));
    color: black;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.btn-send:active {
    transform: scale(0.98);
}

.input-hint {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 6px;
    padding: 0 4px;
}

.chat-closed-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(30, 41, 59, 0.7);
    border-top: 1px solid var(--border-glass);
    padding: 16px 24px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.chat-closed-banner .closed-icon {
    font-size: 1.5rem;
}

/* ==========================================================================
   BOTONES Y COMPONENTES GENÉRICOS
   ========================================================================== */
.btn-primary {
    background: linear-gradient(135deg, #0284c7, var(--primary-cyan));
    color: #070A10;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(0, 229, 255, 0.4);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.35);
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: var(--accent-red);
}

.btn-ghost {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-glass-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
    border-radius: 8px;
}

/* ==========================================================================
   MODAL DE CREAR TICKET
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 10000;
    padding: 24px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    max-width: 620px;
    width: 100%;
    margin: auto;
    max-height: calc(100vh - 48px);
    padding: 28px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 229, 255, 0.15);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.modal-title-box {
    display: flex;
    gap: 14px;
}

.modal-icon {
    font-size: 2rem;
}

.modal-title-box h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
}

.modal-title-box p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-main);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-label .required {
    color: var(--accent-red);
}

.category-selector-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 500px) {
    .category-selector-grid {
        grid-template-columns: 1fr;
    }
}

.category-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.category-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.category-card .card-body {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-card:hover .card-body {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(0, 229, 255, 0.3);
}

.category-card input[type="radio"]:checked + .card-body {
    border-color: var(--primary-cyan);
    background: rgba(0, 229, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.15);
}

.category-card .card-icon {
    font-size: 1.4rem;
}

.category-card .card-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-main);
}

.category-card .card-desc {
    font-size: 0.72rem;
    color: var(--text-dim);
}

.form-textarea, .form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.form-textarea:focus, .form-input:focus {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

.form-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 5px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* ==========================================================================
   TOASTS DE NOTIFICACIÓN
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    animation: toastIn 0.3s ease;
}

.toast.toast-success { border-color: rgba(16, 185, 129, 0.4); }
.toast.toast-error { border-color: rgba(239, 68, 68, 0.4); }
.toast.toast-info { border-color: rgba(0, 229, 255, 0.4); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar Personalizado */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.4);
}

/* ==========================================================================
   MEJORAS AUDIO, ADJUNTOS, ROLES STAFF, LIGHTBOX Y MÓVIL
   ========================================================================== */

/* Botón de Sonido */
.btn-sound-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 8px 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-sound-toggle:hover {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--primary-cyan);
    transform: scale(1.05);
}

/* Indicador Pulso Verde En Vivo */
.pulse-dot-green {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #00E676;
    border-radius: 50%;
    margin-right: 4px;
    box-shadow: 0 0 8px #00E676;
    animation: pulseGlow 1.8s infinite;
}
@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* Botón Volver en Móvil */
.btn-mobile-back {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    margin-right: 10px;
}
.chat-header-left {
    display: flex;
    align-items: center;
}

/* Botón Adjuntar Archivo */
.btn-attach {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-attach:hover {
    color: var(--primary-cyan);
    background: rgba(0, 229, 255, 0.1);
    transform: scale(1.1);
}

/* Barra de Adjunto Pendiente (Staged) */
.staged-attachment-bar {
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed rgba(0, 229, 255, 0.4);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}
.staged-attachment-bar.hidden {
    display: none;
}
.attachment-preview-card {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.attachment-preview-card img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.staged-file-name {
    font-size: 0.82rem;
    color: var(--text-main);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-remove-attachment {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #ef4444;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: all 0.2s;
}
.btn-remove-attachment:hover {
    background: #ef4444;
    color: #fff;
}

/* Imágenes dentro de las burbujas de chat */
.chat-attachment-container {
    margin-top: 8px;
}
.chat-attachment-img {
    max-width: 320px;
    max-height: 220px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    cursor: zoom-in;
    transition: all 0.2s ease;
    display: block;
}
.chat-attachment-img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 229, 255, 0.3);
    border-color: var(--primary-cyan);
}

/* Badges de Roles de Staff en el Chat Web */
.staff-badge-tag {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    margin-left: 6px;
    text-transform: uppercase;
}
.staff-badge-ADMIN {
    background: rgba(255, 184, 0, 0.2);
    color: #FFB800;
    border: 1px solid rgba(255, 184, 0, 0.5);
}
.staff-badge-MOD {
    background: rgba(0, 230, 118, 0.2);
    color: #00E676;
    border: 1px solid rgba(0, 230, 118, 0.5);
}
.staff-badge-STAFF {
    background: rgba(0, 229, 255, 0.2);
    color: #00E5FF;
    border: 1px solid rgba(0, 229, 255, 0.5);
}

/* Formato Markdown en el Chat Web */
.msg-text strong {
    font-weight: 700;
    color: #ffffff;
}
.msg-text em {
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
}
.msg-text .inline-code {
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85em;
    color: #00E5FF;
    border: 1px solid rgba(0, 229, 255, 0.2);
}
.msg-text .code-block {
    background: rgba(10, 15, 25, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px;
    margin: 6px 0;
    font-family: monospace;
    font-size: 0.82em;
    overflow-x: auto;
    color: #a5f3fc;
}
.msg-text blockquote {
    border-left: 3px solid var(--primary-cyan);
    margin: 6px 0;
    padding-left: 10px;
    color: rgba(255, 255, 255, 0.85);
}
.msg-text a {
    color: #00E5FF;
    text-decoration: underline;
    text-underline-offset: 3px;
    word-break: break-all;
}
.msg-text a:hover {
    color: #7df9ff;
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}
.lightbox-modal.hidden {
    display: none;
}
.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}
.lightbox-content img {
    max-width: 90vw;
    max-height: 88vh;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.lightbox-close {
    position: absolute;
    top: -16px;
    right: -16px;
    background: #ef4444;
    border: 2px solid #fff;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.2s;
}
.lightbox-close:hover {
    transform: scale(1.1);
    background: #dc2626;
}

/* Caja de Consejos en Modal */
.modal-tips-box {
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 14px;
}
.modal-tips-box .tips-icon {
    font-size: 1.25rem;
}
.modal-tips-box .tips-content {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-main);
}
.modal-tips-box strong {
    color: var(--primary-cyan);
    display: block;
    margin-bottom: 2px;
}

/* ==========================================================================
   RESPONSIVIDAD MÓVIL PROFESIONAL (CELULARES Y TABLETS)
   ========================================================================== */

/* Tablets y Pantallas Medianas (<= 860px) */
@media (max-width: 860px) {
    .btn-mobile-back {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .dashboard-body {
        padding: 12px 14px 24px 14px;
        gap: 14px;
    }

    /* Alternancia fluida entre lista de tickets y chat en móvil */
    .support-workspace {
        position: relative;
        grid-template-columns: 1fr;
        min-height: calc(100vh - 200px);
    }
    .support-workspace.show-chat .tickets-sidebar {
        display: none !important;
    }
    .support-workspace.show-chat .chat-main {
        display: flex !important;
        height: calc(100vh - 200px);
        max-height: none;
    }
    .support-workspace:not(.show-chat) .chat-main {
        display: none !important;
    }
    .support-workspace:not(.show-chat) .tickets-sidebar {
        display: flex !important;
        width: 100%;
        max-height: none;
    }

    .chat-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 12px;
    }
    .chat-ticket-title-row {
        flex-wrap: wrap;
        gap: 6px;
    }
    .chat-title {
        font-size: 1.1rem;
    }
    .chat-header-actions {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }

    .account-banner {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 18px 20px;
        gap: 14px;
    }
    .banner-actions {
        width: 100%;
    }
    .banner-actions button {
        width: 100%;
    }

    .user-bubble, .staff-bubble {
        max-width: 88%;
        font-size: 0.9rem;
    }
}

/* Teléfonos y Dispositivos Compactos (<= 600px) */
@media (max-width: 600px) {
    /* Barra de Navegación Compacta */
    .top-nav {
        padding: 10px 14px;
    }
    .nav-brand .nav-subtitle {
        display: none;
    }
    .nav-brand .brand-logo-small {
        width: 32px;
        height: 32px;
    }
    .nav-brand .nav-title {
        font-size: 1.05rem;
    }
    .nav-user {
        gap: 8px;
    }
    .user-details .user-id {
        display: none;
    }
    .user-profile-box {
        padding: 4px 10px;
        gap: 6px;
    }
    .user-name {
        font-size: 0.78rem;
        max-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .status-pill {
        padding: 4px 8px;
        font-size: 0.68rem;
    }
    .btn-sound-toggle {
        padding: 6px 8px;
        font-size: 0.9rem;
    }

    /* Modal de Crear Ticket Ultra-Optimizada */
    .modal-overlay {
        padding: 12px 10px;
        align-items: flex-start;
    }
    .modal-card {
        padding: 18px 16px;
        border-radius: 18px;
        max-height: calc(100vh - 24px);
    }
    .modal-header {
        margin-bottom: 14px;
    }
    .modal-icon {
        font-size: 1.5rem;
    }
    .modal-title-box h3 {
        font-size: 1.1rem;
    }
    .modal-title-box p {
        font-size: 0.78rem;
    }
    .modal-close {
        font-size: 1.5rem;
    }
    .category-selector-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .category-card .card-body {
        padding: 10px 12px;
    }
    .category-card .card-title {
        font-size: 0.85rem;
    }
    .form-group {
        margin-bottom: 14px;
    }
    .form-textarea, .form-input {
        font-size: 16px; /* Evita auto-zoom molesto en Safari / Chrome iOS */
        padding: 10px 12px;
    }
    .modal-actions {
        flex-direction: column-reverse;
        gap: 8px;
        margin-top: 18px;
    }
    .modal-actions button {
        width: 100%;
        padding: 12px;
    }

    /* Pantalla de Login en Móvil */
    .public-header {
        padding: 12px 16px;
    }
    .login-hero {
        padding: 20px 12px;
    }
    .login-card {
        padding: 24px 16px;
        border-radius: 20px;
    }
    .hero-title {
        font-size: 1.65rem;
    }
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 24px;
    }
    .features-grid {
        gap: 10px;
        margin-bottom: 24px;
    }
    .feature-item {
        padding: 12px 14px;
    }
    .btn-discord {
        font-size: 0.95rem;
        padding: 14px 18px;
    }

    /* Chat en Móvil */
    .chat-messages-container {
        padding: 10px 8px;
    }
    .user-bubble, .staff-bubble {
        max-width: 90%;
        padding: 10px 12px;
    }
    .chat-attachment-img {
        max-width: 100%;
        max-height: 180px;
    }
    .chat-input-area {
        padding: 8px 10px;
    }
    .input-wrapper textarea {
        font-size: 16px; /* Evita zoom automático en teclados móviles */
    }
    .input-hint {
        font-size: 0.68rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}

/* Pantallas Extra Compactas (iPhone SE, <= 380px) */
@media (max-width: 380px) {
    .user-name {
        display: none;
    }
    .status-pill span:not(.status-dot) {
        display: none;
    }
    .hero-title {
        font-size: 1.45rem;
    }
    .btn-discord {
        font-size: 0.88rem;
        padding: 12px 14px;
    }
}

/* ==========================================================================
   SISTEMA DE ARCHIVOS, DROPZONE, ADJUNTOS Y EMOJI PICKER
   ========================================================================== */

/* Cabeceras de campo con acciones y badges */
.label-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.upload-badge {
    font-size: 0.7rem;
    color: var(--primary-cyan);
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.25);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.btn-input-emoji {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
}
.btn-input-emoji:hover {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--primary-cyan);
    transform: scale(1.1);
}

.textarea-hint-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}
.char-count {
    font-size: 0.72rem;
    color: var(--text-dim);
}

/* Dropzone de subida de archivos en Modal */
.file-dropzone {
    background: rgba(11, 17, 32, 0.6);
    border: 2px dashed rgba(0, 229, 255, 0.35);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}
.file-dropzone:hover, .file-dropzone.drag-active {
    background: rgba(0, 229, 255, 0.06);
    border-color: var(--primary-cyan);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
}
.dropzone-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}
.dropzone-icon {
    font-size: 2rem;
    flex-shrink: 0;
}
.dropzone-text {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dropzone-text strong {
    font-size: 0.88rem;
    color: var(--text-main);
}
.dropzone-text span {
    font-size: 0.76rem;
    color: var(--text-dim);
}
.dropzone-browse-link {
    background: transparent;
    border: none;
    color: var(--primary-cyan);
    text-decoration: underline;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
}

/* Lista de archivos en el modal */
.modal-staged-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.staged-file-chip {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.2s ease;
}
.staged-file-chip img {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.staged-file-chip .file-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    background: rgba(0, 229, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.staged-file-info {
    flex: 1;
    overflow: hidden;
}
.staged-file-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.staged-file-meta {
    font-size: 0.7rem;
    color: var(--text-dim);
}
.btn-chip-remove {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #ef4444;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}
.btn-chip-remove:hover {
    background: #ef4444;
    color: #fff;
    transform: scale(1.1);
}

/* Chat Input: Botón de Emojis */
.btn-emoji {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.btn-emoji:hover {
    color: #FFB800;
    background: rgba(255, 184, 0, 0.1);
    transform: scale(1.15);
}

/* Lista de archivos preparados en Chat */
.staged-attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

/* Drag and Drop en área de chat */
.chat-messages-container.drag-over {
    outline: 2px dashed var(--primary-cyan);
    outline-offset: -8px;
    background: rgba(0, 229, 255, 0.05);
}

/* Tarjeta de Archivo Documento en las burbujas de Chat */
.chat-file-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    max-width: 360px;
}
.chat-file-card:hover {
    background: rgba(0, 229, 255, 0.08);
    border-color: var(--primary-cyan);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.15);
}
.chat-file-icon {
    font-size: 1.8rem;
    line-height: 1;
    flex-shrink: 0;
}
.chat-file-details {
    flex: 1;
    overflow: hidden;
}
.chat-file-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.chat-file-size {
    font-size: 0.7rem;
    color: var(--text-dim);
}
.chat-file-download-badge {
    background: rgba(0, 229, 255, 0.15);
    color: var(--primary-cyan);
    border: 1px solid rgba(0, 229, 255, 0.3);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ==========================================================================
   POPOVER SELECTOR DE EMOJIS (MODERNO & CATEGORIZADO)
   ========================================================================== */
.emoji-picker-popover {
    position: fixed;
    z-index: 10001;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: rgba(13, 20, 36, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 18px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 229, 255, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.emoji-picker-header {
    padding: 12px 14px 8px 14px;
}

.emoji-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    gap: 8px;
}
.emoji-search-box:focus-within {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}
.emoji-search-box .search-icon {
    font-size: 0.85rem;
    opacity: 0.6;
}
.emoji-search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.84rem;
    outline: none;
}
.emoji-search-box input::placeholder {
    color: var(--text-dim);
}
.btn-clear-search {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
}
.btn-clear-search:hover {
    color: var(--text-main);
}

.emoji-categories-nav {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border-glass);
    border-bottom: 1px solid var(--border-glass);
    padding: 4px 6px;
    gap: 4px;
}
.emoji-cat-btn {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 1.15rem;
    padding: 6px 2px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    opacity: 0.6;
}
.emoji-cat-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}
.emoji-cat-btn.active {
    opacity: 1;
    background: rgba(0, 229, 255, 0.15);
    border-bottom: 2px solid var(--primary-cyan);
}

.emoji-picker-content {
    max-height: 280px;
    min-height: 220px;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.emoji-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}

.emoji-item {
    background: transparent;
    border: none;
    font-size: 1.45rem;
    padding: 6px 2px;
    border-radius: 8px;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.12s ease, background 0.12s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.emoji-item:hover {
    transform: scale(1.3);
    background: rgba(255, 255, 255, 0.12);
}
.emoji-item:active {
    transform: scale(1.05);
}

.emoji-empty-search {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    padding: 30px 10px;
}

.emoji-picker-footer {
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.35);
    border-top: 1px solid var(--border-glass);
    font-size: 0.72rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
