/* ============================================
   TICNOLOGY LABS - SISTEMA DE DISEÑO UNIFICADO
   Estilo Supabase Clean - Todo en un archivo
   ============================================ */

/* ==================== IMPORTS ==================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ==================== VARIABLES GLOBALES ==================== */
:root {
    /* Fuente Principal */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Color Principal Dinámico (modificable vía JS) */
    --main-accent: #3ecf8e;
    --main-accent-hover: #2db574;
    --main-accent-soft: rgba(62, 207, 142, 0.1);
    
    /* Paleta de Grises */
    --gray-50: #fafafa;
    --gray-100: #f9fafb;
    --gray-200: #e5e7eb;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #6b7280;
    --gray-600: #475569;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Fondos */
    --bg-main: #fbfbfb;
    --bg-card: #ffffff;
    --bg-hover: #f8f9fa;
    
    /* Bordes */
    --border-color: #e5e7eb;
    --border-radius-sm: 4px;
    --border-radius: 6px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-full: 9999px;
    
    /* Estados del Sistema */
    --color-success: var(--main-accent);
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    
    /* Layout */
    --navbar-height: 60px;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 64px;
    
    /* Espaciados */
    --space-xs: 4px;
    --space-sm: 8px;
    --space: 12px;
    --space-md: 16px;
    --space-lg: 20px;
    --space-xl: 24px;
    --space-2xl: 32px;
    
    /* Sombras */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    background-color: var(--bg-main);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: -0.011em;
}

/* ==================== NAVBAR ==================== */
.navbar {
    height: var(--navbar-height);
    background-color: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1030;
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900) !important;
}

.navbar-brand i {
    font-size: 1.25rem;
    color: var(--main-accent);
}

#menu-toggle {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.375rem 0.75rem;
    background-color: transparent;
    color: var(--gray-600);
    font-size: 1rem;
    display: none;
}

#menu-toggle:hover {
    background-color: var(--bg-hover);
    color: var(--gray-900);
}

.navbar .dropdown-toggle {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.375rem 0.875rem;
    background-color: var(--bg-card);
    color: var(--gray-600);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
}

.navbar .dropdown-toggle:hover {
    background-color: var(--bg-hover);
    border-color: var(--main-accent);
    color: var(--gray-900);
}

.navbar .dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.navbar .dropdown-item {
    border-radius: var(--border-radius);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    transition: all 0.15s ease;
}

.navbar .dropdown-item:hover {
    background-color: var(--bg-hover);
    color: var(--gray-900);
}

.navbar .dropdown-item i {
    width: 18px;
    color: var(--gray-500);
}

.navbar .dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--border-color);
}

/* ==================== SIDEBAR ==================== */
#sidebar-wrapper {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    height: calc(100vh - var(--navbar-height));
    width: var(--sidebar-collapsed-width);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 1020;
    display: flex;
    flex-direction: column;
}

/* ==================== PERMISSIONS MODULE ==================== */
.permission-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.permission-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.module-row {
    transition: background-color 0.2s;
}

.module-row:hover {
    background-color: var(--main-accent-soft);
}

.module-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.module-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--main-accent-soft);
    border-radius: 6px;
    color: var(--main-accent);
}

.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
}

.permission-cell {
    text-align: center;
    vertical-align: middle;
}

.changed {
    background-color: #fff3cd !important;
}

.scope-separator td {
    background-color: #f8f9fa;
    color: #6c757d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ==================== TABLE SECTION SEPARATOR ==================== */
.table-section-separator td {
    background-color: #f8f9fa;
    color: #6c757d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.permissions-table {
    table-layout: fixed;
    width: 100%;
}

.permissions-col-module {
    width: 30%;
}

.permissions-col-action {
    width: 14%;
}

#sidebar-wrapper:hover {
    width: var(--sidebar-width);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.08);
}

#sidebar-wrapper .list-group {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

#sidebar-wrapper .list-group-item {
    border: none;
    background-color: transparent;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin: 0.125rem 0.5rem;
    border-radius: var(--border-radius);
    white-space: nowrap;
    cursor: pointer;
}

#sidebar-wrapper .list-group-item i {
    font-size: 1.125rem;
    min-width: 20px;
    text-align: center;
    color: var(--gray-500);
    transition: color 0.15s ease;
}

#sidebar-wrapper .list-group-item span {
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.05s;
    overflow: hidden;
    white-space: nowrap;
}

#sidebar-wrapper:hover .list-group-item span {
    opacity: 1;
}

#sidebar-wrapper .list-group-item:hover {
    background-color: var(--bg-hover);
    color: var(--gray-900);
    text-decoration: none;
}

