/**
 * Estilos del Sistema de Tickets - ERP Acción Eficaz
 * Diseño moderno y responsive
 */

/* ========================================
   CONTENEDOR PRINCIPAL
======================================== */
.erpae-tickets-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ========================================
   HEADER
======================================== */
.tickets-header {
    background: linear-gradient(135deg, #0E3950 0%, #0E3950 100%);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(14, 57, 80, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.tickets-header h1 {
    color: white;
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tickets-header h1 .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

/* ========================================
   BOTONES
======================================== */
.erpae-btn-primary,
.erpae-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.erpae-btn-primary {
    background: #ECAD20 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(236, 173, 32, 0.3) !important;
    border: none !important;
}

.erpae-btn-primary:hover {
    background: #d99a1c !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(236, 173, 32, 0.4) !important;
}

.erpae-btn-primary:active,
.erpae-btn-primary:focus {
    background: #c78a18 !important;
    color: white !important;
    outline: none !important;
    box-shadow: 0 2px 8px rgba(236, 173, 32, 0.5) !important;
}

.erpae-btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.erpae-btn-secondary:hover {
    background: #cbd5e0;
}

/* ========================================
   ESTADÍSTICAS
======================================== */
.tickets-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.stat-card.stat-open {
    border-color: #10b981;
}

.stat-card.stat-open:hover {
    background: #f0fdf4;
}

.stat-card.stat-progress {
    border-color: #f59e0b;
}

.stat-card.stat-progress:hover {
    background: #fffbeb;
}

.stat-card.stat-resolved {
    border-color: #3b82f6;
}

.stat-card.stat-resolved:hover {
    background: #eff6ff;
}

.stat-card.stat-closed {
    border-color: #6b7280;
}

.stat-card.stat-closed:hover {
    background: #f9fafb;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-open .stat-icon {
    background: #d1fae5;
    color: #059669;
}

.stat-progress .stat-icon {
    background: #fef3c7;
    color: #d97706;
}

.stat-resolved .stat-icon {
    background: #dbeafe;
    color: #2563eb;
}

.stat-closed .stat-icon {
    background: #e5e7eb;
    color: #4b5563;
}

.stat-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* ========================================
   FILTROS
======================================== */
.tickets-filters {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filters-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-search {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.filter-search .dashicons {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.filter-search input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.filter-search input:focus {
    outline: none;
    border-color: #0E3950;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filters-form select {
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
}

.filters-form select:focus {
    outline: none;
    border-color: #0E3950;
}

.filter-agente {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    border-color: #0E3950;
    font-weight: 600;
}

.clear-filters {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.clear-filters:hover {
    background: #fecaca;
}

/* ========================================
   LISTA DE TICKETS
======================================== */
.tickets-list {
    display: grid;
    gap: 16px;
}

.ticket-card {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-radius: 16px;
    padding: 24px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.ticket-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.ticket-card:hover::before {
    opacity: 1;
}

.ticket-card:hover {
    border-color: #b7bac0;
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px) scale(1.01);
    background: white;
}

/* Estados especiales */
.ticket-card.ticket-abierto {
    border-left: 4px solid #ef4444;
}

.ticket-card.ticket-en-progreso {
    border-left: 4px solid #f59e0b;
}

.ticket-card.ticket-resuelto {
    border-left: 4px solid #3b82f6;
}

.ticket-card.ticket-cerrado {
    border-left: 4px solid #10b981;
    opacity: 0.95;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.ticket-numero {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    padding: 8px 14px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    border: 1px solid #bfdbfe;
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.1);
}

.ticket-numero .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #2563eb;
}

.ticket-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
}

.badge:hover {
    transform: scale(1.05);
}

.badge-estado.badge-abierto {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.badge-estado.badge-en-progreso {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
    border: 1px solid #fcd34d;
}

.badge-estado.badge-esperando-cliente,
.badge-estado.badge-en-espera {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    border: 1px solid #cbd5e1;
}

.badge-estado.badge-resuelto {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
    border: 1px solid #93c5fd;
}

.badge-estado.badge-cerrado {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
    border: 1px solid #6ee7b7;
}

.badge-prioridad {
    font-size: 10px;
}

.badge-prioridad.prioridad-baja {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.badge-prioridad.prioridad-media {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #d97706;
    border: 1px solid #fde68a;
}

.badge-prioridad.prioridad-alta {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.badge-prioridad.prioridad-urgente {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    color: white;
    border: 1px solid #b91c1c;
    animation: pulse-urgente 2s infinite;
}

@keyframes pulse-urgente {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2);
    }
}

.badge-prioridad.prioridad-baja {
    background: #e0f2fe;
    color: #0284c7;
}

.badge-prioridad.prioridad-media {
    background: #fef3c7;
    color: #d97706;
}

.badge-prioridad.prioridad-alta {
    background: #fed7aa;
    color: #ea580c;
}

.badge-prioridad.prioridad-urgente {
    background: #fecaca;
    color: #dc2626;
}

.ticket-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 14px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.ticket-card:hover .ticket-title {
    color: #3b82f6;
}

.ticket-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #6b7280;
}

.meta-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #9ca3af;
}

.meta-agente {
    background: linear-gradient(135deg, #e8f0fe 0%, #f0f4ff 100%);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    color: #4c63d2;
    border: 1px solid #c7d7fe;
}

.meta-agente .dashicons {
    color: #4c63d2;
}

.meta-sin-asignar {
    background: #f9fafb;
    padding: 4px 12px;
    border-radius: 12px;
    color: #9ca3af;
    font-style: italic;
    border: 1px dashed #d1d5db;
}

.ticket-last-message {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 3px solid #3b82f6;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 13px;
    color: #64748b;
    margin-top: 16px;
    line-height: 1.6;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ticket-last-message strong {
    color: #1e293b;
    font-weight: 600;
    font-style: normal;
}

/* ========================================
   NO TICKETS
======================================== */
.no-tickets {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    border: 2px dashed #e5e7eb;
}

.no-tickets-icon {
    font-size: 80px;
    color: #cbd5e0;
    margin-bottom: 20px;
}

.no-tickets-icon .dashicons {
    font-size: 80px;
    width: 80px;
    height: 80px;
}

.no-tickets h3 {
    font-size: 24px;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.no-tickets p {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 24px 0;
}

/* ========================================
   MODAL
======================================== */
.erpae-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    max-width: 600px;
    margin: 50px auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 2px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
}

.modal-close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #6b7280;
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0E3950;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

/* Estilos para campo de WhatsApp con código de país */
.whatsapp-input-group {
    display: flex;
    align-items: stretch;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.whatsapp-input-group:focus-within {
    border-color: #0E3950;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.whatsapp-input-group .country-code {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #0E3950 0%, #0a2d3f 100%);
    color: white;
    font-weight: 600;
    font-size: 15px;
    border-right: none;
}

.whatsapp-input-group input[type="tel"] {
    flex: 1;
    padding: 12px 16px;
    border: none;
    font-size: 15px;
    font-family: inherit;
    outline: none;
}

.whatsapp-input-group input[type="tel"]:focus {
    outline: none;
}

.validation-message {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.validation-message.error {
    color: #dc2626;
}

.validation-message.success {
    color: #16a34a;
}

/* Estilos para campos dinámicos */
.campo-dinamico {
    animation: slideDown 0.3s ease-out;
    border-left: 4px solid #0E3950;
    padding-left: 16px;
    background: linear-gradient(to right, rgba(14, 57, 80, 0.03) 0%, transparent 100%);
    border-radius: 8px;
}

.campo-dinamico label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0E3950;
    font-weight: 600;
}

.campo-dinamico label .dashicons {
    color: #0E3950;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.campo-dinamico input[type="text"],
.campo-dinamico input[type="url"] {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 15px;
    width: 100%;
    transition: all 0.3s ease;
}

.campo-dinamico input[type="text"]:focus,
.campo-dinamico input[type="url"]:focus {
    outline: none;
    border-color: #0E3950;
    box-shadow: 0 0 0 3px rgba(14, 57, 80, 0.1);
}

.campo-dinamico small {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 13px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos para input file personalizado */
.form-group input[type="file"] {
    display: none;
}

.form-group label[for="respuesta_archivos"],
.form-group label[for="ticket_archivos"] {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #0E3950 0%, #0a2d3f 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(14, 57, 80, 0.2);
    border: 2px solid transparent;
    margin-bottom: 12px;
}

.form-group label[for="respuesta_archivos"]:hover,
.form-group label[for="ticket_archivos"]:hover {
    background: linear-gradient(135deg, #0a2d3f 0%, #0E3950 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 57, 80, 0.3);
    border-color: #ECAD20;
}

.form-group label[for="respuesta_archivos"] .dashicons,
.form-group label[for="ticket_archivos"] .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.form-group label[for="respuesta_archivos"]:active,
.form-group label[for="ticket_archivos"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(14, 57, 80, 0.2);
}

.form-message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.form-message.success {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #a7f3d0;
    display: block;
}

.form-message.error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    display: block;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px 30px;
    border-top: 2px solid #e5e7eb;
}

/* ========================================
   MENSAJE DE MORA
======================================== */
.erpae-mora-notice-page {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 40px;
    margin: 30px 0;
    text-align: center;
}

.mora-icon {
    margin-bottom: 20px;
}

.mora-icon .dashicons {
    font-size: 80px;
    color: #d63638;
    width: 80px;
    height: 80px;
}

.erpae-mora-notice-page h2 {
    color: #d63638;
    margin: 0 0 20px 0;
    font-size: 28px;
}

.mora-description {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #856404;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.mora-action {
    margin: 0 0 30px 0;
    font-size: 18px;
    font-weight: 600;
    color: #d63638;
}

.mora-help {
    padding-top: 30px;
    border-top: 1px solid #ffc107;
}

.mora-help p {
    margin: 0 0 15px 0;
    color: #856404;
    font-size: 16px;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
    .erpae-tickets-container {
        padding: 15px;
    }

    .tickets-header {
        padding: 20px;
    }

    .tickets-header h1 {
        font-size: 22px;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .erpae-btn-primary,
    .erpae-btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .tickets-stats {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 28px;
    }

    .filters-form {
        flex-direction: column;
    }

    .filter-search {
        width: 100%;
    }

    .filters-form select {
        width: 100%;
    }

    .ticket-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-content {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer button {
        width: 100%;
    }
}

/* ========================================
   ANIMACIONES
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.ticket-card {
    animation: fadeIn 0.3s ease;
}

/* ========================================
   VISTA DE DETALLE DE TICKET
======================================== */
.erpae-ticket-detalle {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ticket-detalle-header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Sección de información adicional del ticket */
.ticket-info-adicional {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0E3950;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(14, 57, 80, 0.1);
}

.info-adicional-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0E3950;
    font-size: 16px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(14, 57, 80, 0.2);
}

.info-adicional-header .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.info-adicional-contenido {
    display: grid;
    gap: 15px;
}

.info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #0E3950;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 5px;
}

.info-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.info-label .dashicons {
    color: #0E3950;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.info-valor {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

/* Enlace de WhatsApp */
.whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.whatsapp-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.whatsapp-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Sin datos registrados */
.sin-datos {
    display: inline-block;
    padding: 6px 14px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-style: italic;
}

/* Código Rustdesk */
.rustdesk-code {
    display: inline-block;
    padding: 8px 16px;
    background: #1e293b;
    color: #10b981;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
}

.btn-copiar-rustdesk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background: #0E3950;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copiar-rustdesk:hover {
    background: #ECAD20;
    transform: scale(1.05);
}

.btn-copiar-rustdesk .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Enlace de sitio web */
.web-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #0E3950 0%, #0a2d3f 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(14, 57, 80, 0.2);
}

.web-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 57, 80, 0.3);
    background: linear-gradient(135deg, #ECAD20 0%, #d49a1c 100%);
}

.web-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Botón de editar información adicional */
.btn-editar-info-adicional {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #ECAD20;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-left: auto;
}

.btn-editar-info-adicional:hover {
    background: #d49a1c;
    transform: translateY(-2px);
}

.btn-editar-info-adicional .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Campos editables de información adicional */
.info-item-editable {
    margin-bottom: 20px;
}

.info-item-editable label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #0E3950;
    margin-bottom: 8px;
    font-size: 14px;
}

.info-item-editable label .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.info-item-editable input[type="text"],
.info-item-editable input[type="url"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.info-item-editable input[type="text"]:focus,
.info-item-editable input[type="url"]:focus {
    outline: none;
    border-color: #0E3950;
    box-shadow: 0 0 0 3px rgba(14, 57, 80, 0.1);
}

.info-item-editable small {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 13px;
}

/* Input group para WhatsApp con prefijo */
.input-group {
    display: flex;
    align-items: stretch;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: #0E3950;
    box-shadow: 0 0 0 3px rgba(14, 57, 80, 0.1);
}

.input-prefix {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f3f4f6;
    color: #374151;
    font-weight: 600;
    border-right: 2px solid #e5e7eb;
}

.input-group input[type="text"] {
    flex: 1;
    border: none !important;
    box-shadow: none !important;
    padding: 12px 16px;
}

/* Botones de acciones de formulario */
.info-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
}

.btn-guardar-info,
.btn-cancelar-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-guardar-info {
    background: #10b981;
    color: white;
}

.btn-guardar-info:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-cancelar-info {
    background: #ef4444;
    color: white;
}

.btn-cancelar-info:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-guardar-info .dashicons,
.btn-cancelar-info .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.btn-volver {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0E3950;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 20px;
    transition: color 0.3s;
}

.btn-volver:hover {
    color: #ECAD20;
}

.btn-volver .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.ticket-detalle-title-section {
    margin-bottom: 20px;
}

.ticket-numero-grande {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #0E3950 0%, #0E3950 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 15px;
}

.ticket-numero-grande .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ticket-title-detalle {
    font-size: 32px;
    font-weight: 700;
    color: #2d3748;
    margin: 15px 0;
    line-height: 1.3;
}

.ticket-meta-detalle {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.ticket-acciones-admin {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.admin-control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-control-group label {
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.select-admin {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    min-width: 180px;
}

.select-admin:focus {
    outline: none;
    border-color: #0E3950;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.select-admin:hover {
    border-color: #cbd5e0;
}

.asignacion-exito {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   PLANTILLAS DE RESPUESTA
======================================== */
.plantilla-selector-group {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.plantilla-selector-group label {
    color: #92400e;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.plantilla-selector-group label .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #d97706;
}

.plantilla-selector {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #fbbf24;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.plantilla-selector:focus {
    outline: none;
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

.plantilla-selector option {
    padding: 10px;
}

.plantilla-selector optgroup {
    font-weight: 700;
    color: #92400e;
}

.plantilla-insertada {
    display: inline-block;
    margin-left: 12px;
    margin-top: 8px;
    background: #10b981;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    animation: slideIn 0.3s ease;
}

/* ========================================
   INDICADOR SLA
======================================== */
.sla-indicator {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid;
    transition: all 0.3s ease;
}

.sla-normal {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #10b981;
}

.sla-advertencia {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
}

.sla-critico {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    border-color: #f97316;
    animation: pulse-sla 2s infinite;
}

.sla-vencido {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #dc2626;
    animation: pulse-sla 1.5s infinite;
}

.sla-completado {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-color: #818cf8;
}

@keyframes pulse-sla {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
}

.sla-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 15px;
}

.sla-normal .sla-header {
    color: #065f46;
}

.sla-advertencia .sla-header {
    color: #92400e;
}

.sla-critico .sla-header,
.sla-vencido .sla-header {
    color: #991b1b;
}

.sla-header .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.sla-progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sla-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 10px;
}

.sla-advertencia .sla-progress-fill {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.sla-critico .sla-progress-fill {
    background: linear-gradient(90deg, #f97316 0%, #fb923c 100%);
}

.sla-vencido .sla-progress-fill {
    background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%);
}

.sla-time-info {
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.sla-normal .sla-time-info {
    color: #065f46;
}

.sla-advertencia .sla-time-info {
    color: #92400e;
}

.sla-critico .sla-time-info,
.sla-vencido .sla-time-info {
    color: #991b1b;
    font-size: 15px;
}

.sla-vencido-texto {
    font-weight: 700;
}

.sla-time-info small {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
}

/* Descripción inicial del ticket */
.ticket-descripcion-inicial {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #0E3950;
}

/* Mensajes del ticket */
.ticket-mensajes-lista {
    margin-bottom: 30px;
}

.ticket-mensaje {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #cbd5e0;
    transition: transform 0.2s;
}

.ticket-mensaje:hover {
    transform: translateX(5px);
}

.ticket-mensaje.mensaje-staff {
    border-left-color: #48bb78;
    background: linear-gradient(to right, #f0fff4 0%, white 50px);
}

.ticket-mensaje.mensaje-cliente {
    border-left-color: #0E3950;
    background: linear-gradient(to right, #f7fafc 0%, white 50px);
}

.mensaje-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.mensaje-autor {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #2d3748;
}

.mensaje-autor .dashicons {
    color: #0E3950;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.badge-staff {
    background: #48bb78;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mensaje-fecha {
    color: #718096;
    font-size: 13px;
}

.mensaje-contenido {
    color: #4a5568;
    line-height: 1.7;
    font-size: 15px;
}

.mensaje-contenido p {
    margin: 0 0 10px 0;
}

.mensaje-contenido p:last-child {
    margin-bottom: 0;
}

.no-mensajes {
    background: #f7fafc;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    color: #718096;
}

/* Formulario de respuesta */
.ticket-responder-form {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.ticket-responder-form h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2d3748;
    font-size: 20px;
    margin: 0 0 20px 0;
}

.ticket-responder-form h3 .dashicons {
    color: #0E3950;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.ticket-responder-form .form-group {
    margin-bottom: 20px;
}

.ticket-responder-form textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.ticket-responder-form textarea:focus {
    outline: none;
    border-color: #0E3950;
}

.ticket-responder-form .form-actions {
    display: flex;
    justify-content: flex-end;
}

.form-message {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.form-message.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.form-message.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

/* Ticket cerrado */
.ticket-cerrado-notice {
    background: #f7fafc;
    border: 2px solid #cbd5e0;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    color: #718096;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.ticket-cerrado-notice .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* Responsive para detalle */
@media screen and (max-width: 768px) {
    .ticket-title-detalle {
        font-size: 24px;
    }

    .ticket-meta-detalle {
        flex-direction: column;
        align-items: flex-start;
    }

    .mensaje-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ticket-mensaje {
        padding: 20px;
    }

    .ticket-descripcion-inicial,
    .ticket-responder-form {
        padding: 20px;
    }
}

/* ========================================
   ARCHIVOS ADJUNTOS
======================================== */
.mensaje-archivos {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.mensaje-archivos strong {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4a5568;
    font-size: 14px;
    margin-bottom: 10px;
}

.mensaje-archivos .dashicons {
    color: #0E3950;
}

.lista-archivos {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lista-archivos li {
    margin-bottom: 8px;
}

.archivo-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #4a5568;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.archivo-link:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    color: #0E3950;
}

.archivo-link .dashicons {
    color: #0E3950;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.archivo-link small {
    color: #718096;
    font-size: 12px;
}

.archivos-preview {
    margin-top: 10px;
}

.archivo-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 8px;
}

.archivo-preview-item .dashicons {
    color: #0E3950;
}

.archivo-preview-nombre {
    flex: 1;
    font-size: 14px;
    color: #4a5568;
}

.archivo-preview-tamano {
    font-size: 12px;
    color: #718096;
}

/* ========================================
   ENCUESTA DE SATISFACCIÓN
======================================== */
.separador-encuesta {
    height: 1px;
    background: #e2e8f0;
    margin: 30px 0 20px 0;
}

.encuesta-satisfaccion-inline {
    text-align: center;
    padding: 20px;
}

.encuesta-satisfaccion-inline h4 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #2d3748;
    font-size: 20px;
    margin: 0 0 10px 0;
}

.encuesta-satisfaccion-inline h4 .dashicons {
    color: #fbbf24;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.encuesta-satisfaccion-inline p {
    color: #718096;
    margin: 0 0 20px 0;
}

.btn-abrir-encuesta {
    margin: 0 auto;
}

.encuesta-enviada {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: #c6f6d5;
    border: 1px solid #9ae6b4;
    border-radius: 8px;
    color: #22543d;
    font-weight: 600;
}

.encuesta-enviada .dashicons {
    color: #38a169;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.modal-encuesta-content {
    max-width: 500px;
}

.encuesta-intro {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.encuesta-intro p {
    margin: 0;
    color: #4a5568;
    line-height: 1.6;
}

.encuesta-estrellas {
    text-align: center;
}

.rating-estrellas {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.rating-estrellas input[type="radio"] {
    display: none;
}

.rating-estrellas .star {
    font-size: 48px;
    color: #cbd5e0;
    cursor: pointer;
    transition: all 0.2s;
}

.rating-estrellas .star:hover,
.rating-estrellas .star:hover ~ .star,
.rating-estrellas input[type="radio"]:checked ~ .star {
    color: #fbbf24;
    transform: scale(1.1);
}

.rating-label {
    font-size: 16px;
    font-weight: 600;
    color: #0E3950;
    min-height: 24px;
    margin-top: 10px;
}

/* Responsive para archivos y encuesta */
@media screen and (max-width: 768px) {
    .rating-estrellas .star {
        font-size: 36px;
    }

    .modal-encuesta-content {
        margin: 20px;
    }

    .archivo-link {
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* ========================================
   NOTIFICACIONES TOAST
======================================== */
.erpae-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 320px;
    max-width: 500px;
    padding: 16px 24px 16px 50px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 15px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    backdrop-filter: blur(10px);
}

.erpae-toast::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.erpae-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.erpae-toast-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.erpae-toast-error::before {
    content: '✕';
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

.erpae-toast-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #d1fae5 100%);
    color: #065f46;
    border-left: 4px solid #10b981;
}

.erpae-toast-success::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    background: #10b981;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

.erpae-toast-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.erpae-toast-info::before {
    content: 'i';
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

.erpae-toast-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.erpae-toast-warning::before {
    content: '⚠';
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f59e0b;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

/* ========================================
   MODAL DE CONFIRMACIÓN
======================================== */
.erpae-confirm-modal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px);
    z-index: 99999 !important;
    align-items: center !important;
    justify-content: center !important;
    animation: fadeIn 0.2s ease;
    margin: 0 !important;
    padding: 0 !important;
}

.erpae-confirm-modal.show {
    display: flex !important;
}

.erpae-confirm-content {
    background: white !important;
    border-radius: 16px !important;
    padding: 0 !important;
    max-width: 450px !important;
    width: 90% !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    animation: slideUp 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden !important;
    position: relative !important;
    margin: auto !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.erpae-confirm-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
}

.erpae-confirm-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.erpae-confirm-icon.warning {
    background: #fef3c7;
    color: #f59e0b;
}

.erpae-confirm-icon.danger {
    background: #fee2e2;
    color: #dc2626;
}

.erpae-confirm-icon.info {
    background: #dbeafe;
    color: #3b82f6;
}

.erpae-confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.erpae-confirm-body {
    padding: 20px 24px;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.6;
}

.erpae-confirm-footer {
    padding: 16px 24px;
    background: #f9fafb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.erpae-confirm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.erpae-confirm-btn-cancel {
    background: white;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.erpae-confirm-btn-cancel:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.erpae-confirm-btn-confirm {
    background: #3b82f6;
    color: white;
}

.erpae-confirm-btn-confirm:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.erpae-confirm-btn-confirm.danger {
    background: #dc2626;
}

.erpae-confirm-btn-confirm.danger:hover {
    background: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

@media (max-width: 768px) {
    .erpae-toast {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }

    .erpae-confirm-content {
        width: 95%;
        max-width: none;
    }

    .erpae-confirm-footer {
        flex-direction: column;
    }

    .erpae-confirm-btn {
        width: 100%;
    }
}

/* ========================================
   TIMELINE DEL TICKET
======================================== */
.ticket-timeline-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
    color: #1e293b;
    font-size: 16px;
}

.timeline-header .dashicons {
    color: #3b82f6;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.ticket-timeline {
    position: relative;
    padding-left: 40px;
}

.ticket-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #3b82f6 0%, #cbd5e1 100%);
}

.timeline-evento {
    position: relative;
    margin-bottom: 24px;
    padding-bottom: 24px;
}

.timeline-evento:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.timeline-evento::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: 3px solid #3b82f6;
    z-index: 1;
}

.timeline-evento.evento-creado::before {
    background: #10b981;
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.timeline-evento.evento-estado_cambio::before {
    background: #f59e0b;
    border-color: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

.timeline-evento.evento-agente_asignado::before {
    background: #8b5cf6;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.timeline-evento.evento-respuesta::before {
    background: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.timeline-evento.evento-cerrado::before {
    background: #64748b;
    border-color: #64748b;
    box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.1);
}

.timeline-evento.evento-prioridad_cambio::before {
    background: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.evento-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.evento-descripcion {
    flex: 1;
    font-size: 14px;
    color: #1e293b;
    font-weight: 500;
}

.evento-fecha {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.evento-usuario {
    font-size: 13px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.evento-usuario .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.evento-metadata {
    margin-top: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 12px;
    color: #64748b;
    border-left: 3px solid #cbd5e1;
}

.evento-metadata strong {
    color: #475569;
}

.evento-metadata-item {
    margin-bottom: 4px;
}

.evento-metadata-item:last-child {
    margin-bottom: 0;
}

/* Iconos para tipos de eventos */
.timeline-evento.evento-creado .evento-descripcion::before {
    content: '🎫 ';
}

.timeline-evento.evento-estado_cambio .evento-descripcion::before {
    content: '🔄 ';
}

.timeline-evento.evento-agente_asignado .evento-descripcion::before {
    content: '👤 ';
}

.timeline-evento.evento-respuesta .evento-descripcion::before {
    content: '💬 ';
}

.timeline-evento.evento-cerrado .evento-descripcion::before {
    content: '🔒 ';
}

.timeline-evento.evento-reabierto .evento-descripcion::before {
    content: '🔓 ';
}

.timeline-evento.evento-prioridad_cambio .evento-descripcion::before {
    content: '⚡ ';
}

.timeline-evento.evento-editado .evento-descripcion::before {
    content: '✏️ ';
}

/* Responsive para timeline */
@media (max-width: 768px) {
    .ticket-timeline {
        padding-left: 30px;
    }

    .ticket-timeline::before {
        left: 10px;
    }

    .timeline-evento::before {
        left: -24px;
        width: 12px;
        height: 12px;
        border-width: 2px;
    }

    .evento-header {
        flex-direction: column;
        gap: 6px;
    }

    .evento-fecha {
        align-self: flex-start;
    }
}

/* ========================================
   TICKETS RELACIONADOS
======================================== */
.ticket-relacionados-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ticket-relacionados-section h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ticket-relacionados-section h3 .dashicons {
    color: #3b82f6;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.lista-tickets-relacionados {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lista-tickets-relacionados li {
    margin-bottom: 12px;
}

.ticket-relacionado-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.ticket-relacionado-link:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.ticket-relacionado-link .ticket-numero {
    font-weight: 600;
    color: #3b82f6;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.ticket-relacionado-link .ticket-titulo {
    flex: 1;
    color: #475569;
    font-size: 14px;
}

.ticket-relacionado-link .badge-estado {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.badge-estado.estado-abierto {
    background: #fef2f2;
    color: #dc2626;
}

.badge-estado.estado-en-progreso {
    background: #fffbeb;
    color: #d97706;
}

.badge-estado.estado-en-espera {
    background: #f8fafc;
    color: #64748b;
}

.badge-estado.estado-resuelto {
    background: #eff6ff;
    color: #2563eb;
}

.badge-estado.estado-cerrado {
    background: #f0fdf4;
    color: #16a34a;
}

/* Responsive */
@media (max-width: 768px) {
    .ticket-relacionado-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .ticket-relacionado-link .ticket-numero {
        font-size: 12px;
    }

    .ticket-relacionado-link .ticket-titulo {
        font-size: 13px;
    }
}

/* ========================================
   EDITOR ENRIQUECIDO TINYMCE
======================================== */
/* Asegurar que el editor TinyMCE se integre bien en el formulario */
.ticket-responder-form .wp-editor-wrap {
    margin-bottom: 15px;
}

/* Ocultar pestañas Visual/Texto para usuarios */
.ticket-responder-form .wp-editor-tabs {
    display: none !important;
}

.ticket-responder-form .wp-editor-container {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background: white !important;
}

.ticket-responder-form .mce-toolbar-grp {
    background: #f5f5f5 !important;
    border-bottom: 1px solid #ddd !important;
}

/* Forzar estilos de botones del editor TinyMCE */
.ticket-responder-form .mce-btn,
.ticket-responder-form .mce-btn button {
    background: #f7f7f7 !important;
    background-image: linear-gradient(to bottom, #fff, #f5f5f5) !important;
    border: 1px solid #ccc !important;
    color: #555 !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

.ticket-responder-form .mce-btn:hover,
.ticket-responder-form .mce-btn button:hover {
    background: #fafafa !important;
    background-image: linear-gradient(to bottom, #fff, #f0f0f0) !important;
    border-color: #999 !important;
    color: #333 !important;
}

.ticket-responder-form .mce-btn.mce-active,
.ticket-responder-form .mce-btn.mce-active button {
    background: #e5e5e5 !important;
    background-image: none !important;
    border-color: #aaa !important;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1) !important;
}

/* Iconos del editor */
.ticket-responder-form .mce-btn i {
    color: #555 !important;
}

.ticket-responder-form .mce-btn:hover i {
    color: #333 !important;
}

.ticket-responder-form .mce-btn.mce-active i {
    color: #222 !important;
}

/* Forzar estilos del menú desplegable de formato */
.ticket-responder-form .mce-listbox button {
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #555 !important;
}

/* Ajustar altura mínima del editor */
.ticket-responder-form .wp-editor-area {
    min-height: 200px !important;
}

/* Hacer que el iframe del editor sea redimensionable */
.ticket-responder-form iframe.wp-editor-area {
    resize: vertical;
    min-height: 200px;
}

/* Estilo para el contenido renderizado con formato */
.mensaje-contenido {
    line-height: 1.6;
}

.mensaje-contenido strong,
.mensaje-contenido b {
    font-weight: 600;
    color: #333;
}

.mensaje-contenido em,
.mensaje-contenido i {
    font-style: italic;
}

.mensaje-contenido u {
    text-decoration: underline;
}

.mensaje-contenido a {
    color: #0E3950;
    text-decoration: none;
    border-bottom: 1px solid #0E3950;
    transition: all 0.2s ease;
}

.mensaje-contenido a:hover {
    color: #1a5f7a;
    border-bottom-color: #1a5f7a;
}

.mensaje-contenido ul,
.mensaje-contenido ol {
    margin: 10px 0;
    padding-left: 25px;
}

.mensaje-contenido ul li,
.mensaje-contenido ol li {
    margin: 5px 0;
}

.mensaje-contenido blockquote {
    border-left: 4px solid #0E3950;
    margin: 15px 0;
    padding: 10px 20px;
    background: #f9f9f9;
    font-style: italic;
    color: #555;
}

.mensaje-contenido h1,
.mensaje-contenido h2,
.mensaje-contenido h3,
.mensaje-contenido h4,
.mensaje-contenido h5,
.mensaje-contenido h6 {
    margin: 15px 0 10px;
    color: #333;
    font-weight: 600;
}

.mensaje-contenido code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.mensaje-contenido pre {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 15px 0;
}

.mensaje-contenido pre code {
    background: none;
    padding: 0;
}

/* ========================================
   FORZAR ESTILOS CONTRA TEMA
======================================== */
/* Asegurar que los botones del formulario mantengan el estilo correcto */
.ticket-responder-form button[type="submit"],
.ticket-responder-form .erpae-btn-primary {
    background: #ECAD20 !important;
    background-color: #ECAD20 !important;
    background-image: none !important;
    color: #ffffff !important;
    border: none !important;
    border-color: transparent !important;
    text-shadow: none !important;
    font-weight: 600 !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.ticket-responder-form button[type="submit"]:hover,
.ticket-responder-form .erpae-btn-primary:hover {
    background: #d99a1c !important;
    background-color: #d99a1c !important;
    background-image: none !important;
    color: #ffffff !important;
    border-color: transparent !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(236, 173, 32, 0.4) !important;
}

.ticket-responder-form button[type="submit"]:active,
.ticket-responder-form button[type="submit"]:focus,
.ticket-responder-form .erpae-btn-primary:active,
.ticket-responder-form .erpae-btn-primary:focus {
    background: #c78a18 !important;
    background-color: #c78a18 !important;
    background-image: none !important;
    color: #ffffff !important;
    outline: none !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(236, 173, 32, 0.5) !important;
}

/* Iconos dentro del botón */
.ticket-responder-form button[type="submit"] .dashicons,
.ticket-responder-form .erpae-btn-primary .dashicons {
    color: #ffffff !important;
}

/* Forzar colores del panel del editor */
.ticket-responder-form .mce-panel {
    background: #f5f5f5 !important;
    border-color: #ddd !important;
}

/* Texto del editor */
.ticket-responder-form .mce-content-body {
    color: #333 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Separadores en la barra de herramientas */
.ticket-responder-form .mce-toolbar .mce-btn-group {
    border-color: #ccc !important;
}
