/* ================= 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;
}



.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;
}

/* 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;
}
.scw-email-columns{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
    margin-bottom:15px;
}

.scw-email-col-title{
    background:#f3f4f6;
    text-align:center;
    padding:8px;
    font-size:12px;
    font-weight:700;
    letter-spacing:1px;
    border-radius:6px;
    color:#6b7280;
}
.scw-email-section-title{
    text-align:center;
    font-weight:700;
    font-size:13px;
    letter-spacing:2px;
    background:#f3f4f6;
    padding:8px;
    border-radius:6px;
    margin:10px 0;
}
.vf-login-wrapper {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0b3c6f, #1a5fb4, #1ebe5d);
    font-family: 'Segoe UI', sans-serif;
}

.vf-login-box {
    background: #ffffff;
    padding: 45px;
    width: 380px;
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
    text-align: center;
    animation: fadeIn 0.6s ease;
}

.vf-logo {
    width: 180px;
    margin-bottom: 20px;
}

.vf-login-box h2 {
    margin-bottom: 25px;
    color: #0b3c6f;
}

.vf-login-box input {
    width: 100%;
    padding: 14px;
    margin-bottom: 18px;
    border-radius: 10px;
    border: 1px solid #dcdcdc;
    transition: 0.3s;
    font-size: 14px;
}

.vf-login-box input:focus {
    border-color: #1a5fb4;
    box-shadow: 0 0 8px rgba(26,95,180,0.3);
    outline: none;
}

.vf-login-box button {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    background: #1ebe5d;
    color: #fff;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.vf-login-box button:hover {
    background: #16a34a;
    transform: translateY(-2px);
}

.vf-login-error {
    margin-top: 10px;
    color: red;
    font-size: 13px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
/* DASHBOARD BASE */
.scw-dashboard {
    background:#f4f6f9;
    padding:30px;
}

/* TOPBAR */
.scw-topbar {
    display:flex;
    gap:20px;
    margin-bottom:25px;
}

.scw-stat-card {
    flex:1;
    background:#ffffff;
    padding:25px;
    border-radius:16px;
    box-shadow:0 8px 25px rgba(0,0,0,0.06);
}

.scw-stat-title {
    font-size:14px;
    color:#6b7280;
    margin-bottom:8px;
}

.scw-stat-number {
    font-size:30px;
    font-weight:600;
    color:#0b3c6f;
}

/* MAIN LAYOUT */
.scw-main-layout {
    display:flex;
    gap:25px;
}

.scw-leads-wrapper {
    flex:3;
}



/* CARD */
.scw-card {
    background:#ffffff;
    border-radius:18px;
    box-shadow:0 12px 40px rgba(0,0,0,0.08);
    padding:25px;
}

/* SCROLL */
.scw-table-scroll {
    max-height:520px;
    overflow-y:auto;
}

/* TABLE */
.scw-leads-card table {
    width:100%;
    border-collapse:collapse;
}

.scw-leads-card th {
    font-size:13px;
    color:#6b7280;
    padding:12px;
    border-bottom:1px solid #eee;
    text-align:left;
}

.scw-leads-card td {
    padding:14px 12px;
    border-bottom:1px solid #f1f1f1;
}

.scw-leads-card tr:hover {
    background:#f9fafb;
}

/* SIDEBAR */
.scw-admin-card {
    text-align:center;
}

.scw-admin-avatar {
    font-size:40px;
    margin-bottom:15px;
}

.scw-admin-name {
    font-weight:600;
    margin-bottom:5px;
}

.scw-admin-role {
    font-size:13px;
    color:#6b7280;
    margin-bottom:20px;
}

.scw-admin-stats strong {
    font-size:26px;
}
/* LISTA EN CARDS */

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

.scw-lead-card {
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:18px 22px;
    border-radius:14px;
    background:#ffffff;
    transition:0.2s ease;
    border:1px solid #f0f0f0;
}

.scw-lead-card:hover {
    transform:translateY(-2px);
    box-shadow:0 8px 20px rgba(0,0,0,0.06);
}

.scw-lead-left {
    display:flex;
    flex-direction:column;
    gap:6px;
}

.scw-lead-name {
    font-weight:600;
    font-size:15px;
}

.scw-lead-name a {
    text-decoration:none;
    color:#0b3c6f;
}

.scw-lead-meta {
    font-size:13px;
    color:#6b7280;
    display:flex;
    gap:15px;
}

.scw-lead-right {
    display:flex;
    align-items:center;
    gap:18px;
}

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

.scw-lead-view {
    text-decoration:none;
    font-weight:500;
    color:#1a5fb4;
}

/* Scroll interno sigue igual */
.scw-table-scroll {
    max-height:520px;
    overflow-y:auto;
}
/* LISTA MODERNA */

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

.scw-lead-card {
    display:flex;
    align-items:center;
    text-decoration:none;
    background:#ffffff;
    border-radius:14px;
    overflow:hidden;
    border:1px solid #f1f5f9;
    transition:0.2s ease;
}

.scw-lead-card:hover {
    transform:translateY(-2px);
    box-shadow:0 10px 25px rgba(0,0,0,0.06);
}

.scw-agent-strip {
    width:60px;
    min-height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    color:white;
    font-weight:600;
    font-size:18px;
}

.scw-lead-content {
    flex:1;
    padding:16px 20px;
    display:flex;
    flex-direction:column;
    gap:6px;
}

.scw-lead-top {
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.scw-lead-name {
    font-weight:600;
    font-size:15px;
    color:#0b3c6f;
}

.scw-lead-meta {
    font-size:13px;
    color:#6b7280;
    display:flex;
    gap:20px;
}

/* Scroll interno */
.scw-table-scroll {
    max-height:520px;
    overflow-y:auto;
}
/* NUEVO LAYOUT */

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

.scw-leads-area {
    flex:1;
}

.scw-right-panel {
    width:260px;
}

.scw-status-panel {
    padding:20px;
}

.scw-status-row {
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:10px 0;
    border-bottom:1px solid #f1f5f9;
}

.scw-status-row:last-child {
    border-bottom:none;
}

.scw-status-count {
    font-weight:600;
    font-size:14px;
}

/* AGENTE NOMBRE */

.scw-lead-name-block {
    display:flex;
    flex-direction:column;
}

.scw-lead-agent-name {
    font-size:12px;
    color:#6b7280;
}

/* Ajuste card lead */

.scw-lead-card {
    padding:18px 22px;
}
/* NUEVO LAYOUT */

.scw-main-layout {
    display:flex;
    gap:24px;
}

.scw-leads-wrapper {
    flex:1;
}


.scw-status-panel {
    padding:20px;
}

.scw-status-row {
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:10px 0;
    border-bottom:1px solid #f1f5f9;
}

.scw-status-row:last-child {
    border-bottom:none;
}

.scw-total-row {
    display:flex;
    justify-content:space-between;
    margin-top:15px;
    padding-top:10px;
    border-top:1px solid #e5e7eb;
}

.scw-lead-name-block {
    display:flex;
    flex-direction:column;
}

.scw-lead-agent-name {
    font-size:12px;
    color:#6b7280;
}
.scw-main-layout {
    display:flex;
    gap:24px;
    align-items:flex-start;
}

.scw-leads-wrapper {
    flex:1;
}

.scw-right-panel {
    width:280px;
    display:flex;
    flex-direction:column;
    gap:20px;
}

.scw-agent-badge {
    display:inline-block;
    margin-top:6px;
    padding:4px 8px;
    font-size:12px;
    border-radius:6px;
    color:#fff;
    font-weight:500;
}

.scw-agent-unassigned {
    background:#9ca3af;
}
/* 🔥 ELIMINAR SIDEBAR IZQUIERDO DEFINITIVAMENTE */

.scw-dashboard {
    display:block !important;
}


/* Nuevo layout limpio */
.scw-main-layout {
    display:flex !important;
    gap:24px;
    width:100%;
}

.scw-leads-wrapper {
    flex:1 1 auto;
    width:100%;
}

.scw-right-panel {
    width:280px;
    flex-shrink:0;
}

/* =======================================
   NUEVO DASHBOARD SIN SIDEBAR IZQUIERDO
======================================= */

.scw-dashboard {
    background:#f4f6f9;
    padding:30px;
}

/* Solo 2 columnas reales */
.scw-main-layout {
    display:flex;
    gap:30px;
    align-items:flex-start;
}

/* Mis Leads ocupa todo el espacio disponible */
.scw-leads-wrapper {
    flex:1;
    min-width:0;
}

/* Panel derecho fijo */
.scw-right-panel {
    width:300px;
    flex-shrink:0;
    display:flex;
    flex-direction:column;
    gap:20px;
}
/* ===============================
   LEAD CARD 3 BLOQUES PREMIUM
================================ */

.scw-lead-card {
    display: grid;
    grid-template-columns: 180px 1fr 140px;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    transition: 0.25s ease;
    text-decoration: none;
}

.scw-lead-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}