#sidebar-wrapper .list-group-item:hover i {
    color: var(--main-accent);
}

#sidebar-wrapper .list-group-item.active {
    background-color: var(--main-accent-soft);
    color: var(--main-accent);
    font-weight: 600;
}

#sidebar-wrapper .list-group-item.active i {
    color: var(--main-accent);
}

.sidebar-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.75rem 1rem;
}

.sidebar-heading {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    padding: 0.75rem 1rem 0.375rem 1rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.05s;
    white-space: nowrap;
}

#sidebar-wrapper:hover .sidebar-heading {
    opacity: 1;
}

.submenu-item {
    padding-left: 1rem !important;
    font-size: 0.8125rem;
    transition: padding-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar-wrapper:hover .submenu-item {
    padding-left: 3rem !important;
}

.list-group-item .fa-chevron-down,
.list-group-item .arrow-icon {
    transition: transform 0.2s ease, opacity 0.2s ease;
    margin-left: auto;
    font-size: 0.75rem;
    opacity: 0;
}

#sidebar-wrapper:hover .list-group-item .fa-chevron-down,
#sidebar-wrapper:hover .list-group-item .arrow-icon {
    opacity: 1;
}

.list-group-item[aria-expanded="true"] .fa-chevron-down,
.list-group-item[aria-expanded="true"] .arrow-icon {
    transform: rotate(180deg);
}

.sidebar-footer {
    position: sticky;
    bottom: 0;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    margin-top: auto;
    flex-shrink: 0;
}

.theme-selector-container {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

#sidebar-wrapper:hover .theme-selector-container {
    opacity: 1;
}

.color-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.color-option:hover {
    transform: scale(1.15);
    border-color: var(--border-color);
}

.color-option.active {
    border-color: var(--gray-900);
    box-shadow: 0 0 0 2px var(--bg-card);
}

/* ==================== PAGE CONTENT ==================== */
#page-content-wrapper {
    margin-top: var(--navbar-height);
    margin-left: var(--sidebar-collapsed-width);
    padding: 1.5rem;
    min-height: calc(100vh - var(--navbar-height));
    background-color: var(--bg-main);
    transition: margin-left 0.25s ease;
}

/* ==================== CARDS ==================== */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-xs);
    margin-bottom: var(--space-lg);
    transition: all 0.2s ease;
}

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

.card-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--gray-900);
}

.card-body {
    padding: var(--space-xl);
}

.card-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: var(--space-md) var(--space-xl);
}

.card-accent-green {
    border-left: 4px solid var(--main-accent);
}

/* ==================== CONTACTS TOOLBAR ==================== */
.contacts-toolbar {
    display: flex;
    gap: var(--space);
    align-items: center;
    justify-content: space-between;
    padding: var(--space) var(--space-xl);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.contacts-toolbar-main {
    display: flex;
    gap: var(--space);
    align-items: center;
    flex: 1;
}

.contacts-toolbar .input-group {
    flex: 1;
    max-width: 520px;
}

.contacts-toolbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.contacts-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space);
    padding: var(--space-sm) var(--space-xl);
    border-bottom: 1px solid var(--border-color);
    background: rgba(59, 130, 246, 0.04);
}

.bulk-select-col,
.bulk-select-cell {
    width: 44px;
    display: none;
}

.contacts-table.bulk-mode .bulk-select-col,
.contacts-table.bulk-mode .bulk-select-cell {
    display: table-cell;
}

.contacts-toolbar-actions .form-select {
    padding-right: 2rem;
    background-position: right 0.6rem center;
}

.contacts-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space) var(--space-xl);
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

.filter-list {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-sm);
    background: var(--bg-main);
}

.filter-list .form-check {
    margin-bottom: var(--space-xs);
}

.campaign-column.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.campaign-list .form-check {
    margin-bottom: var(--space-xs);
}

.campaign-row > [class*='col-'] {
    display: flex;
}

.campaign-col-stack {
    flex-direction: column;
    gap: var(--space);
    height: calc(100vh - 240px);
}

.campaign-column {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(100vh - 240px);
}

.campaign-col-stack .campaign-column {
    height: auto;
    flex: 1;
}

.campaign-layout .campaign-column,
.campaign-layout .campaign-col-stack {
    height: calc(100vh - 380px);
}

.campaign-column .card-body {
    overflow-y: auto;
}

.campaign-column .card-body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.campaign-column .card-body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.campaign-template-list {
    max-height: none;
    overflow: visible;
}

