/* =============== VARIABLES =============== */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --background: #f9fafb;
    --surface: #ffffff;
    --border: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 0.5rem;
}

/* =============== RESET & BASE =============== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* =============== HEADER =============== */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* =============== BUTTONS =============== */
.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--background);
}

.btn-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
}

.btn-close:hover {
    background: var(--background);
    color: var(--text-primary);
}

/* =============== MAIN CONTENT =============== */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 100px);
}

.agents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.agents-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
}

.total-count {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* =============== AGENTS GRID =============== */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.agent-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.agent-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.agent-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.agent-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.agent-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.agent-status.active {
    background: #d1fae5;
    color: #065f46;
}

.agent-status.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.agent-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.agent-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.agent-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.agent-detail-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.agent-detail-value {
    color: var(--text-primary);
}

.agent-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #dcfce7;
    color: #166534;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.agent-timestamp {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* =============== EMPTY STATE =============== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state svg {
    margin: 0 auto 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
}

/* =============== MODAL =============== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* =============== FORM =============== */
form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* =============== LOADING =============== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* =============== TOAST =============== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--text-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 3000;
    max-width: 400px;
}

.toast.active {
    transform: translateY(0);
    opacity: 1;
}

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

.toast.error {
    background: var(--danger-color);
}

/* =============== RESPONSIVE =============== */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .agents-header {
        flex-direction: column;
        align-items: start;
        gap: 0.5rem;
    }

    .agents-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button {
        width: 100%;
    }

    .toast {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }
}

/* =============== DELETE MODAL =============== */
.modal-small {
    max-width: 450px;
}

.modal-body {
    padding: 1.5rem;
}

.warning-icon {
    text-align: center;
    margin-bottom: 1rem;
}

.warning-icon svg {
    color: var(--danger-color);
}

