/**
 * Estilos para el Sistema de Gestión de Agentes
 * Tickets Lawgic
 */

/* Sección de Agentes */
.agents-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.agents-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.agents-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0;
}

/* Tabla de Agentes */
.agents-table {
    width: 100%;
    border-collapse: collapse;
}

.agents-table th,
.agents-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.agents-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}

.agents-table tr.inactive {
    opacity: 0.6;
}

/* Nombre del Agente con Avatar */
.agent-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.agent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--blue-500);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* Badges de Estado */
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: var(--green-100);
    color: var(--green-700);
}

.status-badge.inactive {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* Botones de Acción */
.agent-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 6px;
    border: none;
    background: var(--gray-50);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--gray-100);
}

.btn-icon.delete:hover {
    background: var(--red-50);
}

/* Modal Overlay para Agentes */
#agentModal.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

/* Contenido del Modal */
.modal-content.agent-modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.2s ease;
}

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

/* Header del Modal */
.agent-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.agent-modal .modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0;
}

.agent-modal .close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.agent-modal .close-btn:hover {
    background: var(--gray-200);
    color: var(--text-heading);
}

/* Formulario del Modal */
.agent-modal form {
    padding: 24px;
}

.agent-modal .form-group {
    margin-bottom: 16px;
}

.agent-modal label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.agent-modal input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}

.agent-modal input:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px var(--blue-50);
}

.agent-modal input::placeholder {
    color: var(--gray-400);
}

/* Acciones del Formulario */
.agent-modal .form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.agent-modal .btn-secondary {
    padding: 10px 20px;
    border: 1px solid var(--gray-200);
    background: white;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-700);
}

.agent-modal .btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.agent-modal .btn-primary {
    padding: 10px 20px;
    border: none;
    background: var(--blue-500);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 14px;
}

.agent-modal .btn-primary:hover {
    background: var(--blue-600);
}

.agent-modal .btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

/* Estado Vacío */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-caption);
}

.empty-state p {
    margin: 8px 0;
}

/* Notificaciones */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 10000;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.success {
    background: var(--green-500);
}

.notification.error {
    background: var(--red-500);
}

.notification.info {
    background: var(--blue-500);
}

/* Select para Asignación de Agentes */
.agent-select {
    padding: 6px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.agent-select:focus {
    outline: none;
    border-color: var(--blue-500);
}

/* Responsive */
@media (max-width: 768px) {
    .agents-table {
          display: block;
          overflow-x: auto;
    }

  .agents-section .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
  }
}

/* ============================================
   SISTEMA DE RESPUESTAS - ESTILOS
   ============================================ */

/* Panel de Respuestas */
.response-panel {
        background: white;
        border-radius: 12px;
        padding: 20px;
        margin-top: 20px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        border: 1px solid var(--gray-200);
}

.response-panel-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--gray-100);
}

.response-panel-header h4 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        color: var(--text-heading);
}

/* Badge de Asignación */
.assignment-badge {
        padding: 4px 12px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 500;
}

.badge-human {
        background: var(--blue-100);
        color: var(--blue-700);
}

.badge-ai-supervised {
        background: var(--green-100);
        color: var(--green-700);
}

.badge-ai-auto {
        background: var(--amber-50);
        color: var(--amber-500);
}

/* Historial de Respuestas */
.responses-history {
        max-height: 300px;
        overflow-y: auto;
        margin-bottom: 16px;
        padding: 12px;
        background: var(--gray-50);
        border-radius: 8px;
}

.no-responses {
        text-align: center;
        color: var(--text-caption);
        padding: 20px;
        font-style: italic;
}

.response-item {
        background: white;
        padding: 12px;
        border-radius: 8px;
        margin-bottom: 12px;
        border-left: 3px solid var(--gray-300);
}

.response-item.ai {
        border-left-color: var(--green-500);
        background: var(--green-50);
}

.response-item.human {
        border-left-color: var(--blue-500);
        background: var(--blue-50);
}

.response-item.new-response {
        animation: fadeIn 0.3s ease-out;
}

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

.response-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
}

.response-author {
        font-weight: 600;
        font-size: 13px;
        color: var(--text-heading);
}

.response-time {
        font-size: 11px;
        color: var(--text-caption);
}