.tag-stats-list {
    margin-top: var(--space);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xs);
    max-height: 140px;
    overflow-y: auto;
}

.tag-stats-card-body {
    position: relative;
}

.tag-stats-settings {
    position: absolute;
    top: var(--space);
    right: var(--space);
    padding: 4px 8px;
}

.stats-card {
    height: 100%;
}

.stats-card .card-body {
    min-height: 160px;
}

.tag-stats-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-card);
    font-size: 13px;
}

.tag-stats-count {
    font-weight: 600;
    color: var(--gray-900);
}

@media (max-width: 768px) {
    .contacts-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .contacts-toolbar .input-group {
        max-width: 100%;
    }

    .contacts-toolbar-main {
        flex-direction: column;
        align-items: stretch;
    }

    .contacts-toolbar-actions {
        justify-content: space-between;
    }
}

/* ==================== BOTONES ==================== */
.btn {
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.btn-primary,
.btn-success {
    background-color: var(--main-accent) !important;
    border-color: var(--main-accent) !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-success:hover {
    background-color: var(--main-accent-hover) !important;
    border-color: var(--main-accent-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(62, 207, 142, 0.2);
}

.btn-outline-primary,
.btn-outline-success {
    background-color: transparent;
    border-color: var(--main-accent) !important;
    color: var(--main-accent) !important;
}

.btn-outline-primary:hover,
.btn-outline-success:hover {
    background-color: var(--main-accent) !important;
    border-color: var(--main-accent) !important;
    color: #ffffff !important;
}

.btn-outline-secondary {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--gray-600);
}

.btn-outline-secondary:hover {
    background-color: var(--bg-hover);
    border-color: var(--gray-900);
    color: var(--gray-900);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
}

/* ==================== TABLAS ==================== */
.table {
    background-color: var(--bg-card);
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--gray-100);
    border-bottom: 1px solid var(--border-color);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--space-md) var(--space);
    white-space: nowrap;
}

.table tbody td {
    padding: 14px var(--space);
    vertical-align: middle;
    color: var(--gray-800);
    font-size: 14px;
    border-bottom: 1px solid var(--gray-100);
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.filter-row th {
    background: var(--bg-card) !important;
    padding: var(--space-sm) var(--space) !important;
    border-bottom: 1px solid var(--border-color);
}

.filter-input {
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

.filter-input:focus {
    border-color: var(--main-accent);
    box-shadow: 0 0 0 3px var(--main-accent-soft);
    outline: none;
}

/* ==================== FORMS ==================== */
.form-control,
.form-select {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    color: var(--gray-900);
    background-color: var(--bg-card);
    transition: all 0.15s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--main-accent);
    box-shadow: 0 0 0 3px var(--main-accent-soft);
    outline: none;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.input-group-text {
    background-color: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* ==================== BADGES Y ESTADOS ==================== */
.badge {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius-full);
}

.badge.bg-success {
    background-color: var(--main-accent) !important;
    color: #ffffff !important;
}

.badge.bg-warning {
    background-color: var(--color-warning) !important;
    color: #ffffff !important;
}

.badge.bg-danger {
    background-color: var(--color-danger) !important;
    color: #ffffff !important;
}

.badge.bg-info {
    background-color: var(--color-info) !important;
    color: #ffffff !important;
}

/* Estados de contactos */
.status-lead {
    background-color: #dbeafe;
    color: #1e40af;
    padding: 6px 12px;
    border-radius: var(--border-radius-full);
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-contacted {
    background-color: #fef3c7;
    color: #92400e;
    padding: 6px 12px;
    border-radius: var(--border-radius-full);
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-qualified {
    background-color: #d1fae5;
    color: #065f46;
    padding: 6px 12px;
    border-radius: var(--border-radius-full);
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-customer {
    background-color: #dcfce7;
    color: #166534;
    padding: 6px 12px;
    border-radius: var(--border-radius-full);
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

/* ==================== DROPDOWNS ==================== */
.dropdown-menu {
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: var(--space-sm);
    min-width: 200px;
}

.dropdown-item {
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--gray-700);
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background-color: var(--bg-hover);
    color: var(--gray-900);
}

.dropdown-divider {
    border-top-color: var(--border-color);
    margin: var(--space-sm) 0;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    padding: var(--space-sm) 10px;
    border-radius: var(--border-radius-sm);
    transition: background 0.15s ease;
    cursor: pointer;
    font-size: 13px;
}

.filter-checkbox:hover {
    background-color: var(--bg-hover);
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: var(--space-sm);
    accent-color: var(--main-accent);
    cursor: pointer;
}

/* ==================== STATS CARDS ==================== */
.stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.stat-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--main-accent-soft);
    color: var(--main-accent);
    border-radius: var(--border-radius-md);
    font-size: 24px;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(62, 207, 142, 0.2);
}

.stat-card .card-body {
    gap: var(--space-md);
}

.stat-card .card-body > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-card .stat-icon i {
    display: block;
    line-height: 1;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--main-accent);
}

.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 1px solid var(--border-color);
}

.stats-card .card-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    text-align: left;
}