/* ===== AGENTE ===== */

.scw-lead-agent-box {
    display: flex;
    align-items: center;
}

.scw-agent-badge {
    background: linear-gradient(135deg,#7c3aed,#6d28d9);
    color: white;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.scw-agent-unassigned {
    background: #9ca3af;
}

/* ===== INFO CENTRAL ===== */

.scw-lead-info-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scw-lead-name {
    font-size: 16px;
    font-weight: 600;
    color: #0b3c6f;
}

.scw-lead-meta {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    gap: 18px;
}

/* ===== ESTADO ===== */

.scw-lead-status-box {
    display: flex;
    justify-content: flex-end;
}
.scw-privacy-check {
    margin-top: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #6b7280;
}

.scw-privacy-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.scw-privacy-check input {
    width: auto;
    margin: 0;
}

.scw-privacy-check a {
    color: #2563eb;
    font-weight: 500;
}

.scw-privacy-check a:hover {
    text-decoration: underline;
}
/* 🔥 Arreglo definitivo checkbox privacidad */
.scw-privacy-check {
    margin-top: 15px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #6b7280;
}

.scw-privacy-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
}

.scw-privacy-check input[type="checkbox"] {
    width: 16px !important;
    height: 16px;
    flex-shrink: 0;
    margin: 0;
}

.scw-privacy-check a {
    color: #2563eb;
    font-weight: 500;
    text-decoration: none;
}

.scw-privacy-check a:hover {
    text-decoration: underline;
}


/* CARD MÁS COMPACTA */
.scw-form-card {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #f0fdf4; /* gris suave elegante */
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

/* Título */
.scw-form-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

/* Labels */
.scw-form-card label {
    font-size: 12px;
    margin-bottom: 3px;
    color: #475569;
}

/* Inputs ultra compactos */
.scw-form-card input[type="text"],
.scw-form-card input[type="email"],
.scw-form-card input[type="number"],
.scw-form-card input[type="file"],
.scw-form-card textarea,
.scw-form-card select {
    padding: 7px 10px;
    margin-bottom: 8px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #dbe3ec;
    background: #ffffff;
}

/* Focus más fino */
.scw-form-card input:focus,
.scw-form-card textarea:focus,
.scw-form-card select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    outline: none;
}

/* Textarea más baja */
.scw-form-card textarea {
    min-height: 80px;
}

/* Botón compacto */
.scw-form-card button,
.scw-form-card input[type="submit"] {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 8px;
}

/* ===== RESTAURAR BOTONES ORIGINALES ===== */

.scw-form-card button,
.scw-form-card input[type="submit"] {

    background: #2f5bd3; /* tu azul original */
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(47, 91, 211, 0.25);
    transition: all 0.2s ease;
}

.scw-form-card button:hover,
.scw-form-card input[type="submit"]:hover {
    background: #2447a8;
    box-shadow: 0 6px 16px rgba(47, 91, 211, 0.35);
    transform: translateY(-1px);
}


/* ===== QUITAR SUBRAYADO EN LEADS ===== */

.scw-lead-card,
.scw-lead-card a {
    text-decoration: none !important;
}

.scw-lead-card:hover {
    text-decoration: none !important;
}

/* ===== RESALTADO POR MENSAJES NO LEÍDOS ===== */

/* Solo Email (celeste suave) */
.scw-lead-card.scw-row-email {
    background: #e0f2fe;
    border-left: 4px solid #0284c7;
}

/* Solo WhatsApp (verde suave) */
.scw-lead-card.scw-row-wa {
    background: #dcfce7;
    border-left: 4px solid #16a34a;
}

/* Ambos (lila suave) */
.scw-lead-card.scw-row-both {
    background: #ede9fe;
    border-left: 4px solid #7c3aed;
}
/* Selector inline dentro de lead card */
.scw-inline-agent-form {
    margin: 0;
}

.scw-inline-agent-select {
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    padding: 6px 10px;
    font-size: 12px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scw-inline-agent-select:focus {
    border-color: #2563eb;
    outline: none;
}
/* ===== SELECT CON ESTILO BADGE ===== */

.scw-inline-agent-select {
    border: none;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Flecha custom más discreta */
.scw-inline-agent-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.08);
}

/* Cuando está sin asignar */
.scw-inline-agent-select option[value=""] {
    color: #64748b;
}
/* Card clickeable */
.scw-lead-card {
    cursor: pointer;
}

.scw-lead-card:hover .scw-lead-name {
    color: #2563eb;
}


/* BOTON */
.scw-metrics-btn {
    margin-top: 20px;
    width: 100%;
    padding: 14px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.3);
}

.scw-metrics-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.4);
}

.scw-metrics-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

/* OVERLAY */
#scw-metrics-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 9998;
}

/* PANEL */
#scw-metrics-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 75vw;          /* 👈 3/4 de pantalla */
    max-width: 1200px;    /* 👈 no se hace gigante en pantallas grandes */
    height: 100vh;
    background: #ffffff;
    box-shadow: -20px 0 60px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.35s ease;
    display: flex;
    flex-direction: column;
    z-index: 9999;
}

#scw-metrics-panel.active {
    transform: translateX(0);
}
#scw-metrics-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998;
}

#scw-metrics-overlay.active {
    opacity: 1;
    visibility: visible;
}
@media (max-width: 1024px) {
    #scw-metrics-panel {
        width: 100vw;
    }
}

/* HEADER */
.scw-metrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
}

#scw-close-metrics {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#scw-close-metrics .dashicons {
    font-size: 18px;
    color: #374151;
}

#scw-close-metrics:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
}

/* CONTENT */
.scw-metrics-content {
    padding: 20px;
    overflow-y: auto;
}

/* KPI GRID */
.scw-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.scw-kpi-box {
    background: #f9fafb;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

.scw-kpi-box span {
    display: block;
    font-size: 13px;
    color: #6b7280;
}

.scw-kpi-box strong {
    font-size: 20px;
    display: block;
    margin-top: 6px;
}
/* Layout principal sin scroll */
.scw-metrics-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: calc(100vh - 80px); /* header offset */
    overflow: hidden;
}

/* Grid 2x2 */
.scw-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    flex: 1;
}

/* Card individual */
.scw-chart-card {
    background: #f9fafb;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Título */
.scw-chart-card {
    height: 260px; /* 👈 clave para no scrollear */
}

.scw-chart-card canvas {
    width: 100% !important;
    height: 100% !important;
}
.scw-chart-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:10px;
}

#scw-month-range{
    padding:4px 8px;
    border-radius:8px;
    border:1px solid #ddd;
    font-size:12px;
}
.scw-left-modal {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    transition: 0.3s ease;
    z-index: 9999;
}

.scw-left-modal.active {
    left: 0;
}

.scw-left-modal-content {
    width: 950px;
    height: 100%;
    background: #fff;
    box-shadow: 5px 0 25px rgba(0,0,0,0.1);
    overflow: hidden;
}