.response-message {
        font-size: 14px;
        line-height: 1.5;
        color: var(--text-body);
}

.response-edited {
        font-size: 11px;
        color: var(--text-caption);
        margin-top: 8px;
        font-style: italic;
}

/* Sección de Sugerencia de IA */
.ai-suggestion-section {
        background: linear-gradient(135deg, var(--green-50) 0%, #f0fdf4 100%);
        border: 1px solid var(--green-200);
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 16px;
}

.ai-suggestion-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
}

.ai-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 10px;
        background: var(--green-500);
        color: white;
        border-radius: 16px;
        font-size: 12px;
        font-weight: 500;
}

.btn-regenerate {
        background: transparent;
        border: 1px solid var(--green-300);
        color: var(--green-600);
        padding: 4px 10px;
        border-radius: 6px;
        font-size: 12px;
        cursor: pointer;
        transition: all 0.2s;
}

.btn-regenerate:hover {
        background: var(--green-100);
}

.ai-suggestion-content {
        background: white;
        border-radius: 8px;
        padding: 16px;
        min-height: 80px;
}

.suggestion-text {
        font-size: 14px;
        line-height: 1.6;
        color: var(--text-body);
}

.loading-suggestion {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 20px;
        color: var(--text-caption);
}

.spinner {
        width: 24px;
        height: 24px;
        border: 3px solid var(--gray-200);
        border-top-color: var(--green-500);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
}

@keyframes spin {
        to { transform: rotate(360deg); }
}

.suggestion-error {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 20px;
        color: var(--red-500);
}

.suggestion-error button {
        background: var(--red-50);
        border: 1px solid var(--red-200);
        color: var(--red-600);
        padding: 6px 12px;
        border-radius: 6px;
        cursor: pointer;
}

/* Acciones de IA */
.ai-suggestion-actions {
        display: flex;
        gap: 10px;
        margin-top: 12px;
        flex-wrap: wrap;
}

.btn-approve {
        background: var(--green-500);
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s;
}

.btn-approve:hover {
        background: var(--green-600);
        transform: translateY(-1px);
}

.btn-edit {
        background: white;
        color: var(--blue-600);
        border: 1px solid var(--blue-300);
        padding: 10px 20px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s;
}

.btn-edit:hover {
        background: var(--blue-50);
}

.btn-reject {
        background: white;
        color: var(--gray-600);
        border: 1px solid var(--gray-300);
        padding: 10px 20px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s;
}

.btn-reject:hover {
        background: var(--gray-100);
}

/* Sección de Respuesta Manual */
.manual-response-section {
        background: var(--gray-50);
        border: 1px solid var(--gray-200);
        border-radius: 12px;
        padding: 16px;
}

.manual-response-header {
        margin-bottom: 12px;
        font-weight: 500;
        color: var(--text-heading);
}

.response-textarea {
        width: 100%;
        padding: 12px;
        border: 1px solid var(--gray-300);
        border-radius: 8px;
        font-size: 14px;
        font-family: inherit;
        resize: vertical;
        min-height: 100px;
        transition: border-color 0.2s;
}

.response-textarea:focus {
        outline: none;
        border-color: var(--blue-500);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.manual-response-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 12px;
}

.btn-cancel {
        background: white;
        color: var(--gray-600);
        border: 1px solid var(--gray-300);
        padding: 10px 20px;
        border-radius: 8px;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.2s;
}

.btn-cancel:hover {
        background: var(--gray-100);
}

.btn-send {
        background: var(--blue-500);
        color: white;
        border: none;
        padding: 10px 24px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s;
}

.btn-send:hover {
        background: var(--blue-600);
        transform: translateY(-1px);
}

/* Toast Notifications */
.toast-notification {
        position: fixed;
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        z-index: 9999;
        transform: translateY(100px);
        opacity: 0;
        transition: all 0.3s ease;
}

.toast-notification.show {
        transform: translateY(0);
        opacity: 1;
}

.toast-success {
        background: var(--green-500);
        color: white;
}

.toast-error {
        background: var(--red-500);
        color: white;
}

.toast-info {
        background: var(--blue-500);
        color: white;
}