.stats-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    text-align: left;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--main-accent);
}

.stats-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    width: 100%;
    text-align: left;
}

.stats-card-title {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 600;
    text-align: left;
}

.stats-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stats-card-icon.primary {
    background: var(--main-accent-soft);
    color: var(--main-accent);
    box-shadow: inset 0 0 0 1px rgba(62, 207, 142, 0.18);
}

.stats-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    text-align: left;
}

.stats-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stats-card-value--muted {
    color: var(--gray-600);
}

.stats-card-label {
    font-size: 13px;
    color: var(--gray-500);
}

.stat-content small {
    display: block;
    color: var(--gray-500);
    font-size: 12px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-content h3 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
}

/* Contacts stats */
.stat-label {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 6px;
    font-weight: 600;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-subtitle {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 6px;
}

.dashboard-content .card {
    height: 100%;
}

.quick-action {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
}

.quick-action:hover {
    background-color: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--main-accent);
}

/* ==================== PAGINACIÓN ==================== */
.pagination {
    margin: 0;
}

.page-link {
    color: var(--gray-700);
    border-color: var(--border-color);
    background-color: var(--bg-card);
    transition: all 0.15s ease;
}

.page-link:hover {
    background-color: var(--bg-hover);
    border-color: var(--gray-300);
    color: var(--gray-900);
}

.page-item.active .page-link {
    background-color: var(--main-accent);
    border-color: var(--main-accent);
}

/* ==================== ALERTAS ==================== */
.alert {
    border-radius: var(--border-radius-md);
    border: 1px solid;
    font-size: 0.875rem;
}

.alert-success {
    background-color: #d1fae5;
    border-color: var(--main-accent);
    color: #065f46;
}

.alert-info {
    background-color: #dbeafe;
    border-color: #60a5fa;
    color: #1e40af;
}

.alert-warning {
    background-color: #fef3c7;
    border-color: #fbbf24;
    color: #92400e;
}

.alert-danger {
    background-color: #fee2e2;
    border-color: #f87171;
    color: #991b1b;
}

/* ==================== PROGRESS BARS ==================== */
.progress {
    height: 8px;
    border-radius: var(--border-radius-full);
    background-color: var(--gray-200);
}

.progress-bar {
    background-color: var(--main-accent);
    border-radius: var(--border-radius-full);
}

/* ==================== SPINNERS ==================== */
.spinner-border {
    border-color: var(--gray-200);
    border-right-color: var(--main-accent);
}

.spinner-border.text-success {
    border-right-color: var(--main-accent);
}

/* ==================== UTILIDADES ==================== */
.text-success {
    color: var(--main-accent) !important;
}

.bg-success {
    background-color: var(--main-accent) !important;
}

.border-success {
    border-color: var(--main-accent) !important;
}

.text-muted {
    color: var(--gray-500) !important;
}

.contact-name {
    font-weight: 600;
    color: var(--gray-900);
}

.shadow-xs {
    box-shadow: var(--shadow-xs) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.fw-bold {
    font-weight: 600 !important;
}

/* ==================== LOGIN PAGE ==================== */
.login-page {
    background: linear-gradient(135deg, var(--main-accent) 0%, var(--main-accent-hover) 100%);
    min-height: 100vh;
}

.login-page .card {
    border: none;
    box-shadow: var(--shadow-lg);
}

/* ==================== ANIMACIONES ==================== */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ==================== TABLAS CON SCROLL FIJO ==================== */
.table-container {
    max-height: calc(100vh - 400px);
    min-height: 400px;
    overflow: auto;
    position: relative;
}

.table-sticky {
    width: 100%;
}

.table-sticky thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bg-card);
}

.table-sticky thead th {
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.05);
}

.table-sticky .filter-row th {
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.05);
}

/* Fix para dropdowns en tablas con scroll */
.table-container .dropdown-menu {
    position: fixed !important;
    z-index: 1050;
}

.dropdown-scroll {
    max-height: 250px;
    overflow-y: auto;
}

.dropdown-menu-lg {
    min-width: 250px;
}

