/* ================= EXISTENTE ================= */
.scw-dashboard {
    background: #fff;
    padding: 20px;
}

.scw-table {
    width: 100%;
    border-collapse: collapse;
}

.scw-table th,
.scw-table td {
    border: 1px solid #ddd;
    padding: 8px;
}

.scw-table th {
    background: #f4f4f4;
}

.scw-tabs {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 20px;
    border-bottom: 1px solid #ccc;
    margin-bottom: 20px;
}

.scw-tabs li {
    cursor: pointer;
    padding: 8px 12px;
}

.scw-tabs li.active {
    font-weight: bold;
    border-bottom: 2px solid #000;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ====== LAYOUT GENERAL ====== */
.scw-lead-page {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ====== CARDS ====== */
.scw-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.scw-card-header {
    background: linear-gradient(135deg, #2c7be5, #1a56db);
    color: #fff;
}

.scw-card-header h2 {
    margin: 0;
}

/* ====== TABS ====== */
.scw-tabs {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 25px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.scw-tabs li {
    cursor: pointer;
    padding: 10px 0;
    color: #6b7280;
    font-weight: 500;
}

.scw-tabs li.active {
    color: #1a56db;
    border-bottom: 3px solid #1a56db;
}

/* ====== TAB CONTENT ====== */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ====== LISTAS INFO ====== */
.tab-panel ul {
    padding-left: 18px;
}

.tab-panel li {
    margin-bottom: 6px;
}

/* ====== FORMULARIOS ====== */
input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 14px;
}

textarea {
    resize: vertical;
}

button {
    background: #1a56db;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

button:hover {
    background: #1e40af;
}

/* ====== HISTORIAL ====== */
.scw-history-item {
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 4px solid #1a56db;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f3f4f6;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

tbody tr:hover {
    background: #f9fafb;
}

a {
    color: #1a56db;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ====== ESTADOS ====== */
.scw-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.scw-status-nuevo {
    background: #e3f2fd;
    color: #1565c0;
}

.scw-status-contactado {
    background: #fff3e0;
    color: #ef6c00;
}

.scw-status-seguimiento {
    background: #ede7f6;
    color: #5e35b1;
}

.scw-status-cerrado {
    background: #e8f5e9;
    color: #2e7d32;
}

/* ===== DASHBOARD LAYOUT ===== */
.scw-dashboard-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* ===== SIDEBAR ===== */
.scw-dashboard-sidebar {
    width: 260px;
    flex-shrink: 0;
}

.scw-sidebar-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.scw-sidebar-user {
    text-align: center;
    margin-bottom: 20px;
}

.scw-sidebar-user img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 10px;
}

.scw-sidebar-user h3 {
    margin: 6px 0 2px;
    font-size: 17px;
}

.scw-sidebar-user span {
    font-size: 13px;
    color: #6b7280;
}

/* ===== STATS ===== */
.scw-sidebar-stats ul {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

.scw-sidebar-stats li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
}

/* ===== CONTENIDO ===== */
.scw-dashboard-content {
    flex: 1;
}

/* ===================================================== */
/* ===== NUEVO: CENTRADO + ANCHO CORRECTO ===== */
/* ===================================================== */
.scw-dashboard-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* ===================================================== */
/* ===== NUEVO: RESPONSIVE (TABLET + MOBILE) ===== */
/* ===================================================== */
@media (max-width: 900px) {

    .scw-dashboard-layout {
        flex-direction: column;
        padding: 15px;
    }

    .scw-dashboard-sidebar {
        width: 100%;
    }

    .scw-dashboard-content {
        width: 100%;
    }
}
/* ===================================================== */
/* ===== MEJORAS VISUALES LISTADO DE LEADS ===== */
/* ===================================================== */

/* Tipografía general del listado */
.scw-dashboard-content table {
    font-size: 13.5px;
    color: #374151;
}

/* Encabezados más pro */
.scw-dashboard-content thead th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

/* Filas más limpias */
.scw-dashboard-content tbody tr {
    transition: background 0.2s ease;
}

.scw-dashboard-content tbody tr:hover {
    background: #f3f4f6;
}

/* Celdas */
.scw-dashboard-content td {
    vertical-align: middle;
}

/* ===== NOMBRE DEL LEAD COMO TARJETA ===== */
.scw-dashboard-content td:first-child a {
    display: inline-block;
    padding: 6px 10px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    font-weight: 600;
    color: #1a56db;
    transition: all 0.2s ease;
}

.scw-dashboard-content td:first-child a:hover {
    background: #f0f7ff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    text-decoration: none;
}

/* ===== EMAIL Y TELEFONO MÁS SUTILES ===== */
.scw-dashboard-content td:nth-child(2),
.scw-dashboard-content td:nth-child(3) {
    font-size: 13px;
    color: #6b7280;
}

/* ===== COLUMNA AGENTE ===== */
.scw-dashboard-content td:last-child {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

/* ===== MOBILE: TABLA MÁS COMPACTA ===== */
@media (max-width: 700px) {

    .scw-dashboard-content table {
        font-size: 13px;
    }

    .scw-dashboard-content td:first-child a {
        display: block;
        width: fit-content;
    }
}

/* HASTA AQUI BIEN
/* ===================================================== */
/* ===== CAMBIO DE ESTADO POR HOVER ===== */
/* ===================================================== */

.scw-status-wrapper {
    position: relative;
    display: inline-block;
}

.scw-status-form {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #ffffff;
    padding: 6px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 10;
    white-space: nowrap;
}

.scw-status-wrapper:hover .scw-status-form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.scw-status-form select {
    font-size: 12px;
    padding: 4px 6px;
}

.scw-status-form button {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1;
}
/* ===================================================== */
/* ===== MEJORA UX BOTÓN CAMBIO DE ESTADO ===== */
/* ===================================================== */

.scw-status-form button {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover más evidente */
.scw-status-form button:hover {
    background: #1e40af;
    transform: scale(1.05);
}

/* Área clickeable más cómoda */
.scw-status-form {
    gap: 8px;
}
/* ===================================================== */
/* ===== AUTO-GUARDADO ESTADO (SIN BOTÓN) ===== */
/* ===================================================== */

.scw-status-form {
    padding: 6px;
}

.scw-status-select {
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
}

/* Feedback visual */
.scw-status-select:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow: 0 0 0 2px rgba(26,86,219,0.2);
}
/* HASTA AQUI VAMOS BIEN
/*------------------------------------------------------------------------------------------
/* ===================================================== */
/* ===== LAYOUT LEAD VIEW (SIDEBAR + CONTENT) ===== */
/* ===================================================== */

.scw-lead-layout {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.scw-lead-content {
    width: 100%;
}


/* ===== SIDEBAR ===== */
.scw-lead-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.scw-lead-sidebar h3 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 18px;
}

.scw-lead-sidebar p {
    margin: 4px 0;
    font-size: 14px;
    color: #374151;
}

.scw-lead-sidebar label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: #6b7280;
}

.scw-lead-sidebar select {
    width: 100%;
    font-size: 13px;
    padding: 8px;
    border-radius: 6px;
}

/* ===== CONTENT ===== */
.scw-lead-content {
    flex: 1;
    min-width: 0;
}

/* ===================================================== */
/* ===== AUTO GUARDADO STATUS ===== */
/* ===================================================== */

.scw-status-form {
    margin-top: 6px;
}

.scw-status-select {
    width: 100%;
    font-size: 13px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
}

.scw-status-select:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow: 0 0 0 2px rgba(26,86,219,0.2);
}

/* ===================================================== */
/* ===== TABS MEJORADAS ===== */
/* ===================================================== */

.scw-tabs {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 24px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.scw-tabs li {
    cursor: pointer;
    padding: 10px 0;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.scw-tabs li.active {
    color: #1a56db;
    border-bottom: 3px solid #1a56db;
}

/* ===================================================== */
/* ===== RESPONSIVE ===== */
/* ===================================================== */

@media (max-width: 900px) {

    .scw-lead-layout {
        flex-direction: column;
    }

    .scw-lead-sidebar {
        width: 100%;
    }

}
/* ===================================================== */
/* ===== EMAIL TAB LAYOUT ===== */
/* ===================================================== */

.scw-email-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 24px;
}

/* Columna izquierda: enviar */
.scw-email-compose {
    width: 35%;
}

/* Columna derecha: historial */
.scw-email-history {
    flex: 1;
}

/* ===== LISTADO HISTORIAL ===== */

.scw-email-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.scw-email-item {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    margin-bottom: 10px;
    transition: background 0.2s, box-shadow 0.2s;
}

.scw-email-item:hover {
    background: #f9fafb;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.scw-email-item p {
    margin: 6px 0 0;
    font-size: 13px;
    color: #6b7280;
}

/* ===== VISOR EMAIL ===== */

.scw-email-viewer {
    margin-top: 20px;
}

.scw-email-view-subject {
    margin-bottom: 6px;
}

.scw-email-view-meta {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}

.scw-email-view-message {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.5;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 900px) {
    .scw-email-layout {
        flex-direction: column;
    }

    .scw-email-compose,
    .scw-email-history {
        width: 100%;
    }
}
.scw-email-item.active {
    border-color: #1a56db;
    background: #eef2ff;
}
.scw-email-view-attachment {
    font-size: 13px;
    color: #374151;
    margin-bottom: 10px;
}
.scw-note-item {
    cursor: pointer;
}

.scw-note-item.active {
    background: #f1f5ff;
    border-left: 4px solid #1a56db;
}
/* =========================
   NOTAS – ESTILO TIPO EMAIL
========================= */

.scw-note-item {
    list-style: none;
    padding: 14px 16px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scw-note-item:hover {
    background: #f1f5ff;
    border-color: #2563eb;
}

.scw-note-item.active {
    background: #eef4ff;
    border-color: #2563eb;
    box-shadow: inset 3px 0 0 #2563eb;
}

/* Texto interno */
.scw-note-item strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.scw-note-item em {
    font-size: 12px;
    color: #6b7280;
    display: block;
    margin-bottom: 6px;
}

.scw-note-item p {
    font-size: 13px;
    color: #374151;
    margin: 0;
}

/* =========================
   NOTAS – AJUSTE DE ANCHO
========================= */

/* Layout general de notas */
#tab-notes .scw-email-layout {
    display: grid;
    grid-template-columns: 1fr 1.4fr; /* historial más ancho */
    gap: 24px;
}

/* Historial de notas más ancho */
#tab-notes .scw-card:nth-child(2) {
    min-width: 0;
}
.scw-pagination {
    margin-top: 15px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.scw-pagination a {
    padding: 6px 10px;
    border-radius: 6px;
    background: #f3f4f6;
    text-decoration: none;
    font-size: 13px;
    color: #333;
    transition: 0.2s;
}

.scw-pagination a:hover {
    background: #dbeafe;
}

.scw-pagination a.active {
    background: #2563eb;
    color: white;
}
.scw-info-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.scw-info-card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

.scw-info-card label {
    display:block;
    margin-top:12px;
    font-weight:600;
}

.scw-info-card input,
.scw-info-card textarea,
.scw-info-card select {
    width:100%;
    margin-top:5px;
}
/* ===== ACTIVITY CARD ===== */

.scw-activity-card h4 {
    margin-bottom: 12px;
    font-size: 15px;
}

.scw-activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.scw-activity-list li {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.scw-activity-list li span {
    color: #6b7280;
    font-size: 12px;
}

/* ===== INFO GRID ===== */

.scw-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.scw-info-field label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: #6b7280;
}

.scw-info-full {
    margin-top: 10px;
}

.scw-info-full label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: #6b7280;
}

.scw-info-full textarea {
    width: 100%;
    min-height: 120px;
}

/* Responsive */
@media (max-width: 768px) {
    .scw-info-grid {
        grid-template-columns: 1fr;
    }
}
/* ===== INFO LAYOUT ===== */

.scw-info-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.scw-info-main {
    flex: 2;
}

.scw-info-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.scw-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.scw-form-grid .scw-full {
    grid-column: 1 / -1;
}

.scw-activity-item {
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.scw-activity-item strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.scw-activity-item small {
    color: #6b7280;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 1024px) {
    .scw-info-layout {
        flex-direction: column;
    }

    .scw-info-sidebar {
        width: 100%;
    }

    .scw-form-grid {
        grid-template-columns: 1fr;
    }
}
.scw-activity-list li {
    margin-bottom: 14px;
    font-size: 13px;
}

.scw-activity-list span {
    float: right;
    color: #6b7280;
    font-size: 12px;
}

.scw-activity-preview {
    margin-top: 6px;
    font-size: 12px;
    color: #374151;
    line-height: 1.4;
}
/* ===== ACTIVIDAD SIDEBAR ===== */

.scw-activity-list li strong {
    display: inline-block;
    font-weight: 600;
    color: #111827;
    margin-left: 4px;
}

.scw-activity-list span {
    float: right;
    font-size: 12px;
    color: #6b7280;
}

.scw-activity-preview {
    margin-top: 6px;
    font-size: 12px;
    color: #374151;
    line-height: 1.4;
}
/* ===== INFO GRID ===== */

.scw-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.scw-info-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}

.scw-info-card h3 {
    margin-top: 0;
    margin-bottom: 18px;
}

/* ===== FORMULARIO INFO ===== */

.scw-info-card label {
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.scw-info-card input,
.scw-info-card textarea,
.scw-info-card select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    font-size: 14px;
    transition: 0.2s ease;
}

.scw-info-card input:focus,
.scw-info-card textarea:focus,
.scw-info-card select:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
}
/* ===== PRIORIDAD BADGES ===== */

.scw-priority-select {
    font-weight: 600;
}

.scw-priority-alta {
    background: #fee2e2;
    color: #b91c1c;
}

.scw-priority-media {
    background: #fef3c7;
    color: #92400e;
}

.scw-priority-baja {
    background: #e0f2fe;
    color: #075985;
}
/* ===== ACTIVIDAD SIDEBAR PRO ===== */

.scw-activity-card h4 {
    margin-bottom: 16px;
}

.scw-activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.scw-activity-list li {
    margin-bottom: 16px;
}

.scw-activity-label {
    font-weight: 600;
    font-size: 13px;
    color: #111827;
    display: block;
}

.scw-activity-date {
    font-size: 12px;
    color: #6b7280;
    display: block;
    margin-top: 2px;
}

.scw-activity-preview {
    font-size: 12px;
    color: #374151;
    margin-top: 6px;
    line-height: 1.4;
}
/* ===== INFO GRID MEJORADO ===== */

.scw-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

/* ===== CARD ===== */

.scw-info-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}

/* ===== FORM LAYOUT ===== */

.scw-info-card form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}

/* Hacer que textarea ocupe 2 columnas */
.scw-info-card textarea {
    grid-column: span 2;
}

/* Labels más compactos */
.scw-info-card label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
    color: #374151;
}