/* Responsive */
@media (max-width: 768px) {
        .ai-suggestion-actions {
                    flex-direction: column;
        }

        .ai-suggestion-actions button {
                    width: 100%;
        }

        .manual-response-actions {
                    flex-direction: column;
        }

        .manual-response-actions button {
                    width: 100%;
        }
}

/* ==================== KANBAN BOARD ==================== */

.kanban-card {
    background: white;
        border-radius: 10px;
            padding: 14px;
                margin-bottom: 10px;
                    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
                        cursor: grab;
                            transition: all 0.2s ease;
                                border-left: 4px solid transparent;
                                    position: relative;
                                    }
                                    .kanban-card:hover {
                                        box-shadow: 0 4px 12px rgba(0,0,0,0.12);
                                            transform: translateY(-2px);
                                            }
                                            .kanban-card.dragging {
                                                opacity: 0.5;
                                                    transform: rotate(2deg) scale(1.02);
                                                        cursor: grabbing;
                                                            box-shadow: 0 8px 25px rgba(0,0,0,0.2);
                                                            }
                                                            .kanban-card.priority-alta { border-left-color: #ef4444; }
                                                            .kanban-card.priority-media { border-left-color: #f59e0b; }
                                                            .kanban-card.priority-baja { border-left-color: #22c55e; }

                                                            .kanban-card__id {
                                                                font-size: 11px;
                                                                    color: #94a3b8;
                                                                        font-weight: 600;
                                                                            font-family: monospace;
                                                                                margin-bottom: 6px;
                                                                                }
                                                                                .kanban-card__title {
                                                                                    font-size: 13px;
                                                                                        font-weight: 600;
                                                                                            color: #1e293b;
                                                                                                margin-bottom: 8px;
                                                                                                    line-height: 1.4;
                                                                                                        display: -webkit-box;
                                                                                                            -webkit-line-clamp: 2;
                                                                                                                -webkit-box-orient: vertical;
                                                                                                                    overflow: hidden;
                                                                                                                    }
                                                                                                                    .kanban-card__tags {
                                                                                                                        display: flex;
                                                                                                                            flex-wrap: wrap;
                                                                                                                                gap: 4px;
                                                                                                                                    margin-bottom: 8px;
                                                                                                                                    }
                                                                                                                                    .kanban-card__tag {
                                                                                                                                        font-size: 10px;
                                                                                                                                            padding: 2px 8px;
                                                                                                                                                border-radius: 20px;
                                                                                                                                                    font-weight: 600;
                                                                                                                                                        text-transform: uppercase;
                                                                                                                                                            letter-spacing: 0.3px;
                                                                                                                                                            }
                                                                                                                                                            .kanban-card__tag--priority-alta { background: #fef2f2; color: #dc2626; }
                                                                                                                                                            .kanban-card__tag--priority-media { background: #fffbeb; color: #d97706; }
                                                                                                                                                            .kanban-card__tag--priority-baja { background: #f0fdf4; color: #16a34a; }
                                                                                                                                                            .kanban-card__tag--category { background: #f0f9ff; color: #0284c7; }
                                                                                                                                                            .kanban-card__tag--product { background: #faf5ff; color: #9333ea; }

                                                                                                                                                            .kanban-card__contact {
                                                                                                                                                                font-size: 12px;
                                                                                                                                                                    color: #64748b;
                                                                                                                                                                        display: flex;
                                                                                                                                                                            align-items: center;
                                                                                                                                                                                gap: 4px;
                                                                                                                                                                                    margin-top: 6px;
                                                                                                                                                                                    }
                                                                                                                                                                                    .kanban-card__date {
                                                                                                                                                                                        font-size: 11px;
                                                                                                                                                                                            color: #94a3b8;
                                                                                                                                                                                                margin-top: 6px;
                                                                                                                                                                                                }

                                                                                                                                                                                                .kanban-column-body.drag-over {
                                                                                                                                                                                                    border-color: #3b82f6 !important;
                                                                                                                                                                                                        background: #eff6ff !important;
                                                                                                                                                                                                        }

                                                                                                                                                                                                        .kanban-empty {
                                                                                                                                                                                                            text-align: center;
                                                                                                                                                                                                                padding: 40px 16px;
                                                                                                                                                                                                                    color: #cbd5e1;
                                                                                                                                                                                                                        font-size: 13px;
                                                                                                                                                                                                                            font-style: italic;
                                                                                                                                                                                                                            }

                                                                                                                                                                                                                            .kanban-card-enter {
                                                                                                                                                                                                                                animation: kanbanCardEnter 0.3s ease forwards;
                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                @keyframes kanbanCardEnter {
                                                                                                                                                                                                                                    from { opacity: 0; transform: translateY(10px); }
                                                                                                                                                                                                                                        to { opacity: 1; transform: translateY(0); }
                                                                                                                                                                                                                                        }

                                                                                                                                                                                                                                        #kanban-filters select:focus {
                                                                                                                                                                                                                                            outline: none;
                                                                                                                                                                                                                                                border-color: #3b82f6;
                                                                                                                                                                                                                                                    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
                                                                                                                                                                                                                                                    }

                                                                                                                                                                                                                                                    @media (max-width: 1200px) {
                                                                                                                                                                                                                                                        #kanban-board { grid-template-columns: repeat(2, 1fr) !important; }
                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                        @media (max-width: 768px) {
                                                                                                                                                                                                                                                            #kanban-board { grid-template-columns: 1fr !important; }
                                                                                                                                                                                                                                                            }


/* ====================== AGENT CARD LIST UI ====================== */
.agent-card-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.agent-card-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    transition: background 0.15s;
    cursor: pointer;
    position: relative;
}

.agent-card-item:last-child {
    border-bottom: none;
}

.agent-card-item:hover {
    background: var(--gray-50);
}

.agent-avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    color: white;
    flex-shrink: 0;
    margin-right: 14px;
}

.agent-card-info {
    flex: 1;
    min-width: 0;
}

.agent-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-card-email {
    font-size: 13px;
    color: var(--text-caption);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-card-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
}

.agent-role-badge {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--gray-200);
    color: var(--text-body);
    background: white;
}

.agent-role-badge.admin {
    background: var(--blue-50);
    color: var(--blue-600);
    border-color: var(--blue-200);
}

.agent-menu-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 18px;
    letter-spacing: 2px;
    transition: all 0.15s;
}

.agent-menu-btn:hover {
    background: var(--gray-100);
    color: var(--text-heading);
}

.agent-dropdown-menu {
    position: absolute;
    right: 20px;
    top: 52px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow-card-hover);
    min-width: 180px;
    z-index: 100;
    overflow: hidden;
    display: none;
}

.agent-dropdown-menu.show {
    display: block;
}

.agent-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-body);
    cursor: pointer;
    transition: background 0.1s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.agent-dropdown-item:hover {
    background: var(--gray-50);
}

.agent-dropdown-item.danger {
    color: var(--red-500);
}

.agent-dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ====================== AGENT DETAIL PANEL ====================== */
.agent-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.agent-detail-overlay.show {
    opacity: 1;
    visibility: visible;
}

.agent-detail-panel {
    position: fixed;
    top: 0;
    right: -560px;
    bottom: 0;
    width: min(520px, 90vw);
    background: white;
    z-index: 1000;
    box-shadow: -4px 0 24px rgba(0,0,0,0.08);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.agent-detail-panel.show {
    right: 0;
}

.adp-header {
    padding: 28px 28px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.adp-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-50);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 18px;
    transition: all 0.15s;
}

.adp-close-btn:hover {
    background: var(--gray-100);
    color: var(--text-heading);
}

.adp-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 26px;
    color: white;
    margin-bottom: 14px;
}

.adp-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.adp-email {
    font-size: 13px;
    color: var(--text-caption);
    margin-bottom: 12px;
}

.adp-badges {
    display: flex;
    gap: 8px;
}

.adp-badge {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
}

.adp-badge.role {
    background: var(--blue-50);
    color: var(--blue-600);
}

.adp-badge.active {
    background: var(--green-50);
    color: var(--green-600);
}

.adp-badge.inactive {
    background: var(--red-50);
    color: var(--red-500);
}

/* Panel body */
.adp-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}

/* Stats row */
.adp-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.adp-stat-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}