/* ==================== CARDS MOBILE (TABLAS) ==================== */
.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    transition: all 0.2s ease;
}

.contact-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--main-accent);
}

.contact-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--space-sm);
}

.contact-card-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.contact-card-phone {
    font-size: 13px;
    color: var(--gray-600);
}

.contact-card-body {
    display: grid;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
}

.contact-card-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 13px;
}

.contact-card-row i {
    width: 16px;
    color: var(--gray-400);
    font-size: 12px;
}

.contact-card-row span {
    color: var(--gray-700);
}

.contact-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--gray-100);
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    height: 56px;
}

.navbar-brand {
    font-size: 1.1rem;
    color: var(--gray-900);
}

.navbar-brand:hover {
    color: var(--main-accent);
}

#menu-toggle {
    color: var(--gray-700);
    border: none;
    background: transparent;
    font-size: 1.25rem;
    padding: 0.25rem 0.5rem;
}

#menu-toggle:hover {
    color: var(--main-accent);
}

/* Dropdowns del navbar */
.navbar .dropdown-toggle {
    border-color: var(--border-color);
    color: var(--gray-700);
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    min-width: 120px;
}

.navbar .dropdown-toggle:hover {
    border-color: var(--main-accent);
    color: var(--main-accent);
}

.navbar .dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    min-width: 220px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.navbar .dropdown-header {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.navbar .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    transition: all 0.15s ease;
}

.navbar .dropdown-item:hover {
    background: var(--gray-50);
    color: var(--main-accent);
}

.navbar .dropdown-item.active {
    background: var(--main-accent-soft);
    color: var(--main-accent);
    font-weight: 500;
}

.navbar .dropdown-item i {
    width: 16px;
    font-size: 0.875rem;
}

.navbar .dropdown-divider {
    margin: 0.5rem 0;
}

/* ==================== BADGES ==================== */
.badge {
    font-weight: 600;
    padding: 0.35em 0.65em;
}

.badge-sm {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
    font-weight: 600;
}

/* Soft badges (unified) */
.badge-soft-success {
    background: rgba(62, 207, 142, 0.18);
    color: #1f7a55;
    border: 1px solid rgba(62, 207, 142, 0.35);
}

.badge-soft-neutral {
    background: rgba(148, 163, 184, 0.18);
    color: #475569;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.badge-soft-accent {
    background: rgba(62, 207, 142, 0.14);
    color: #1f4d3a;
    border: 1px solid rgba(62, 207, 142, 0.25);
}

.badge-soft-danger {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.28);
}

.badge-soft-warning {
    background: rgba(245, 158, 11, 0.18);
    color: #9a5b06;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-pill {
    border-radius: 999px;
}

/* ==================== AVATAR CIRCLES ==================== */
.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--main-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 767px) {
    #menu-toggle {
        display: block;
    }
    
    #sidebar-wrapper {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    
    #sidebar-wrapper.show {
        transform: translateX(0);
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    }
    
    #sidebar-wrapper.show .list-group-item span,
    #sidebar-wrapper.show .sidebar-heading,
    #sidebar-wrapper.show .theme-selector-container {
        opacity: 1;
    }
    
    #page-content-wrapper {
        margin-left: 0 !important;
    }
    
    .card-body {
        padding: var(--space-md);
    }
    
    .table-container {
        max-height: none;
        min-height: auto;
    }
    
    .table thead th {
        font-size: 12px;
        padding: var(--space-sm);
    }
    
    .table tbody td {
        font-size: 14px;
        padding: var(--space-sm);
    }
}

@media (min-width: 768px) {
    .table-container {
        max-height: calc(100vh - 400px);
    }
}

/* ==================== WIZARD LATERAL (CAMPAIGNS CREATE) ==================== */
.wizard-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.wizard-nav-item {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.wizard-nav-item:hover {
    background: var(--gray-50);
}

.wizard-nav-item.active {
    background: var(--main-accent-soft);
    border-color: var(--main-accent);
}

.wizard-nav-item.completed {
    background: rgba(25, 135, 84, 0.05);
}

.wizard-nav-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
    margin-right: var(--space-md);
    transition: all 0.2s ease;
}

.wizard-nav-item.active .wizard-nav-number {
    background: var(--main-accent);
    color: white;
}

.wizard-nav-item.completed .wizard-nav-number {
    background: var(--success);
    color: white;
}

.wizard-nav-content {
    flex: 1;
}

.wizard-nav-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.wizard-nav-desc {
    color: var(--gray-500);
    font-size: 12px;
}

.wizard-nav-item.active .wizard-nav-title {
    color: var(--main-accent);
}