/* Inputs más compactos */
.scw-info-card input,
.scw-info-card select,
.scw-info-card textarea {
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    transition: 0.2s ease;
}

.scw-info-card input:focus,
.scw-info-card select:focus,
.scw-info-card textarea:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
}

/* Botón */
.scw-info-card button {
    grid-column: span 2;
    margin-top: 10px;
}
/* ===================================================== */
/* FIX GLOBAL BOX MODEL */
/* ===================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

/* ===================================================== */
/* FORM INFO - FIX DEFINITIVO */
/* ===================================================== */

.scw-info-card form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
}

/* Agrupar cada campo correctamente */
.scw-info-card form label {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.scw-info-card form input,
.scw-info-card form select,
.scw-info-card form textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
}

/* Textareas ocupan 2 columnas */
.scw-info-card form textarea {
    grid-column: span 2;
    min-height: 90px;
}

/* Botón ocupa 2 columnas */
.scw-info-card form button {
    grid-column: span 2;
    margin-top: 6px;
}

/* ===================================================== */
/* SIDEBAR ACTIVIDAD - MEJOR ESPACIADO */
/* ===================================================== */

.scw-activity-card h4 {
    margin-bottom: 18px;
}

.scw-activity-list li {
    margin-bottom: 18px;
}

.scw-activity-label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.scw-activity-date {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: #6b7280;
}