.adp-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-heading);
}

.adp-stat-label {
    font-size: 11px;
    color: var(--text-caption);
    margin-top: 2px;
}

/* Security section */
.adp-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.adp-section-title svg {
    width: 16px;
    height: 16px;
    color: var(--gray-500);
}

.adp-security-card {
    border: 1.25px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.adp-security-row {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.adp-security-row:last-child {
    border-bottom: none;
}

.adp-security-row.danger {
    background: var(--red-50);
}

.adp-security-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.adp-security-icon.green {
    background: var(--green-50);
    color: var(--green-600);
}

.adp-security-icon.blue {
    background: var(--blue-50);
    color: var(--blue-600);
}

.adp-security-icon.purple {
    background: #FAF5FF;
    color: #9333EA;
}

.adp-security-icon.red {
    background: var(--red-50);
    color: var(--red-500);
}

.adp-security-icon svg {
    width: 18px;
    height: 18px;
}

.adp-security-info {
    flex: 1;
    min-width: 0;
}

.adp-security-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-heading);
}

.adp-security-desc {
    font-size: 11px;
    color: var(--text-caption);
    margin-top: 1px;
}

.adp-security-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

/* Toggle switch */
.adp-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.adp-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.adp-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--gray-300);
    border-radius: 11px;
    transition: background 0.2s;
}