.wizard-step-header {
    margin-bottom: var(--space-lg);
}

.wizard-step-header h4 {
    font-weight: 700;
    color: var(--gray-900);
}

.wizard-step-header p {
    font-size: 15px;
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
}

/* ==================== TEMPLATE CARDS ==================== */
.template-grid {
    max-height: 400px;
    overflow-y: auto;
}

.template-card {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.template-card:hover {
    transform: translateY(-2px);
    border-color: var(--main-accent);
    box-shadow: var(--shadow-sm);
}

.template-card.selected {
    border-color: var(--success);
    background-color: var(--main-accent-soft);
}

.campaign-column .campaign-template-list {
    max-height: none;
    height: 100%;
    overflow-y: auto;
}

/* ==================== STAT CARDS CON ICONOS ==================== */
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon-primary {
    background: var(--main-accent-soft);
    color: var(--main-accent);
}

.stat-icon-secondary {
    background: rgba(108, 117, 125, 0.1);
    color: var(--gray-600);
}

.stat-icon-success {
    background: rgba(25, 135, 84, 0.1);
    color: var(--success);
}

.stat-icon-info {
    background: rgba(13, 202, 240, 0.1);
    color: #0dcaf0;
}

.stat-icon-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

/* ============================================
   CAMPAIGN DETAIL - Modern UI Styles
   ============================================ */

/* Iconos circulares para métricas */
.stat-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.bg-primary-soft {
    background-color: rgba(13, 110, 253, 0.1);
}

.bg-success-soft {
    background-color: var(--main-accent-soft);
}

.bg-info-soft {
    background-color: rgba(13, 202, 240, 0.1);
}

.bg-secondary-soft {
    background-color: rgba(108, 117, 125, 0.1);
}

.bg-danger-soft {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Tabla mejorada sticky header */
.table thead.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--card-bg);
}

.table-hover tbody tr:hover {
    background-color: var(--main-accent-soft);
}

/* Radio buttons modernos para filtros */
.btn-check:checked + .btn {
    background-color: var(--main-accent) !important;
    border-color: var(--main-accent) !important;
    color: white !important;
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-secondary:hover,
.btn-outline-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

/* Cards con shadow mejorado y animación */
.card.shadow-sm {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card.shadow-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

/* Progress bar con animación suave */
.progress-bar {
    transition: width 0.6s ease;
}

.progress {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Timeline compacta para contactos */
.timeline-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.timeline-item i {
    width: 16px;
    text-align: center;
}

/* Headers de cards sin borde */
.card-header.bg-white {
    background-color: var(--card-bg) !important;
}

/* ==================== ACTION BUTTONS (UNIFIED) ==================== */
.action-buttons {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.action-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-card);
    color: var(--gray-600);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--gray-300);
    color: var(--gray-800);
    transform: translateY(-1px);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn-edit:hover {
    background: var(--main-accent-soft);
    border-color: var(--main-accent);
    color: var(--main-accent);
}

.action-btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--color-danger);
    color: var(--color-danger);
}

.action-btn-secondary:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--color-info);
    color: var(--color-info);
}

/* Responsive adjustments para campaign detail */
@media (max-width: 768px) {
    .stat-icon-circle {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .card-body h3 {
        font-size: 1.5rem;
    }

    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .action-buttons {
        gap: 4px;
    }

    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* ==================== SYNC MODAL STYLES ==================== */
/* Modal de sincronización estilo dashboard */
.sync-modal-content {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--bg-card);
}

.sync-modal-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-lg) var(--space-2xl);
}

.sync-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-lg);
}

.sync-modal-title {
    color: var(--gray-900);
    margin: 0;
    font-weight: 600;
    font-size: 1.125rem;
}

.sync-modal-subtitle {
    color: var(--gray-500);
    margin: 2px 0 0 0;
    font-size: 0.8125rem;
}

.sync-status-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 10px;
    border-radius: var(--border-radius-full);
    font-size: 12px;
    font-weight: 600;
    background: var(--main-accent-soft);
    color: var(--main-accent);
    border: 1px solid rgba(62, 207, 142, 0.25);
    white-space: nowrap;
}

.sync-status-pill.is-complete {
    background: rgba(62, 207, 142, 0.15);
    color: #065f46;
    border-color: rgba(62, 207, 142, 0.35);
}

.sync-status-pill.is-error {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.25);
}

.sync-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.15);
}