.scw-activity-preview {
    font-size: 12px;
    color: #374151;
    line-height: 1.4;
}

/* ===================================================== */
/* PRIORIDAD MÁS VISUAL */
/* ===================================================== */

.scw-info-card select[name="priority"] {
    font-weight: 600;
}
/* ===============================
   LEAD HEADER PREMIUM
================================ */

.scw-lead-sidebar h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.scw-lead-sidebar p {
    font-size: 13px;
    color: #6b7280;
}

.scw-status {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
}
.scw-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 22px 26px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.scw-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}
/* ===============================
   FORM PREMIUM LOOK
================================ */

.scw-info-card form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 28px;
}

.scw-info-card label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #374151;
}

.scw-info-card input,
.scw-info-card select,
.scw-info-card textarea {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.scw-info-card input:focus,
.scw-info-card select:focus,
.scw-info-card textarea:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
select[name="priority"] {
    font-weight: 600;
}

select[name="priority"] option[value="alta"] {
    color: #b91c1c;
}

select[name="priority"] option[value="media"] {
    color: #92400e;
}

select[name="priority"] option[value="baja"] {
    color: #075985;
}
.scw-activity-card {
    border-left: 4px solid #2563eb;
}

.scw-activity-label {
    font-weight: 600;
    font-size: 13px;
}

.scw-activity-date {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.scw-activity-preview {
    font-size: 12px;
    margin-top: 6px;
    color: #374151;
}
.scw-email-item,
.scw-note-item {
    border-radius: 12px;
    transition: all 0.2s ease;
}

.scw-email-item:hover,
.scw-note-item:hover {
    transform: translateX(3px);
}

.scw-email-item.active,
.scw-note-item.active {
    background: #eef4ff;
    border-color: #2563eb;
}
button {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    font-weight: 600;
    border-radius: 10px;
    transition: 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(37,99,235,0.25);
}
/* ===================================
   STICKY TOPBAR
=================================== */

.scw-lead-topbar {
    position: relative;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    padding: 14px 28px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.05);
}

.scw-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 16px;
}