.scw-left-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.scw-left-modal-body {
    height: calc(100% - 70px);
    overflow: hidden;
}
#scw-social-panel {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 1100px;
    height: 100%;
    background: #fff;
    z-index: 9999;
    transition: left 0.3s ease;
    overflow-y: auto;
}

#scw-social-panel.active {
    left: 0;
}

#scw-social-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

#scw-social-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* CONTENEDOR */
.scw-admin-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

/* BOTONES MÁS PEQUEÑOS */
.scw-small-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 14px;
}
/* Botón cerrar modal estilo premium */
.scw-close-btn {
    background: #f3f4f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.scw-close-btn:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
}
.scw-right-panel {
    display: flex;
    flex-direction: column;
}

.scw-admin-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px; /* antes 18px */
}
.scw-status-panel {
    margin-bottom: 12px;
}

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

/* ===============================
   LAYOUT BASE
=============================== */

.scw-main-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.scw-leads-wrapper {
    flex: 2;
    min-width: 0;
}

.scw-right-panel {
    flex: 1;
    min-width: 260px;
}

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

@media (max-width: 992px) {

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

    .scw-right-panel {
        width: 100%;
        min-width: 100%;
    }

    .scw-leads-wrapper {
        width: 100%;
    }

}

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

@media (max-width: 768px) {

    .scw-topbar {
        flex-direction: column;
        gap: 12px;
    }

    .scw-stat-card {
        width: 100%;
    }

    .scw-lead-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .scw-lead-status-box {
        align-self: flex-start;
    }

}

/* Permitir que el contenido flex no se corte */
.scw-lead-card {
    display: flex;
    gap: 12px;
    min-width: 0;
}

/* Muy importante */
.scw-lead-info-box {
    flex: 1;
    min-width: 0;
}

/* Permitir que el texto haga wrap */
.scw-lead-name,
.scw-lead-meta span {
    word-break: break-word;
    overflow-wrap: anywhere;
}
@media (max-width: 768px) {

    .scw-lead-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .scw-lead-agent-box {
        width: 100%;
    }

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

}
/* ===============================
   LEAD VIEW
=============================== */

@media (max-width: 768px) {

    .scw-lead-topbar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .scw-topbar-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .scw-action-btn {
        flex: 1;
        text-align: center;
    }

}

@media (max-width: 768px) {

    .scw-activity-bar {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .scw-activity-box {
        width: 100%;
    }

}

@media (max-width: 992px) {

    .scw-email-layout {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .scw-email-layout .scw-card {
        width: 100%;
    }

}

.scw-tabs {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.scw-tabs::-webkit-scrollbar {
    display: none;
}

.scw-lead-layout,
.scw-lead-content,
.scw-card {
    min-width: 0;
}

@media (max-width: 768px) {
    .scw-action-btn.ghost {
        order: -1;
        width: 100%;
    }
}

/* =====================================
   NOTAS RESPONSIVE IGUAL QUE EMAIL
===================================== */

@media (max-width: 992px) {

    #tab-notes .scw-email-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px;
    }

    #tab-notes .scw-email-layout > .scw-card {
        width: 100% !important;
    }

}

/* =====================================
   REDES SOCIALES
===================================== */

@media (max-width: 768px) {

    .scw-thread-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .scw-avatar-wrapper {
        margin-right: 0;
        margin-bottom: 8px;
    }

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

    .scw-thread-username {
        display: block;
        font-size: 14px;
        margin-bottom: 2px;
        word-break: break-word;
    }

    .scw-thread-platform {
        font-size: 12px;
    }

    .scw-unread {
        display: inline-block;
        margin-left: 6px;
    }

}

@media (max-width: 768px) {

    .scw-chat-input {
        flex-wrap: wrap;
        gap: 8px;
    }

    #scw-message-input {
        flex: 1 1 auto;
        min-width: 0;
    }

    #scw-send-btn {
        flex: 0 0 auto;
    }

    #scw-test-incoming {
        flex: 1 1 100%;
        width: 100%;
        margin-left: 0;
    }

}

@media (max-width: 768px) {
    #scw-test-incoming {
        font-size: 13px;
        padding: 10px;
        opacity: 0.8;
    }
}



@media (display-mode: standalone) {

    header,
    .site-header,
    .main-navigation,
    footer {
        display: none !important;
    }

    body {
        margin: 0;
    }

}

/* =========================
   LEAD VIEW MOBILE FIX
========================= */

@media (max-width: 768px) {

    .scw-lead-container,
    .scw-lead-wrapper,
    .scw-lead-content {
        flex-direction: column !important;
    }

    .scw-lead-info {
        width: 100% !important;
        max-width: 100% !important;
    }

    .scw-lead-info-card,
    .scw-card {
        width: 100% !important;
        margin: 0 0 20px 0 !important;
    }

}
@media (max-width: 768px) {

    .scw-card {
        padding: 20px !important;
        border-radius: 14px;
    }

}

.scw-message .bubble img,
.scw-message .bubble video {
    max-width: 100%;
    border-radius: 10px;
}

/* AUDIO separado */
.scw-message .bubble audio {
    width: 220px;       /* tamaño fijo realista */
    max-width: 220px;   /* 🔥 evita que se estire */
    display: block;
}
.scw-input-wrapper {
    display:flex;
    align-items:center;
    gap:10px;
    background:#f0f2f5;
    padding:10px;
    border-radius:20px;
}

.scw-input-wrapper textarea {
    flex:1;
    border:none;
    background:transparent;
    resize:none;
    outline:none;
    font-size:14px;
    max-height:120px;
}

.scw-attach-btn,
.scw-send-btn {
    border:none;
    background:#25D366;
    color:#fff;
    width:36px;
    height:36px;
    border-radius:50%;
    cursor:pointer;
}

.scw-attach-btn {
    background:#ddd;
    color:#444;
}

.scw-preview-img {
    max-width:200px;
    border-radius:12px;
    margin-top:10px;
}

.scw-doc-preview {
    margin-top:10px;
    background:#fff;
    padding:8px 12px;
    border-radius:10px;
}
.scw-voice-preview {
    display:flex;
    align-items:center;
    gap:10px;
    margin-top:10px;
}

.scw-voice-preview button {
    border:none;
    background:#ff3b30;
    color:#fff;
    width:32px;
    height:32px;
    border-radius:50%;
    cursor:pointer;
}
/* ===== CONTENEDOR INPUT ===== */

.scw-input-wrapper {
    display:flex;
    align-items:center;
    gap:10px;
    background:#ffffff;
    padding:8px 12px;
    border-radius:25px;
    box-shadow:0 2px 8px rgba(0,0,0,0.08);
}

/* ===== TEXTAREA ===== */

.scw-input-wrapper textarea {
    flex:1;
    border:none;
    background:transparent;
    resize:none;
    outline:none;
    font-size:14px;
    padding:6px 4px;
    max-height:120px;
}

/* ===== BOTONES BASE ===== */

.scw-input-wrapper button {
    border:none;
    background:transparent;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    width:36px;
    height:36px;
    border-radius:50%;
    transition:0.2s ease;
}

/* ===== BOTÓN ADJUNTAR ===== */

#scw-attach-btn {
    color:#54656f;
}

#scw-attach-btn:hover {
    background:#f0f2f5;
}

/* ===== BOTÓN MIC ===== */

#scw-record-btn {
    color:#54656f;
}

#scw-record-btn:hover {
    background:#f0f2f5;
}

/* ===== BOTÓN ENVIAR ===== */

.scw-send-btn {
    background:#25D366;
    color:#fff;
    box-shadow:0 3px 6px rgba(37,211,102,0.3);
}

.scw-send-btn:hover {
    transform:scale(1.05);
    box-shadow:0 4px 10px rgba(37,211,102,0.4);
}

/* ===== PREVIEW ===== */

#scw-preview-area {
    margin-top:8px;
}
/* ===== BURBUJAS MÁS NATURALES ===== */