.sync-status-pill.is-error .sync-status-dot {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.sync-modal-body {
    background: var(--bg-main);
    padding: var(--space-lg) var(--space-2xl);
    max-height: 520px;
    position: relative;
}

.sync-progress-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space);
    box-shadow: var(--shadow-xs);
    margin-bottom: var(--space-lg);
    position: sticky;
    top: 0;
    z-index: 2;
}

.sync-progress-panel::before {
    content: "";
    position: absolute;
    inset: -12px -24px;
    background: var(--bg-main);
    z-index: -1;
}

.sync-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space);
    margin-bottom: var(--space-sm);
}

.sync-progress-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
}

.sync-progress-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.sync-progress-track {
    height: 6px;
}

.sync-progress-bar {
    border-radius: var(--border-radius-full);
}

.sync-logs-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xs);
    padding: var(--space);
}

.sync-logs-container {
    max-height: 360px;
    overflow-y: auto;
    padding: 0;
}

.sync-modal-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: var(--space-md) var(--space-2xl);
}

/* Log items con diseño de cards */
.sync-log-item {
    background: var(--bg-card);
    border-left: 3px solid;
    padding: var(--space) var(--space-md);
    margin-bottom: var(--space-sm);
    border-radius: var(--border-radius);
    display: flex;
    align-items: flex-start;
    gap: var(--space);
    animation: slideInLog 0.3s ease-out;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.sync-log-item.is-latest {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.sync-log-item.log-info {
    border-left-color: var(--color-info);
    background: rgba(59, 130, 246, 0.06);
}

.sync-log-item.log-success {
    border-left-color: var(--main-accent);
    background: rgba(62, 207, 142, 0.1);
}

.sync-log-item.log-error {
    border-left-color: var(--color-danger);
    background: rgba(239, 68, 68, 0.08);
}

/* ==================== IMPORT CONTACTS MODAL ==================== */
.import-summary {
    padding: var(--space-sm) var(--space);
    border-radius: var(--border-radius);
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.import-mapping {
    margin-top: var(--space-lg);
}

.import-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space);
    margin-bottom: var(--space-sm);
}

.import-mapping-grid {
    display: grid;
    gap: var(--space-sm);
}

.import-mapping-row {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--space);
    align-items: center;
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-card);
}

.import-mapping-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
}

.import-fixed-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space);
    margin-top: var(--space);
    padding: var(--space);
    border-radius: var(--border-radius);
    border: 1px dashed var(--border-color);
    background: rgba(15, 23, 42, 0.02);
}

.import-fixed-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
}

.import-attributes {
    margin-top: var(--space-lg);
}

.import-attributes-header {
    margin-bottom: var(--space-sm);
}

.import-attributes-list {
    display: grid;
    gap: var(--space-sm);
}

.import-attribute-row {
    display: grid;
    grid-template-columns: minmax(160px, 1.1fr) minmax(160px, 1fr) minmax(160px, 1fr) auto;
    gap: var(--space-sm);
    align-items: center;
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-card);
}

.campaign-progress {
    height: 10px;
    border-radius: var(--border-radius-full);
    overflow: hidden;
}

.campaign-progress-pending {
    background: rgba(148, 163, 184, 0.6);
}

.campaign-progress-advance {
    background: var(--main-accent);
}

.campaign-progress-failed {
    background: rgba(239, 68, 68, 0.5);
}

.campaign-countdown-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 6px 12px;
    border-radius: var(--border-radius-full);
    border: 1px solid var(--main-accent);
    background: var(--main-accent-soft);
    color: var(--gray-900);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: var(--space);
}

.campaign-countdown-pill i {
    color: var(--main-accent);
}

.campaign-countdown-pill.is-success {
    border-color: rgba(22, 163, 74, 0.65);
    background: rgba(22, 163, 74, 0.12);
}

.campaign-countdown-pill.is-success i {
    color: #16a34a;
}

.campaign-countdown-pill.is-success .countdown-text {
    color: #166534;
}

.campaign-countdown-pill--sm {
    padding: 4px 10px;
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .import-mapping-row {
        grid-template-columns: 1fr;
    }

    .import-fixed-fields {
        grid-template-columns: 1fr;
    }

    .import-attribute-row {
        grid-template-columns: 1fr;
    }
}

.sync-log-item.log-warning {
    border-left-color: var(--color-warning);
    background: rgba(245, 158, 11, 0.1);
}