.scw-topbar-left strong {
    font-size: 17px;
}

.scw-topbar-status {
    font-size: 12px;
}

/* ===================================
   ACTION BUTTONS
=================================== */

.scw-topbar-actions {
    display: flex;
    gap: 10px;
}

.scw-action-btn {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
    background: #f3f4f6;
    color: #374151;
    transition: 0.2s ease;
}

.scw-action-btn:hover {
    background: #e5e7eb;
}

.scw-action-btn.primary {
    background: #2563eb;
    color: #fff;
}

.scw-action-btn.primary:hover {
    background: #1d4ed8;
}

.scw-action-btn.ghost {
    background: transparent;
    color: #6b7280;
}
/* ===================================
   TOPBAR STATUS INLINE
=================================== */

.scw-topbar-status-form {
    margin: 0;
}
.scw-topbar-status-select {
    appearance: none;
    border: none;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}


/* Quitar borde azul */
.scw-topbar-status-select:focus {
    outline: none;
}

/* Hover suave */
.scw-topbar-status-select:hover {
    opacity: 0.85;
}
/* ======================================
   TOPBAR FULL WIDTH
====================================== */

.scw-lead-topbar {
    width: 100%;
    max-width: 100%;
    margin: 0 0 24px 0;
    padding: 20px 28px;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

/* Asegurar que el contenedor no limite ancho */
.scw-lead-content {
    width: 100%;
}



.scw-lead-topbar h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.scw-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}
.scw-lead-topbar h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.scw-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* ==========================================
   TOPBAR ALINEADO AL CONTENIDO