.scw-message {
    display:flex;
    margin-bottom:12px;
}

.scw-message.outbound {
    justify-content:flex-end;
}

.scw-message.inbound {
    justify-content:flex-start;
}

.scw-message .bubble {
    display:inline-block;
    padding:10px 14px;
    border-radius:18px;
    max-width:65%;
    font-size:14px;
}

/* Verde real WhatsApp */
.scw-message.outbound .bubble {
    background:#d9fdd3;
}

/* Blanca */
.scw-message.inbound .bubble {
    background:#ffffff;
}
.scw-message .bubble audio {
    width:220px;
    display:block;
}
/* ===== BOTONES INPUT LIMPIOS ===== */

.scw-input-wrapper button {
    all: unset; /* limpia estilos anteriores */
    display:flex;
    align-items:center;
    justify-content:center;
    width:38px;
    height:38px;
    cursor:pointer;
    border-radius:50%;
    transition:0.2s ease;
}

/* Adjuntar */
#scw-attach-btn {
    font-size:18px;
    color:#54656f;
}

#scw-attach-btn:hover {
    background:#f0f2f5;
}

/* Micrófono */
#scw-record-btn {
    font-size:18px;
    color:#54656f;
}

#scw-record-btn:hover {
    background:#f0f2f5;
}

/* Enviar */
.scw-send-btn {
    background:#25D366;
    color:#fff;
    font-size:16px;
}

.scw-send-btn:hover {
    transform:scale(1.05);
}
.scw-message.outbound .bubble {
    background:#d9fdd3;
    color:#111; /* 🔥 texto oscuro */
}.scw-message.inbound .bubble {
    background:#ffffff;
    color:#111;
}
.scw-message .bubble {
    display:inline-flex;        /* 🔥 clave */
    flex-direction:column;
    padding:10px 14px;
    border-radius:18px;
    font-size:14px;
    max-width:fit-content;      /* 🔥 clave */
}
.scw-message.outbound {
    justify-content:flex-end;
}

.scw-message.inbound {
    justify-content:flex-start;
}
.scw-message .bubble audio {
    width:220px;
    display:block;
}
.scw-message .bubble {
    display: inline-flex;
    flex-direction: column;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    width: fit-content;
    max-width: 65%; /* para textos largos */
}
/* FIX DEFINITIVO BURBUJA AUDIO */

.scw-message {
    display: flex;
}

.scw-message.outbound {
    justify-content: flex-end;
}

.scw-message.inbound {
    justify-content: flex-start;
}

/* 🔥 CLAVE */
.scw-message .bubble {
    flex: 0 0 auto !important;   /* evita que crezca */
    width: auto !important;
    max-width: 65%;
    display: inline-block !important;
}
/* ===============================
   WHATSAPP BUBBLE FIX FINAL
=============================== */

/* Contenedor mensaje */
.scw-chat-container .scw-message {
    display: flex;
    width: 100%;
}

/* Alineación */
.scw-chat-container .scw-message.outbound {
    justify-content: flex-end;
}

.scw-chat-container .scw-message.inbound {
    justify-content: flex-start;
}

/* Burbuja */
.scw-chat-container .scw-message .bubble {
    display: inline-block !important;
    width: auto !important;
    max-width: 65%;
    flex: none !important;
    padding: 10px 14px;
    border-radius: 18px;
}

/* Audio tamaño fijo real */
.scw-chat-container .scw-message .bubble audio {
    width: 220px !important;
    max-width: 220px !important;
    display: block;
}
.scw-chat-container {
    overflow-y: auto;
    max-height: 500px; /* o el que tengas */
}

.scw-critical-panel {
    margin: 20px 0;
    padding: 20px;
    border-radius: 14px;
    background: #fff1f2;
    border: 1px solid #fecaca;
}

.scw-critical-panel h4 {
    margin-bottom: 15px;
    color: #b91c1c;
}

.scw-critical-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #fecaca;
}

.scw-critical-row:last-child {
    border-bottom: none;
}

.scw-critical-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
}
.scw-critical-panel {
    margin: 20px 0;
    padding: 18px;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.scw-critical-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #fca5a5;
}

.scw-critical-row:last-child {
    border-bottom: none;
}

.scw-critical-btn {
    background: #dc2626;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
}
.scw-critical-panel {
    margin: 20px auto;
    padding: 18px;
    border-radius: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    max-width: 1200px;
}

/* Contenido scrolleable */
#scw-critical-content {
    max-height: 150px; /* Altura equivalente a 2 filas */
    overflow-y: auto;
}
/* Scroll más fino */
#scw-critical-content::-webkit-scrollbar {
    width: 6px;
}

#scw-critical-content::-webkit-scrollbar-thumb {
    background: #fdba74;
    border-radius: 10px;
}
.scw-critical-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #fdba74;
}

.scw-critical-row:last-child {
    border-bottom: none;
}

.scw-critical-btn {
    background: #ea580c;
    color: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
}
.scw-critical-panel {
    margin: 20px auto;
    padding: 18px;
    border-radius: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    max-width: 1200px;
}

.scw-critical-header {
    margin-bottom: 10px;
}