.sync-log-icon {
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.sync-log-item.log-info .sync-log-icon {
    color: var(--color-info);
}

.sync-log-item.log-success .sync-log-icon {
    color: var(--main-accent);
}

.sync-log-item.log-error .sync-log-icon {
    color: var(--color-danger);
}

.sync-log-item.log-warning .sync-log-icon {
    color: var(--color-warning);
}

.sync-log-content {
    flex: 1;
    min-width: 0;
}

.sync-log-message {
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
    word-wrap: break-word;
    color: var(--gray-800);
}

.sync-log-item.log-info .sync-log-message {
    color: #1e40af;
}

.sync-log-item.log-success .sync-log-message {
    color: #065f46;
}

.sync-log-item.log-error .sync-log-message {
    color: #991b1b;
}

.sync-log-item.log-warning .sync-log-message {
    color: #92400e;
}

.sync-log-timestamp {
    color: var(--gray-500);
    font-size: 12px;
    margin-top: 4px;
}

/* Mensaje final de sincronización completada */
.sync-completion-card {
    background: var(--bg-card);
    color: var(--gray-800);
    padding: var(--space-lg);
    margin: var(--space-md) 0;
    border-radius: var(--border-radius);
    text-align: left;
    border: 1px solid rgba(62, 207, 142, 0.35);
    border-left: 4px solid var(--main-accent);
    box-shadow: var(--shadow-xs);
    animation: slideInLog 0.5s ease-out;
}

.sync-completion-icon {
    font-size: 28px;
    margin-bottom: var(--space-sm);
    display: block;
    color: var(--main-accent);
}

.sync-completion-title {
    margin: 0 0 var(--space-xs) 0;
    font-weight: 600;
    font-size: 1rem;
}

.sync-completion-text {
    margin: 0;
    color: var(--gray-600);
    font-size: 13px;
}

/* Animación para los logs */
@keyframes slideInLog {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== MIA WEB PERFORMANCE ==================== */
.mia-web-performance-page .stats-card .card-body {
    min-height: 140px;
}

.mia-web-performance-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    height: calc(100vh - var(--navbar-height) - 24px - 5vh);
    overflow: hidden;
}

.mia-web-performance-page .card {
    margin-bottom: 0;
}

.mia-web-performance-header {
    flex: 0 0 auto;
}

.mia-web-performance-stats {
    flex: 0 0 auto;
    margin-bottom: 0 !important;
}

.mia-web-performance-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr) minmax(240px, 1fr);
    gap: var(--space-lg);
    flex: 1 1 auto;
    min-height: 0;
}

.mia-web-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.mia-web-panel .card-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.mia-web-chat-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.mia-web-panel--detail .card-body {
    gap: var(--space-sm);
}

.mia-web-panel--filters .card-body {
    overflow-y: auto;
}

.mia-web-url {
    font-size: 13px;
    color: var(--main-accent);
}

.mia-web-url.d-none {
    display: none;
}

.mia-web-chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.mia-web-chat-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-sm) var(--space);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mia-web-chat-card:hover {
    background: var(--bg-hover);
    border-color: var(--main-accent);
}

.mia-web-chat-card.active {
    border-color: var(--main-accent);
    box-shadow: var(--shadow-sm);
}

.mia-web-chat-title {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.mia-web-chat-meta {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    justify-content: space-between;
    gap: var(--space-sm);
}

.mia-web-prospect-summary {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-sm);
    flex: 0 0 auto;
    max-height: 20%;
    overflow-y: auto;
}

.mia-web-prospect-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.mia-web-prospect-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 12px;
}

.mia-web-prospect-field .text-muted {
    margin-bottom: 2px;
}

.mia-web-prospect-field .fw-semibold {
    line-height: 1.2;
}

.mia-web-chat-history {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.mia-web-message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.mia-web-message--assistant {
    align-self: flex-end;
    text-align: right;
}

.mia-web-message--user {
    align-self: flex-start;
}

.mia-web-message-meta {
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.mia-web-message-bubble {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--space-sm) var(--space);
    font-size: 13px;
    line-height: 1.4;
    color: var(--gray-800);
}

.mia-web-message--assistant .mia-web-message-bubble {
    background: var(--main-accent-soft);
    border-color: rgba(62, 207, 142, 0.25);
}

.mia-web-empty {
    text-align: center;
    color: var(--gray-500);
    padding: var(--space-lg) 0;
    font-size: 13px;
}

@media (max-width: 1200px) {
    .mia-web-performance-grid {
        grid-template-columns: minmax(220px, 1fr) minmax(0, 1.6fr);
    }

    .mia-web-performance-grid .mia-web-panel:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 992px) {
    .mia-web-performance-page {
        height: auto;
        overflow: visible;
    }

    .mia-web-performance-grid {
        grid-template-columns: 1fr;
    }

    .mia-web-chat-history,
    .mia-web-chat-list {
        max-height: 420px;
    }
}