========================================== */

.scw-lead-topbar {

    max-width: 1200px;      /* mismo ancho que .scw-lead-layout */
    margin: 30px auto 20px; /* centrado igual que layout */
    padding: 18px 24px;

    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}


.scw-lead-topbar {
    padding-left: 20px;
    padding-right: 20px;
}

/* ===== HEADER AGENTE SELECT ===== */

.scw-topbar-status-select {
    border: none;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
}
/* ===== TOPBAR AGENTE ===== */

.scw-topbar-agent-select {
    border: none;
    background: #e0f2fe;
    color: #075985;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
}


.scw-topbar-agent-form {
    margin-left: 12px;
}
/* ===== TOPBAR AGENTE BADGE STYLE ===== */

.scw-topbar-agent-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background: #eef2ff;
    color: #1a56db;

    border: none;
    padding: 6px 12px;
    border-radius: 999px;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

.scw-topbar-agent-select:focus {
    outline: none;
}
.scw-activity-fullwidth {
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 20px;
}

.scw-activity-fullwidth .scw-card {
    width: 100%;
}
/* =========================
   ACTIVIDAD 3 COLUMNAS PRO
========================= */

.scw-activity-card {
    padding: 18px 22px;
}

.scw-activity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.scw-activity-col {
    font-size: 13px;
}