#scw-critical-content {
    max-height: 150px;
    overflow-y: auto;
    padding-right: 6px;
}
.scw-critical-badge {
    position: absolute;
    top: 12px;
    right: 16px;
    background: #dc2626;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Asegurar que el card tenga posición relativa */
.scw-stat-card {
    position: relative;
}
.scw-critical-mini {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scw-mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

.scw-mini-label {
    color: #374151;
    font-weight: 500;
}

.scw-mini-box {
    min-width: 34px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
}

.scw-warning {
    background: #f97316; /* naranja */
}

.scw-expired {
    background: #dc2626; /* rojo */
}
.scw-critical-panel {
    margin-top: 20px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    animation: fadeIn 0.2s ease;
}


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

.scw-critical-list {
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scw-item {
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
}

.scw-item.critical {
    background: #fee2e2;
    border-left: 4px solid #dc2626;
}

.scw-item.warning {
    background: #fff7ed;
    border-left: 4px solid #f97316;
}
.scw-stat-card {
    position: relative;
}
/* UX HOVER CARDS DASHBOARD */

.scw-stat-card {
    position: relative;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

.scw-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 18px rgba(0,0,0,0.08);
}

.scw-stat-card:active {
    transform: scale(.98);
}

.scw-badge {
    position: absolute;
    top: 12px;
    right: 15px;
    background: #dc2626;
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: 600;
}
.scw-refresh-btn {
    margin-left: auto;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.scw-refresh-btn:hover {
    background: #f3f4f6;
}
.spin {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
/* ===============================
   LEAD LIST COMPACT
=============================== */

.scw-lead-card{
    display:block;
    padding:10px 14px;
    margin-bottom:10px;
    border-radius:10px;
    background:#fff;
    cursor:pointer;
    transition:all .15s ease;
}

.scw-lead-card:hover{
    background:#f8fafc;
}

.scw-lead-row{
    display:flex;
    align-items:center;
    gap:12px;
}

/* avatar cliente */

.scw-lead-avatar{
    width:34px;
    height:34px;
    border-radius:50%;
    overflow:hidden;
    flex-shrink:0;
}

.scw-lead-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
}

/* nombre */

.scw-lead-name{
    flex:2;
    font-weight:600;
    font-size:14px;
}

/* estado */

.scw-lead-status{
    flex:1;
    text-align:center;
}

/* agente */

.scw-lead-agent{
    flex:1;
    text-align:right;
    font-size:13px;
    color:#555;
}

/* avatar agente */

.scw-agent-avatar{
    width:26px;
    height:26px;
    border-radius:50%;
    overflow:hidden;
    flex-shrink:0;
}

.scw-agent-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
}
.scw-status-row{
display:flex;
align-items:center;
justify-content:space-between;
padding:10px 0;
border-bottom:1px solid #f1f5f9;
}
.scw-status{
display:inline-flex;
align-items:center;
padding:4px 10px;
border-radius:20px;
font-size:12px;
font-weight:500;
}
.scw-status-count{
font-weight:600;
color:#111827;
}
.scw-avatar-initials{
border-radius:50%;
background:#2563eb;
color:#fff;
display:flex;
align-items:center;
justify-content:center;
font-weight:600;
font-size:13px;
letter-spacing:0.5px;
flex-shrink:0;
}
.scw-lead-avatar,
.scw-agent-avatar{
display:flex;
align-items:center;
justify-content:center;
width:36px;
height:36px;
}

.scw-lead-avatar img,
.scw-agent-avatar img{
width:36px;
height:36px;
border-radius:50%;
object-fit:cover;
}
.scw-avatar-initials{
border-radius:50%;
color:#fff;
display:flex;
align-items:center;
justify-content:center;
font-weight:600;
font-size:13px;
letter-spacing:0.5px;
flex-shrink:0;
}
.scw-cleanup-btn{
    background:#ef4444;
}

.scw-cleanup-btn:hover{
    background:#dc2626;
}
.scw-cleanup-modal{
position:fixed;
inset:0;
background:rgba(0,0,0,0.45);
display:flex;
align-items:center;
justify-content:center;
z-index:9999;
}

.scw-cleanup-box{
background:#fff;
padding:30px;
border-radius:12px;
width:340px;
text-align:center;
box-shadow:0 20px 40px rgba(0,0,0,0.25);
}

.scw-cleanup-actions{
margin-top:20px;
display:flex;
gap:10px;
justify-content:center;
}

.scw-cleanup-modal .scw-cleanup-confirm{
background:#ef4444;
color:#ffffff;
}

.scw-cleanup-modal .scw-cleanup-confirm:hover{
background:#dc2626;
}


.scw-cleanup-btn{
background:#ef4444;
}

.scw-cleanup-btn:hover{
background:#dc2626;
}
.scw-cleanup-btn{

width:42px;
height:42px;

display:flex;
align-items:center;
justify-content:center;

background:#ef4444;

border-radius:10px;

box-shadow:0 6px 16px rgba(0,0,0,0.15);

transition:all .2s ease;

}

.scw-cleanup-btn .dashicons{

color:#ffffff;
font-size:18px;

}

/* HOVER */


.scw-cleanup-btn:hover{

background:#000000;
transform:translateY(-2px);

} 
/* ===============================
   RESULTADO LIMPIEZA
=============================== */

.scw-cleanup-result{

background:#ffffff;

border-radius:12px;

box-shadow:0 10px 30px rgba(0,0,0,0.08);

padding:20px 24px;

margin-bottom:20px;

border-left:4px solid #22c55e;

font-size:14px;

color:#1f2937;

}

.scw-cleanup-result strong{

display:block;

font-size:16px;

margin-bottom:8px;

color:#166534;

}
/* ===============================
   BOTON LIMPIEZA CRM
=============================== */

#scw-cleanup-trigger{

width:42px;
height:42px;

display:flex;
align-items:center;
justify-content:center;

background:#ef4444 !important;

border-radius:10px;

box-shadow:0 6px 16px rgba(0,0,0,0.15);

padding:0;

transition:all .2s ease;

border:none;

}

#scw-cleanup-trigger .dashicons{

color:#ffffff !important;
font-size:18px;

}

#scw-cleanup-trigger:hover{

background:#000000 !important;

transform:translateY(-2px);

}

.scw-cleanup-btn:hover .dashicons{

color:#ffffff;

}
/* CONTENEDOR MIS LEADS */

.scw-leads-card{

background:linear-gradient(180deg,#ffffff 0%,#f0fdf4 100%);

border-left:6px solid #22c55e;

border-radius:16px;

padding:22px;

box-shadow:0 10px 28px rgba(0,0,0,0.08);

}
.scw-bottom-sheet{

position:fixed;

bottom:-100%;

left:0;

width:100%;

height:80vh;

background:#fff;

border-radius:20px 20px 0 0;

box-shadow:0 -10px 30px rgba(0,0,0,0.25);

transition:all .3s ease;

z-index:999;

}

.scw-bottom-sheet.active{

bottom:0;

}

.scw-bottom-sheet-body{

padding:30px;

overflow-y:auto;

height:calc(80vh - 60px);

}
.scw-side-overlay{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
background:rgba(0,0,0,0.45);
z-index:9998;
opacity:0;
pointer-events:none;
transition:opacity .25s ease;
}

.scw-side-panel{
position:fixed;
top:0;
right:-80vw;
width:80vw;
max-width:1200px;
height:100%;
background:#fff;
z-index:9999;
box-shadow:-10px 0 30px rgba(0,0,0,0.2);
transition:right .28s ease;
overflow:auto;
}

.scw-side-panel.active{
right:0;
}

.scw-side-overlay.active{
opacity:1;
pointer-events:auto;
}
/* ===============================
   FIX FINAL CARD ESTADOS
=============================== */

.scw-right-panel{
display:flex;
flex-direction:column;
gap:20px;
}

.scw-status-panel{
padding:18px;
}

.scw-status-row{
display:flex;
align-items:center;
justify-content:space-between;
padding:10px 0;
border-bottom:1px solid #f1f5f9;
}

.scw-status-row:last-child{
border-bottom:none;
}

.scw-status{
display:inline-flex;
align-items:center;
padding:4px 10px;
border-radius:999px;
font-size:12px;
font-weight:600;
white-space:nowrap;
}

.scw-status-count{
font-weight:700;
font-size:14px;
color:#111827;
}
/* ARREGLO FINAL: RECUPERANDO COLORES Y ALINEACIÓN */
.scw-card.scw-status-panel {
    display: block !important;
    padding: 20px !important;
}

/* Fila de cada estado */
.scw-status-row, 
.scw-sidebar-stats li {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    text-align: left !important;
}

/* El Badge/Etiqueta (Recupera el color) */
.scw-status, 
.scw-status-label {
    flex: 0 1 auto !important; /* No fuerza a ocupar todo para no romper el badge */
    text-align: left !important;
    margin: 0 !important;
    /* No tocamos el background para que use el del archivo original */
}

/* El número (Empujado a la derecha) */
.scw-status-count,
.scw-sidebar-stats li span:last-child {
    margin-left: auto !important; /* ¡ESTA ES LA CLAVE! Empuja el número a la derecha */
    font-weight: 700 !important;
    background: #f3f4f6 !important;
    color: #1f2937 !important;
    padding: 2px 10px !important;
    border-radius: 6px !important;
    min-width: 30px !important;
    text-align: center !important;
}
/* RECUPERAR DEGRADADO VERDE EN LEADS CARD */
.scw-card.scw-leads-card {
    background: linear-gradient(135deg, #f0fff4 0%, #ffffff 100%) !important;
    border-left: 5px solid #38a169 !important; /* El borde verde que suele acompañar este diseño */
    box-shadow: 0 4px 15px rgba(56, 161, 105, 0.08) !important;
}

/* Aseguramos que si hay un header dentro, no tape el degradado */
.scw-card.scw-leads-card .scw-card-header {
    background: transparent !important;
    color: #2f855a !important;
    border-bottom: 1px solid rgba(56, 161, 105, 0.1) !important;
}
/* Contenedor relativo para posicionar el menú */
.scw-attachment-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* El menú que aparece arriba */
.scw-attach-menu {
    position: absolute;
    bottom: 50px;
    left: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    width: 140px;
    z-index: 100;
    padding: 8px 0;
}

/* Cada opción del menú */
.scw-attach-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    color: #333;
    text-align: left;
}

.scw-attach-item:hover {
    background: #f0f2f5;
    color: #25D366;
}
#scw-emoji-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s;
}

#scw-emoji-btn:hover {
    transform: scale(1.2);
}

/* Estilo para que todos los botones de la barra se vean alineados */
.scw-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f0f2f5;
    border-radius: 20px;
}
.scw-task-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f1f5f9;
    font-size: 14px;
    margin-left: 8px;
    cursor: help;
    transition: all 0.3s ease;
}