.adp-toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.adp-toggle input:checked + .adp-toggle-slider {
    background: var(--green-500);
}

.adp-toggle input:checked + .adp-toggle-slider::before {
    transform: translateX(18px);
}

.adp-toggle-label {
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
}

.adp-toggle-label.active {
    color: var(--green-600);
}

.adp-toggle-label.inactive {
    color: var(--red-500);
}

/* Small buttons in security */
.adp-btn-sm {
    font-size: 12px;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--gray-200);
    background: white;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.adp-btn-sm:hover {
    background: var(--gray-50);
}

.adp-btn-sm.primary {
    background: var(--blue-500);
    color: white;
    border-color: var(--blue-500);
}

.adp-btn-sm.primary:hover {
    background: var(--blue-600);
}

.adp-btn-sm.danger {
    color: var(--red-500);
    border-color: #FECACA;
    background: var(--red-50);
}

.adp-btn-sm.danger:hover {
    background: #FEE2E2;
}

/* Role pill selector */
.adp-role-pills {
    display: flex;
    gap: 0;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.adp-role-pill {
    font-size: 12px;
    font-weight: 500;
    padding: 5px 14px;
    border: none;
    background: white;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    color: var(--text-body);
}

.adp-role-pill.selected {
    background: var(--blue-500);
    color: white;
}

/* Info grid */
.adp-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.adp-info-item label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-caption);
    display: block;
    margin-bottom: 4px;
}

.adp-info-item span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-heading);
}

/* Tickets list in panel */
.adp-tickets-list {
    margin-bottom: 20px;
}

.adp-ticket-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.adp-ticket-item:last-child {
    border-bottom: none;
}

.adp-ticket-id {
    font-weight: 600;
    color: var(--blue-600);
    margin-right: 10px;
    font-size: 12px;
}

.adp-ticket-subject {
    flex: 1;
    color: var(--text-body);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adp-empty-state {
    text-align: center;
    padding: 24px;
    color: var(--text-caption);
    font-size: 13px;
}

.adp-empty-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.4;
}

/* Panel footer */
.adp-footer {
    padding: 16px 28px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 12px;
}

.adp-footer-btn {
    flex: 1;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s;
    font-family: inherit;
}

.adp-footer-btn.primary {
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
    color: white;
    box-shadow: var(--shadow-blue);
}

.adp-footer-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59,130,246,0.35);
}

.adp-footer-btn.outline-danger {
    background: white;
    color: var(--red-500);
    border: 1.5px solid #FECACA;
}

.adp-footer-btn.outline-danger:hover {
    background: var(--red-50);
}

.adp-footer-btn svg {
    width: 16px;
    height: 16px;
}

/* Password change inline form */
.adp-password-form {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 16px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
}

.adp-password-form input {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
}

.adp-password-form input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* Role restrictions for agents */
body.agent-role .admin-only {
    display: none !important;
}

body.agent-role .kanban-column[data-status="cerrado"] {
    opacity: 0.35;
    pointer-events: none;
}

body.agent-role .btn-small--success {
    display: none !important;
}