.scw-activity-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scw-activity-title span {
    font-size: 13px;
}

.scw-activity-date {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 6px;
}

.scw-activity-preview {
    font-size: 12px;
    color: #374151;
    line-height: 1.3;
}

.scw-activity-empty {
    font-size: 12px;
    color: #9ca3af;
}

/* Responsive */
@media (max-width: 900px) {
    .scw-activity-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}
/* =========================================
   ACTIVIDAD 3 COLUMNAS FIJAS
========================================= */

.scw-activity-bar {
    width: 100%;
    display: flex;
    gap: 24px;
    margin: 28px 0;
}

.scw-activity-box {
    flex: 1;
    min-width: 0;
}
/* =========================================
   ACTIVIDAD PREMIUM FULL WIDTH
========================================= */

.scw-activity-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 28px;
}

/* Caja principal */
.scw-activity-box {
    position: relative;
    background: #f9fafb;
    border-radius: 16px;
    padding: 26px 22px 20px 22px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.05);
    transition: all 0.25s ease;
    overflow: visible;
}

/* Hover */
.scw-activity-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.08);
}

/* Icono flotante */
.scw-activity-icon {
    position: absolute;
    top: -14px;
    left: -14px;
    width: 44px;
    height: 44px;
    background: #2563eb;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Contador flotante */
.scw-activity-count {
    position: absolute;
    top: -12px;
    right: -12px;
    background: #111827;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.scw-activity-count.neutral {
    background: #9ca3af;
}

/* Contenido */
.scw-activity-content {
    margin-top: 6px;
}

.scw-activity-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #111827;
}

.scw-activity-date {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 6px;
}

.scw-activity-preview {
    font-size: 12px;
    color: #374151;
    line-height: 1.4;
}

.scw-activity-preview strong {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.scw-activity-empty {
    font-size: 12px;
    color: #9ca3af;
}

/* Responsive */
@media (max-width: 900px) {
    .scw-activity-bar {
        grid-template-columns: 1fr;
    }
}
/* =========================================
   ACTIVIDAD – VERSIÓN MEJORADA
========================================= */

.scw-activity-bar {
    display: flex;
    gap: 40px;              /* MÁS separación */
    margin: 40px 0;
}

.scw-activity-box {
    flex: 1;
    position: relative;
    background: #f8fafc;
    border-radius: 14px;
    padding: 28px 28px 24px 28px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    transition: 0.25s ease;
}

.scw-activity-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

/* ICONO */
.scw-activity-icon {
    position: absolute;
    top: -18px;
    left: 24px;             /* más a la derecha */
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 6px 14px rgba(37,99,235,0.4);
}

/* CONTADOR CENTRADO */
.scw-activity-count {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: white;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 14px;
    font-weight: 600;
}

/* TÍTULO */
.scw-activity-title {
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 8px;
    font-size: 15px;
}

/* TEXTO */
.scw-activity-box small {
    font-size: 12px;
    color: #6b7280;
}

.scw-activity-box p {
    font-size: 13px;
    margin-top: 6px;
}

.scw-chat-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
    border-radius: 10px;
}