.scw-task-badge.urgent {
    background: #fee2e2; /* Rojo suave */
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
/* Color Azul Oscuro de tu logo para todos los iconos por defecto */
.scw-panoramic-toolbar .dashicons {
    color: #003366 !important; /* Ajustar al azul exacto de tu logo */
    font-size: 20px;
}

/* El texto de las herramientas */
.scw-panoramic-toolbar .t-name {
    color: #64748b;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
}

/* Verde de tu logo para el Hover o la herramienta activa */
.premium-tool:hover .dashicons,
.premium-tool:hover .t-name,
#scw-open-social:hover .dashicons,
#scw-open-social:hover .t-name {
    color: #4CAF50 !important; /* Ajustar al verde exacto de tu logo */
}

/* Si quieres que Métricas resalte como en la captura */
.premium-tool[href*="reportes"] .dashicons,
.premium-tool[href*="reportes"] .t-name {
    color: #4CAF50 !important;
}

/* ==========================================================
   BANDEJA PROFESIONAL DE EMAIL Y NOTAS — 1.1.1
   Solo modifica la presentación dentro de lead-view.php.
========================================================== */
.scw-modern-inbox,
.scw-modern-notes {
    --scw-border: #e2e8f0;
    --scw-muted: #64748b;
    --scw-title: #172033;
    --scw-surface: #ffffff;
    --scw-soft: #f8fafc;
    --scw-primary: #2563eb;
    --scw-green: #16a34a;
    width: 100%;
}

.scw-workspace-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.scw-workspace-toolbar h3 {
    margin: 2px 0 0;
    color: var(--scw-title);
    font-size: 22px;
    line-height: 1.2;
}