.delete-message {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.delete-message strong {
    color: var(--primary-color);
    font-weight: 600;
}

.delete-warning {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.delete-list {
    list-style: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.delete-list li {
    margin-bottom: 0.25rem;
}

.delete-final-warning {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* =============== AGENT CARD ACTIONS =============== */
.agent-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-icon:hover {
    background: var(--background);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-icon.delete:hover {
    background: #fef2f2;
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.btn-icon.edit {
    background-color: #f8f9fa;
}

.btn-icon.edit:hover {
    background-color: #4A90E2;
    color: white;
    border-color: #4A90E2;
}

.btn-icon.edit svg {
    width: 18px;
    height: 18px;
}

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

/* Responsive buttons for agent cards */
@media (max-width: 480px) {
    .agent-card-actions {
        flex-direction: column;
    }

    .btn-icon {
        width: 100%;
        justify-content: center;
    }
}

/* =============== TOOLS SECTION =============== */
.agent-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.tool-badge.whatsapp {
    background: #e7f5f0;
    border-color: #25D366;
    color: #128C7E;
}

.tool-badge.calendar {
    background: #e8f4fd;
    border-color: #4285F4;
    color: #1967D2;
}

.tool-badge.notes {
    background: #fff4e6;
    border-color: #FF9800;
    color: #E65100;
}

.tool-badge.telegram {
    background: #e8f4fb;
    border-color: #0088cc;
    color: #006699;
}

.agent-tools-empty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    margin-top: 1rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.agent-tools-empty svg {
    width: 20px;
    height: 20px;
    opacity: 0.5;
}

.btn-icon.tools {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-icon.tools:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* =============== TOOLS MODAL =============== */
.tools-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
}

.tool-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.tool-item.disabled {
    opacity: 0.5;
}

.tool-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.tool-details h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.tool-config {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.tool-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-tools {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-tools svg {
    width: 64px;
    height: 64px;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-tools p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.btn-add-tool {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* =============== AVAILABLE TOOLS =============== */
.available-tools {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
}

.tool-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.tool-option:hover {
    border-color: var(--primary-color);
    background: var(--background);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tool-option .tool-icon {
    font-size: 2.5rem;
}

.tool-option h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.tool-option p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* =============== NOTES VIEWER =============== */
.btn-icon.view {
    background-color: #f8f9fa;
}

.btn-icon.view:hover {
    background-color: #34a853;
    color: white;
    border-color: #34a853;
}

.notes-count-badge {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: normal;
    margin-left: 0.5rem;
}

.notes-viewer-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
}

.note-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    transition: box-shadow 0.2s;
}

.note-card:hover {
    box-shadow: var(--shadow-md);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.note-title {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    flex: 1;
}

.note-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.note-text {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.note-tag {
    display: inline-flex;
    padding: 0.125rem 0.5rem;
    background: #e8f4fd;
    color: #1967D2;
    border-radius: 1rem;
    font-size: 0.75rem;
}

.empty-notes {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* =============== INFO BOX =============== */
.info-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #e8f4fd;
    border: 1px solid #4285F4;
    border-radius: var(--radius);
    margin-top: 1rem;
}

.info-box svg {
    width: 20px;
    height: 20px;
    color: #1967D2;
    flex-shrink: 0;
}

.info-box span {
    font-size: 0.875rem;
    color: #1967D2;
}

/* =============== CHAT MODAL =============== */

.chat-modal-overlay {
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.chat-modal-container {
    background: #ece5dd;
    border-radius: var(--radius);
    width: 100%;
    max-width: 640px;
    height: 90vh;
    max-height: 820px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.25s ease-out;
}

/* ---- Header ---- */
.chat-header {
    background: #075E54;
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-agent-name {
    font-weight: 600;
    font-size: 1rem;
    color: white;
}

.chat-agent-status {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.8);
}

.chat-close-btn {
    color: rgba(255,255,255,0.85) !important;
    font-size: 1.75rem;
    line-height: 1;
}

.chat-close-btn:hover {
    background: rgba(255,255,255,0.15) !important;
    color: white !important;
}

/* ---- Messages Area ---- */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 2px;
}

/* ---- Loading ---- */
.chat-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    height: 100%;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.chat-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top-color: #25D366;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ---- Message Bubbles ---- */
.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.chat-message.user {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message.assistant {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-bubble {
    padding: 0.5rem 0.875rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
    max-width: 100%;
}

.chat-message.user .chat-bubble {
    background: #dcf8c6;
    color: #111827;
    border-bottom-right-radius: 0.25rem;
}

.chat-message.assistant .chat-bubble {
    background: #ffffff;
    color: #111827;
    border-bottom-left-radius: 0.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.chat-source-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.75rem;
    margin-bottom: 0.2rem;
    display: inline-block;
}

.chat-source-badge.whatsapp {
    background: #e7f5f0;
    color: #128C7E;
    border: 1px solid #25D366;
}

.chat-source-badge.telegram {
    background: #e8f4fb;
    color: #0088cc;
    border: 1px solid #0088cc;
}

.chat-timestamp {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
    padding: 0 0.25rem;
}

/* ---- Date Separator ---- */
.chat-date-separator {
    text-align: center;
    margin: 0.625rem 0;
}

.chat-date-separator span {
    background: rgba(225, 245, 254, 0.9);
    color: #546E7A;
    font-size: 0.75rem;
    padding: 0.2rem 0.875rem;
    border-radius: 1rem;
    box-shadow: 0 1px 1px rgba(0,0,0,0.06);
}

/* ---- Empty State ---- */
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    gap: 0.5rem;
    text-align: center;
    padding: 2rem;
}

.chat-empty-state svg {
    opacity: 0.25;
    margin-bottom: 0.25rem;
}

/* ---- Typing Indicator ---- */
.chat-typing-indicator {
    padding: 0.375rem 1rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.typing-bubble {
    background: white;
    border-radius: 1rem;
    padding: 0.4rem 0.625rem;
    display: flex;
    gap: 0.25rem;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.typing-bubble span {
    width: 6px;
    height: 6px;
    background: #90A4AE;
    border-radius: 50%;
    display: inline-block;
    animation: typingDot 1.2s infinite;
}

.typing-bubble span:nth-child(2) { animation-delay: 0.2s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.typing-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ---- Input Area ---- */
.chat-input-area {
    background: #f0f0f0;
    padding: 0.625rem 0.875rem;
    display: flex;
    align-items: flex-end;
    gap: 0.625rem;
    flex-shrink: 0;
    border-top: 1px solid var(--border);
}

.chat-input {
    flex: 1;
    background: white;
    border: none;
    border-radius: 1.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.chat-input::placeholder { color: #9E9E9E; }

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #25D366;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    background: #128C7E;
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    background: #BDBDBD;
    cursor: not-allowed;
    transform: none;
}

/* ---- Chat button on agent card ---- */
.btn-icon.chat {
    background: #e7f5f0;
    color: #128C7E;
    border-color: #b2dfdb;
}

.btn-icon.chat:hover {
    background: #25D366;
    color: white;
    border-color: #25D366;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .chat-modal-overlay { padding: 0; }
    .chat-modal-container {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }
    .chat-message { max-width: 88%; }
}

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