.scw-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.scw-message.inbound {
    align-items: flex-start;
}

.scw-message.outbound {
    align-items: flex-end;
}

.bubble {
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 70%;
    font-size: 14px;
}

.scw-message.inbound .bubble {
    background: #e5e7eb;
}

.scw-message.outbound .bubble {
    background: #2563eb;
    color: white;
}

.time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}
.scw-chat-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.scw-chat-form textarea {
    flex: 1;
    resize: none;
    border-radius: 20px;
    padding: 10px 15px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
}

.scw-chat-form button {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 20px;
    cursor: pointer;
}
.scw-wa-badge {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    margin-left: 6px;
}
.scw-unread-card {
    background: #ecfdf5;
    border: 1px solid #10b981;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 600;
}

.scw-unread-card a {
    text-decoration: none;
    color: #065f46;
    display: block;
}
.scw-unread-card {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
}
.scw-card-wa {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
}

.scw-card-email {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
}
.scw-row-wa {
    background-color: #f0fdf4;
}

.scw-row-email {
    background-color: #eff6ff;
}
.scw-card-wa {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 10px;
}

.scw-card-email {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 10px;
}

.scw-row-wa {
    background-color: #f0fdf4;
}

.scw-row-email {
    background-color: #eff6ff;
}

.scw-wa-badge {
    margin-left: 6px;
}

.scw-email-badge {
    margin-left: 6px;
}
.scw-header-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.scw-card-wa-inline,
.scw-card-email-inline {
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.scw-card-wa-inline {
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
}

.scw-card-email-inline {
    background: #eff6ff;
    border: 1px solid #2563eb;
    color: #1e40af;
}
.scw-row-wa {
    background-color: #f0fdf4; /* verde claro */
}

.scw-row-email {
    background-color: #eff6ff; /* azul claro */
}

.scw-row-both {
    background-color: #f5f3ff; /* violeta suave */
}
/* ================= EMAIL HISTORIAL MEJORADO ================= */

.scw-email-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.scw-email-item {
    padding: 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s ease;
    max-width: 85%;
}

.scw-email-item.incoming {
    background: #f3f4f6;
    align-self: flex-start;
}

.scw-email-item.outgoing {
    background: #e0ecff;
    align-self: flex-end;
}

.scw-email-item:hover {
    transform: translateY(-2px);
}

.scw-email-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
}

.scw-email-subject {
    font-weight: 600;
    margin-bottom: 6px;
}

.scw-email-preview {
    font-size: 13px;
    color: #6b7280;
}

.scw-email-date {
    font-size: 12px;
    color: #9ca3af;
}

.scw-email-attachments {
    margin-top: 6px;
    font-size: 12px;
    color: #374151;
}
.scw-column-title {
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.scw-email-item.unread {
    border-left: 4px solid #22c55e;
    background: #f0fdf4;
}
.scw-email-section-title {
    list-style: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #6b7280;
    margin: 18px 0 8px 0;
    text-transform: uppercase;
}

.scw-email-item.incoming.unread {
    border-left: 4px solid #22c55e;
    background: #f0fdf4;
}
.scw-email-section-title {
    list-style: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #6b7280;
    margin: 18px 0 8px 0;
    text-transform: uppercase;
    text-align: center;        /* 👈 centra el texto */
    padding: 6px 0;
    background: #f3f4f6;
    border-radius: 6px;
}