.scw-workspace-eyebrow,
.scw-detail-label {
    display: block;
    color: var(--scw-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.scw-inbox-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.scw-mail-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(290px, 34vw);
    padding: 0 12px;
    border: 1px solid var(--scw-border);
    border-radius: 9px;
    background: var(--scw-surface);
    color: #94a3b8;
}

.scw-mail-search input {
    width: 100% !important;
    min-height: 40px !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 13px !important;
}

.scw-compact-composer {
    position: relative;
}

.scw-compact-composer > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 15px;
    border: 0;
    border-radius: 9px;
    background: var(--scw-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.scw-note-composer > summary {
    background: var(--scw-green);
}

.scw-compact-composer > summary::-webkit-details-marker {
    display: none;
}

.scw-compact-composer[open] > summary {
    border-radius: 9px 9px 0 0;
}

.scw-compact-composer-body {
    position: absolute;
    z-index: 40;
    top: calc(100% + 8px);
    right: 0;
    width: min(520px, 82vw);
    padding: 20px;
    border: 1px solid var(--scw-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .18);
}

.scw-note-composer .scw-compact-composer-body {
    width: min(460px, 82vw);
}

.scw-compact-composer-body label {
    display: block;
    margin-bottom: 6px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.scw-compact-composer-body input[type="text"],
.scw-compact-composer-body input[type="email"],
.scw-compact-composer-body textarea,
.scw-compact-composer-body input[type="file"] {
    width: 100%;
    box-sizing: border-box;
}

.scw-compact-composer-body input[type="text"],
.scw-compact-composer-body input[type="email"],
.scw-compact-composer-body textarea {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}

.scw-compose-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;
}

.scw-compose-full {
    min-width: 0;
}

.scw-composer-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.scw-composer-actions button {
    min-height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: var(--scw-primary);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.scw-note-composer .scw-composer-actions button {
    background: var(--scw-green);
}

.scw-mail-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.scw-mail-filters button {
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--scw-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.scw-mail-filters button:hover {
    background: #f1f5f9;
}

.scw-mail-filters button.active {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.scw-mailbox-workspace,
.scw-notes-workspace {
    display: grid;
    grid-template-columns: minmax(310px, 42%) minmax(0, 58%);
    min-height: 530px;
    overflow: hidden;
    border: 1px solid var(--scw-border);
    border-radius: 14px;
    background: var(--scw-surface);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

.scw-list-pane {
    min-width: 0;
    border-right: 1px solid var(--scw-border);
    background: #fff;
}

.scw-list-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--scw-border);
    background: var(--scw-soft);
}

.scw-list-pane-header strong,
.scw-list-pane-header span {
    display: block;
}

.scw-list-pane-header strong {
    color: #334155;
    font-size: 13px;
}

.scw-list-pane-header span {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 11px;
}

.scw-modern-inbox .scw-email-list,
.scw-modern-notes .scw-notes-list {
    display: block !important;
    max-height: 430px;
    margin: 0 !important;
    padding: 0 !important;
    overflow-y: auto;
    list-style: none;
}

.scw-modern-inbox .scw-email-item,
.scw-modern-notes .scw-note-item {
    position: relative;
    display: flex !important;
    align-items: flex-start;
    gap: 11px;
    width: 100% !important;
    max-width: none !important;
    min-height: 82px;
    margin: 0 !important;
    padding: 13px 14px !important;
    border: 0 !important;
    border-bottom: 1px solid #edf1f5 !important;
    border-left: 3px solid transparent !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    color: #334155;
    cursor: pointer;
    transform: none !important;
    transition: background .16s ease, border-color .16s ease;
    box-sizing: border-box;
}

.scw-modern-inbox .scw-email-item:hover,
.scw-modern-notes .scw-note-item:hover {
    background: #f8fafc !important;
}

.scw-modern-inbox .scw-email-item.selected,
.scw-modern-inbox .scw-email-item.active,
.scw-modern-notes .scw-note-item.selected,
.scw-modern-notes .scw-note-item.active {
    border-left-color: var(--scw-primary) !important;
    background: #eff6ff !important;
}

.scw-modern-notes .scw-note-item.selected,
.scw-modern-notes .scw-note-item.active {
    border-left-color: var(--scw-green) !important;
    background: #f0fdf4 !important;
}

.scw-modern-inbox .scw-email-item.unread {
    border-left-color: #7c3aed !important;
    background: #faf5ff !important;
}

.scw-modern-inbox .scw-email-item[hidden],
.scw-filter-empty[hidden],
.scw-detail-empty[hidden],
.scw-detail-content[hidden],
.scw-email-view-attachments[hidden] {
    display: none !important;
}

.scw-mail-direction,
.scw-note-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 900;
}

.scw-mail-direction {
    background: #f1f5f9;
    color: #475569;
}

.scw-email-item.incoming .scw-mail-direction {
    background: #ede9fe;
    color: #6d28d9;
}

.scw-email-item.outgoing .scw-mail-direction {
    background: #dcfce7;
    color: #15803d;
}

.scw-note-avatar {
    background: #e2e8f0;
    color: #334155;
}

.scw-mail-row-content,
.scw-note-row-content {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

.scw-modern-inbox .scw-email-header,
.scw-note-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 4px !important;
    font-size: 12px !important;
}

.scw-modern-inbox .scw-email-header strong,
.scw-note-row-head strong {
    overflow: hidden;
    color: #1e293b;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scw-modern-inbox .scw-email-date,
.scw-note-row-head time {
    flex: 0 0 auto;
    color: #94a3b8 !important;
    font-size: 10px !important;
    font-style: normal;
    white-space: nowrap;
}

.scw-modern-inbox .scw-email-subject {
    display: block;
    overflow: hidden;
    margin: 0 0 3px !important;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scw-modern-inbox .scw-email-preview,
.scw-note-row-preview {
    display: -webkit-box;
    overflow: hidden;
    color: #64748b !important;
    font-size: 11px !important;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.scw-mail-clip {
    position: absolute;
    right: 13px;
    bottom: 9px;
    color: #64748b;
    font-size: 11px;
}

.scw-detail-pane.scw-card {
    display: flex;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff;
    box-shadow: none !important;
}

.scw-detail-empty {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    padding: 30px;
    color: #94a3b8;
    text-align: center;
}

.scw-detail-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: #f1f5f9;
    font-size: 25px;
}

.scw-detail-empty strong {
    color: #475569;
    font-size: 15px;
}

.scw-detail-empty p {
    margin: 5px 0 0;
    font-size: 12px;
}

.scw-detail-content {
    width: 100%;
    min-width: 0;
}

.scw-detail-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--scw-border);
    background: #fff;
}

.scw-detail-heading h3 {
    margin: 4px 0 3px !important;
    color: #172033;
    font-size: 20px;
    line-height: 1.3;
}

.scw-detail-heading p {
    margin: 0 !important;
    color: #64748b;
    font-size: 11px;
}

.scw-modern-inbox .scw-email-view-message,
.scw-modern-notes .scw-note-view-content {
    min-height: 300px;
    max-height: 410px;
    padding: 22px 24px !important;
    overflow: auto;
    color: #334155;
    font-size: 13px;
    line-height: 1.7 !important;
    white-space: pre-wrap;
    word-break: break-word;
}

.scw-modern-notes .scw-note-view-content {
    min-height: 360px;
}

.scw-modern-inbox .scw-email-view-attachments {
    margin: 0 24px 22px;
    padding: 14px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #eff6ff;
}

.scw-attachment-title {
    display: block;
    margin-bottom: 9px;
    color: #334155;
    font-size: 12px;
}

.scw-modern-inbox .scw-email-view-attachments a {
    display: block;
    margin-top: 6px;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    word-break: break-word;
}

.scw-list-empty,
.scw-filter-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    padding: 28px;
    color: #94a3b8;
    text-align: center;
}

.scw-list-empty span,
.scw-filter-empty span {
    margin-bottom: 9px;
    font-size: 24px;
}

.scw-list-empty strong,
.scw-filter-empty strong {
    color: #475569;
    font-size: 13px;
}

.scw-list-empty p,
.scw-filter-empty p {
    margin: 5px 0 0;
    font-size: 11px;
}

.scw-compact-pagination {
    margin: 10px 12px 12px !important;
}

@media (max-width: 900px) {
    .scw-workspace-toolbar,
    .scw-inbox-toolbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .scw-workspace-toolbar {
        align-items: flex-start;
    }

    .scw-inbox-toolbar-actions {
        width: 100%;
    }

    .scw-mail-search {
        width: 100%;
    }

    .scw-compact-composer,
    .scw-compact-composer > summary {
        width: 100%;
    }

    .scw-compact-composer-body {
        position: static;
        width: 100%;
        margin-top: 8px;
        box-sizing: border-box;
    }

    .scw-mailbox-workspace,
    .scw-notes-workspace {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .scw-list-pane {
        border-right: 0;
        border-bottom: 1px solid var(--scw-border);
    }

    .scw-modern-inbox .scw-email-list,
    .scw-modern-notes .scw-notes-list {
        max-height: 380px;
    }

    .scw-detail-pane.scw-card {
        min-height: 380px;
    }
}

@media (max-width: 560px) {
    .scw-workspace-toolbar h3 {
        font-size: 19px;
    }

    .scw-mail-filters {
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .scw-mailbox-workspace,
    .scw-notes-workspace {
        border-radius: 10px;
    }

    .scw-detail-heading,
    .scw-modern-inbox .scw-email-view-message,
    .scw-modern-notes .scw-note-view-content {
        padding-right: 16px !important;
        padding-left: 16px !important;
    }
}

/* =========================================================
   TRAL CRM — GESTIÓN COMERCIAL Y REPORTES
========================================================= */
.scw-status-sin_atender{background:#fee2e2!important;color:#991b1b!important;border-color:#fecaca!important}
.scw-status-atendido{background:#dbeafe!important;color:#1d4ed8!important;border-color:#bfdbfe!important}
.scw-status-cerrado{background:#dcfce7!important;color:#166534!important;border-color:#bbf7d0!important}
.scw-substatus-label{display:block;margin-top:4px;color:#64748b;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.25px}
.scw-sla-list-alert{display:block;margin-top:4px;color:#b91c1c;font-size:10px;font-weight:800}
.scw-lead-card.scw-row-sla-overdue{box-shadow:inset 4px 0 0 #ef4444!important}

.scw-commercial-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0 0 18px}
.scw-commercial-summary>div{background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:11px}
.scw-commercial-summary small{display:block;color:#64748b;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.4px;margin-bottom:5px}
.scw-commercial-summary strong{font-size:12px;color:#1e293b;word-break:break-word}
.scw-commercial-summary .scw-sla-ok{background:#f0fdf4;border-color:#bbf7d0}
.scw-commercial-summary .scw-sla-ok strong{color:#166534}
.scw-commercial-summary .scw-sla-late{background:#fff1f2;border-color:#fecdd3}
.scw-commercial-summary .scw-sla-late strong{color:#b91c1c}
.scw-commercial-summary .scw-sla-pending{background:#fffbeb;border-color:#fde68a}
.scw-commercial-summary .scw-sla-pending strong{color:#92400e}

.scw-sale-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.scw-sale-grid>div{display:flex;flex-direction:column;gap:5px}
.scw-sale-grid label{font-size:12px;font-weight:800;color:#475569}
.scw-sale-grid input,.scw-sale-grid select,.scw-sale-grid textarea{width:100%;padding:10px;border:1px solid #cbd5e1;border-radius:8px;box-sizing:border-box;background:#fff}
.scw-sale-grid .scw-sale-full{grid-column:1/-1}

.scw-date-separator{display:flex;align-items:center;justify-content:center;clear:both;width:100%;margin:16px 0 10px;pointer-events:none}
.scw-date-separator:before,.scw-date-separator:after{content:"";height:1px;background:#d7dde5;flex:1;max-width:180px}
.scw-date-separator span{margin:0 12px;padding:5px 12px;border-radius:16px;background:#eef2f7;color:#475569;font-size:11px;font-weight:800;box-shadow:0 1px 2px rgba(15,23,42,.06);text-transform:capitalize}

@media(max-width:900px){
  .scw-commercial-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:600px){
  .scw-commercial-summary,.scw-sale-grid{grid-template-columns:1fr}
  .scw-sale-grid .scw-sale-full{grid-column:auto}
}
.scw-status-timeline{display:flex;flex-direction:column;gap:12px}.scw-status-timeline-item{display:grid;grid-template-columns:16px 1fr;gap:9px;position:relative}.scw-status-timeline-item:not(:last-child):after{content:"";position:absolute;left:7px;top:16px;bottom:-12px;width:2px;background:#dbeafe}.scw-status-dot{width:14px;height:14px;background:#2563eb;border:3px solid #dbeafe;border-radius:50%;margin-top:2px;box-sizing:border-box}.scw-status-timeline-item strong{display:block;color:#1e293b;font-size:13px}.scw-status-timeline-item small{display:block;color:#64748b;font-size:11px;margin-top:2px}.scw-status-timeline-item p{margin:4px 0 0;color:#475569;font-size:12px}

/* ==========================================================
   CABECERA PROFESIONAL DEL LEAD — v2.0.3
   Solo presentación: conserva formularios, acciones y nonces.
========================================================== */
.scw-lead-topbar.scw-lead-header-v3 {
    display: grid;
    grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.75fr);
    align-items: stretch;
    gap: 0;
    width: calc(100% - 40px);
    max-width: 1200px;
    margin: 30px auto 22px;
    padding: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.scw-lead-header-v3 .scw-lead-profile-block {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 17px;
    padding: 24px 26px;
    background:
        radial-gradient(circle at 0 0, rgba(37, 99, 235, 0.10), transparent 44%),
        linear-gradient(145deg, #f8fbff 0%, #ffffff 72%);
    border-right: 1px solid #e8eef6;
}

.scw-lead-header-v3 .scw-lead-avatar-v3 {
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #ffffff;
    background: linear-gradient(145deg, #2563eb, #1e40af);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.scw-lead-header-v3 .scw-lead-profile-copy {
    min-width: 0;
}

.scw-lead-header-v3 .scw-lead-kicker,
.scw-lead-header-v3 .scw-management-eyebrow {
    display: block;
    margin: 0 0 4px;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.scw-lead-header-v3 .scw-lead-profile-copy h1 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(18px, 1.7vw, 23px);
    font-weight: 800;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.scw-lead-header-v3 .scw-lead-contact-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 12px;
    margin-top: 8px;
}

.scw-lead-header-v3 .scw-lead-contact-item {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.scw-lead-header-v3 .scw-lead-contact-item svg {
    flex: 0 0 13px;
    width: 13px;
    height: 13px;
    fill: currentColor;
}

.scw-lead-header-v3 .scw-current-status-v3 {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding: 6px 10px;
    border: 1px solid #dbe4f0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.scw-lead-header-v3 .scw-current-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.12);
}

.scw-lead-header-v3 .scw-current-status-v3.is-sin_atender .scw-current-status-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.scw-lead-header-v3 .scw-current-status-v3.is-atendido .scw-current-status-dot {
    background: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.scw-lead-header-v3 .scw-current-status-v3.is-cerrado .scw-current-status-dot {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}

.scw-lead-header-v3 .scw-current-status-separator {
    color: #94a3b8;
}

.scw-lead-header-v3 .scw-lead-management-block {
    min-width: 0;
    padding: 20px 24px 22px;
    background: #ffffff;
}

.scw-lead-header-v3 .scw-lead-management-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.scw-lead-header-v3 .scw-lead-management-heading h2 {
    margin: 0;
    color: #0f172a;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
}

.scw-lead-header-v3 .scw-lead-management-heading p {
    max-width: 300px;
    margin: 0;
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.4;
    text-align: right;
}

.scw-lead-header-v3 .scw-lead-controls-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 0.42fr);
    align-items: stretch;
    gap: 12px;
}

.scw-lead-header-v3 .scw-status-workflow-v3 {
    min-width: 0;
    display: grid !important;
    grid-template-columns: minmax(135px, 0.85fr) minmax(180px, 1.15fr) auto;
    align-items: end !important;
    gap: 10px !important;
    margin: 0;
    padding: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.scw-lead-header-v3 .scw-control-field-v3,
.scw-lead-header-v3 .scw-agent-control-v3 {
    min-width: 0;
}

.scw-lead-header-v3 .scw-control-field-v3 label,
.scw-lead-header-v3 .scw-agent-control-v3 > label {
    display: block;
    margin: 0 0 6px;
    color: #475569;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.scw-lead-header-v3 .scw-select-shell-v3 {
    position: relative;
    min-width: 0;
}

.scw-lead-header-v3 .scw-select-shell-v3::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 15px;
    width: 7px;
    height: 7px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

.scw-lead-header-v3 .scw-topbar-status-select,
.scw-lead-header-v3 .scw-topbar-agent-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 100%;
    min-width: 0;
    height: 44px;
    margin: 0;
    padding: 0 39px 0 13px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 44px;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.scw-lead-header-v3 .scw-topbar-status-select:hover,
.scw-lead-header-v3 .scw-topbar-agent-select:hover {
    opacity: 1;
    border-color: #94a3b8 !important;
    background: #ffffff !important;
}

.scw-lead-header-v3 .scw-topbar-status-select:focus,
.scw-lead-header-v3 .scw-topbar-agent-select:focus {
    outline: none;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13) !important;
}

.scw-lead-header-v3 .scw-save-status-btn-v3 {
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid #0f172a;
    border-radius: 10px;
    background: linear-gradient(135deg, #172033, #0f172a);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.scw-lead-header-v3 .scw-save-status-btn-v3 svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.scw-lead-header-v3 .scw-save-status-btn-v3:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #1e293b, #111827);
    box-shadow: 0 11px 22px rgba(15, 23, 42, 0.22);
}

.scw-lead-header-v3 .scw-save-status-btn-v3:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.24);
    outline-offset: 2px;
}

.scw-lead-header-v3 .scw-agent-control-v3 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
    padding: 13px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: linear-gradient(145deg, #f8fbff, #f4f7fb);
}

.scw-lead-header-v3 .scw-agent-select-shell-v3::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 13px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    transform: translateY(-50%);
    pointer-events: none;
}

.scw-lead-header-v3 .scw-agent-select-shell-v3 .scw-topbar-agent-select {
    padding-left: 31px !important;
}

.scw-lead-header-v3 .scw-control-hint-v3 {
    display: block;
    margin-top: 6px;
    color: #94a3b8;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.2;
}

@media (max-width: 1080px) {
    .scw-lead-topbar.scw-lead-header-v3 {
        grid-template-columns: 1fr;
    }

    .scw-lead-header-v3 .scw-lead-profile-block {
        border-right: 0;
        border-bottom: 1px solid #e8eef6;
    }
}

@media (max-width: 820px) {
    .scw-lead-topbar.scw-lead-header-v3 {
        width: calc(100% - 24px);
        margin-top: 18px;
        border-radius: 16px;
    }

    .scw-lead-header-v3 .scw-lead-profile-block,
    .scw-lead-header-v3 .scw-lead-management-block {
        padding: 18px;
    }

    .scw-lead-header-v3 .scw-lead-management-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .scw-lead-header-v3 .scw-lead-management-heading p {
        max-width: none;
        text-align: left;
    }

    .scw-lead-header-v3 .scw-lead-controls-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .scw-lead-header-v3 .scw-lead-profile-block {
        align-items: flex-start;
    }

    .scw-lead-header-v3 .scw-lead-avatar-v3 {
        flex-basis: 46px;
        width: 46px;
        height: 46px;
        border-radius: 14px;
        font-size: 15px;
    }

    .scw-lead-header-v3 .scw-status-workflow-v3 {
        grid-template-columns: 1fr;
    }

    .scw-lead-header-v3 .scw-save-status-btn-v3 {
        width: 100%;
    }
}

.scw-lead-header-v3 .scw-status-workflow-v3:only-child {
    grid-column: 1 / -1;
}

/* 2.0.4 - Privacidad y acceso por roles */
.scw-role-access-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding: 13px 16px;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #2563eb;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e3a8a;
}
.scw-role-access-notice .dashicons { font-size: 22px; width: 22px; height: 22px; }
.scw-role-access-notice strong,
.scw-role-access-notice small { display: block; }
.scw-role-access-notice small { margin-top: 2px; color: #475569; font-size: 12px; }
.scw-lead-header-v3.scw-agent-private-view .scw-lead-profile-block { min-width: 280px; }
.scw-lead-header-v3.scw-agent-private-view .scw-lead-management-heading h2 { margin-bottom: 2px; }
.scw-lead-header-v3.scw-agent-private-view .scw-lead-controls-row { grid-template-columns: 1fr; }

/* ==========================================================
   2.0.5 - Ajuste visual de cabecera del lead
   - Alinea la tarjeta con el ancho de las tarjetas de actividad.
   - Evita que el botón de guardado invada el bloque de colaborador.
========================================================== */
.scw-lead-topbar.scw-lead-header-v3 {
    width: 100%;
    max-width: 100%;
    margin: 30px 0 22px;
    box-sizing: border-box;
}

.scw-lead-header-v3,
.scw-lead-header-v3 * {
    box-sizing: border-box;
}

.scw-lead-header-v3 .scw-status-workflow-v3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scw-lead-header-v3 .scw-save-status-btn-v3 {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    height: 40px;
}

.scw-lead-header-v3 .scw-agent-control-v3 {
    height: 100%;
}

@media (max-width: 820px) {
    .scw-lead-topbar.scw-lead-header-v3 {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 620px) {
    .scw-lead-header-v3 .scw-status-workflow-v3 {
        grid-template-columns: 1fr;
    }
}
