:root {
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-width: 380px;
    --sidebar-collapsed: 80px;
    --transition: all 0.3s ease;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    position: relative;
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 100;
}

.sidebar.collapsed {
    width: 0;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border-right: none;
    opacity: 0;
    pointer-events: none;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    color: var(--primary);
    font-size: 1.25rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-main);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.gestiones-box {
    margin: 1rem 1rem 0 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    border-radius: 16px;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
    transition: var(--transition);
}

.gestiones-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.label-left {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.count-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 1.15rem;
    font-weight: 800;
    min-width: 32px;
    text-align: center;
}

.sidebar.collapsed .logo span,
.sidebar.collapsed .user-info span,
.sidebar.collapsed .gestiones-label span,
.sidebar.collapsed .gestiones-breakdown,
.sidebar.collapsed .section-title span,
.sidebar.collapsed .search-box,
.sidebar.collapsed .item-number,
.sidebar.collapsed .item-name,
.sidebar.collapsed .status-dot {
    display: none;
}

/* Floating button to reopen sidebar */
.sidebar-open-btn {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 36px;
    height: 72px;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    color: white;
    border: none;
    border-radius: 0 14px 14px 0;
    cursor: pointer;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 4px 0 16px rgba(37, 99, 235, 0.25);
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.sidebar-open-btn:hover {
    width: 44px;
    box-shadow: 6px 0 20px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, #4338ca, #1d4ed8);
}

.sidebar-open-btn.visible {
    opacity: 1;
    pointer-events: auto;
    animation: slideInBtn 0.3s ease forwards;
}

@keyframes slideInBtn {
    from {
        transform: translateY(-50%) translateX(-100%);
    }

    to {
        transform: translateY(-50%) translateX(0);
    }
}

.gestiones-value {
    display: flex;
    flex-direction: column;
}


.gestiones-value .count {
    font-size: 2rem;
    font-weight: 800;
}

.gestiones-value .subtext {
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0.8;
}

.gestiones-mini-breakdown {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.mini-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
}

.mini-item i {
    font-size: 1.2rem;
}

.mini-item.green {
    color: #10b981;
}

.mini-item.orange {
    color: #fbbf24;
}

.mini-item.red {
    color: #f87171;
}

/* Fallback for white icons in dark-ish backgrounds if needed */
.gestiones-box .mini-item.green i {
    color: #34d399;
}

.gestiones-box .mini-item.orange i {
    color: #fbbf24;
}

.gestiones-box .mini-item.red i {
    color: #f87171;
}

.gestiones-box .mini-item span {
    color: white;
}

.prospectos-section {
    padding: 1.5rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-sidebar {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}

.search-container {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    margin: 0 1rem 0 1rem;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 0;
    background: var(--bg-main);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    transition: flex 0.35s ease;
    cursor: pointer;
    overflow: hidden;
}

.search-box.expanded {
    flex: 4;
}

.search-box input {
    border: none;
    background: none;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
    cursor: text;
}

.search-city {
    flex: 1;
    min-width: 0;
    background: var(--bg-main);
    border-radius: 12px;
    padding: 1rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: flex 0.35s ease;
}

.search-city.collapsed {
    flex: 0 0 38px;
    padding: 0.5rem;
}

.search-city.collapsed .search-city-btn span {
    display: none;
}

.search-city-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    background: none;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
}

.panel-comunidades {
    position: absolute;
    top: 0;
    left: 100%;
    width: 300px;
    height: 100%;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 90;
    display: none;
    flex-direction: column;
    transform: translateX(-20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.panel-comunidades.active {
    transform: translateX(0);
    opacity: 1;
}

.panel-comunidades-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-comunidades-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.panel-comunidades-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}

.panel-comunidades-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.lista-comunidades {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lista-comunidades li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.lista-comunidades li:hover {
    background: var(--bg-main);
}

.lista-comunidades li.active {
    background: var(--primary);
    color: white;
}

.lista-comunidades li.active i {
    color: white;
}

.panel-provincias {
    position: fixed;
    width: 250px;
    max-height: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    box-shadow: var(--shadow-lg);
    z-index: 95;
    display: none;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.panel-provincias.active {
    opacity: 1;
    transform: translateX(0);
}

.panel-provincias-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-main);
}

.panel-provincias-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-provincias-body {
    padding: 0.5rem;
    max-height: 350px;
    overflow-y: auto;
}

.lista-provincias {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.lista-provincias li {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.lista-provincias li:hover {
    background: var(--primary);
    color: white;
}


.lista-comunidades>li.hover-active i {
    color: white !important;
}

.lista-comunidades li.selected {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    border-left: 4px solid var(--primary);
}

.lista-provincias li.selected {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* Ocultar lista de ciudades original */
.lista-comunidades .lista-provincias {
    display: none !important;
}

/* Ajustes responsive */
@media (max-width: 1024px) {
    .panel-provincias {
        width: 220px;
    }
}

@media (max-width: 768px) {
    .panel-comunidades {
        width: 280px;
    }

    .panel-provincias {
        display: none !important;
    }
}

/* Contador de resultados */
.results-count {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg-main);
}

/* Botón de filtros activos */
.search-city-btn.has-filters {
    color: var(--primary);
    font-weight: 600;
}

.search-city-btn.has-filters i {
    color: var(--primary);
}

/* Mensaje de sin resultados */
.no-results-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 1rem;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: 8px;
    margin: 1rem;
}

.no-results-message i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.no-results-message p {
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.clear-filters-btn {
    margin-top: 1.5rem;
    padding: 0.5rem 0.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.clear-filters-btn i {
    color: white;
    font-size: 2.2rem;
    margin-top: 0.2rem;
    height: 100%;
    width: 40%;
}

.clear-filters-btn:hover {
    transform: translateY(-1px);
}

/* Animación para items filtrados */
.client-item {
    transition: opacity 0.2s ease;
}

.client-item[style*="display: none"] {
    opacity: 0;
}


.client-list {
    overflow-y: auto;
    flex: 1;
}

.client-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0.25rem;
}

.client-item:hover {
    background: var(--bg-main);
}

.client-item.active {
    background: var(--primary);
    color: white;
}

.item-number {
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.5;
}

.item-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
}

.status-dot.pendiente {
    background: #f59e0b;
    /* Yellow/Amber for real pending */
}

.status-dot.pendiente.no-contact {
    background: #cbd5e1;
    /* Grey for uncontacted */
}

.status-dot.procesado {
    background: var(--success);
}

.status-dot.descartado {
    background: var(--danger);
}

/* Pending items with contact result -> Yellow/Amber */
.client-item.pendiente:not(.no-contact):not(.active) {
    color: #d97706;
}

.client-item.pendiente:not(.no-contact):not(.active) i {
    color: #f59e0b;
}

/* Uncontacted items -> Grey */
.client-item.pendiente.no-contact:not(.active) {
    color: #94a3b8;
}

.client-item.pendiente.no-contact:not(.active) i {
    color: #cbd5e1;
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;

}

/* Top Nav */
.top-nav {
    height: 80px;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quick-stats {
    display: flex;
    gap: 0.5rem;
}

.stat-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
}

.btn-nav {
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-nav.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-action {
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-action.green {
    background: #ecfdf5;
    color: #10b981;
}

.btn-action.blue {
    background: #eff6ff;
    color: #3b82f6;
}

.btn-action.red {
    background: #fef2f2;
    color: #ef4444;
}

.btn-action.teal {
    background: #ccfbf1;
    color: #0d9488;
}

.btn-action.purple {
    background: #f3e8ff;
    color: #9333ea;
}

.btn-action.outline.teal {
    background: white;
    border: 1px solid #0d9488;
    color: #0d9488;
}

.btn-action.outline.purple {
    background: white;
    border: 1px solid #9333ea;
    color: #9333ea;
}

body.dark-mode .btn-action.outline.teal {
    background: #1e293b;
    border-color: #0d9488;
    color: #0d9488;
}

body.dark-mode .btn-action.outline.purple {
    background: #1e293b;
    border-color: #9333ea;
    color: #9333ea;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
}

.profile-pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-pic:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    color: var(--primary);
}

/* Content Area */
.content-area {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.nav-arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-indicator {
    padding: 0.5rem 1.25rem;
    background: white;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-indicator .current {
    color: var(--primary);
}

.quick-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.round-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.round-btn.red {
    background: #fee2e2;
    color: #ef4444;
}

.round-btn.grey {
    background: #f1f5f9;
    color: #64748b;
}

.status-pill {
    padding: 0.5rem 1.25rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #94a3b8;
    transition: all 0.2s;
}

.status-pill.pendiente {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fde047;
}

.status-pill.procesado {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.status-pill.descartado {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

/* Client Card */
.client-main-card {
    background: white;
    border-radius: 24px;
    box-shadow: var(--shadow);
    overflow: visible;
}

.card-body {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    min-height: 0;
}

.card-column {
    padding: 1rem;
}

.main-info {
    border-right: 1px solid var(--border);
}

.info-section {
    margin-bottom: 1.25rem;
}

.section-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.client-name,
.contact-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.item-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #94a3b8;
}

.item-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
}

.location-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.location-box i {
    margin-top: 0.25rem;
    color: #94a3b8;
}

.btn-search-cif {
    margin-top: 0.5rem;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.contact-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.contact-group {
    padding: 0.75rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
}

.contact-group.tel {
    background: #fffcf9;
    border: 1px solid rgba(249, 115, 22, 0.08);
}

.contact-group.email {
    background: #f9fbff;
    border: 1px solid rgba(59, 130, 246, 0.08);
}

.group-title {
    font-size: 0.7rem;
    font-weight: 800;
    color: #f97316;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.group-title i {
    font-size: 0.85rem;
}

.email .group-title {
    color: #3b82f6;
}

.contact-item {
    margin-bottom: 0.25rem;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: #fdba74;
    text-transform: uppercase;
    margin-bottom: 0.15rem;
}

.email .contact-label {
    color: #93c5fd;
}

.contact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.contact-value {
    font-size: 0.9rem;
    font-weight: 800;
    color: #1e293b;
    flex: 1;
}

.contact-actions {
    display: flex;
    gap: 0.25rem;
}

.contact-actions button {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
    background: white;
    color: #f97316;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.email .contact-actions button {
    color: #3b82f6;
}

/* Specific color for copy icon to match mockup */
.contact-actions button .fa-copy {
    color: #94a3b8 !important;
}

.contact-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    background: #fff;
}

.contact-actions button:hover i:not(.fa-copy) {
    transform: scale(1.1);
}

/* Result Side */
.result-side {
    background: #fcfdfe;
}

.side-section {
    margin-bottom: 2rem;
}

.side-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.text-btn {
    background: none;
    border: none;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.custom-select {
    width: 100%;
    padding: 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: white;
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    outline: none;
}

.observations textarea {
    width: 100%;
    height: 150px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    font-size: 0.95rem;
    color: #1e293b;
    resize: none;
    outline: none;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    margin: 2% auto;
    border-radius: 20px;
    padding: 2rem;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* Dark Mode Overrides */
body.dark-mode {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --primary: #3b82f6;
}

body.dark-mode .logo-top .logo-icon .logo-badge {
    border-color: #1e293b;
}

body.dark-mode .sidebar,
body.dark-mode .top-nav,
body.dark-mode .client-main-card,
body.dark-mode .modal-content,
body.dark-mode .nav-arrow,
body.dark-mode .page-indicator,
body.dark-mode .btn-nav:not(.active),
body.dark-mode .contact-actions button,
body.dark-mode .custom-select,
body.dark-mode .observations textarea {
    background-color: #1e293b;
    color: #f8fafc;
    border-color: #334155;
}

body.dark-mode .search-box,
body.dark-mode .user-info,
body.dark-mode .profile-pic,
body.dark-mode .stat-circle {
    background-color: #0f172a;
    border-color: #334155;
}

body.dark-mode .client-name,
body.dark-mode .contact-name,
body.dark-mode .item-value,
body.dark-mode .contact-value {
    color: #f8fafc;
}

body.dark-mode .client-item:hover {
    background-color: #334155;
}

body.dark-mode .client-item.active {
    background-color: var(--primary);
    color: white;
}

body.dark-mode .result-side {
    background: #1e293b;
    border-left: 1px solid #334155;
}

body.dark-mode .status-pill {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .round-btn.grey {
    background-color: #334155;
    color: #94a3b8;
}

body.dark-mode .text-btn {
    color: #60a5fa;
}

/* Current Status Title */
.current-status-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(59, 130, 246, 0.06));
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    animation: fadeInDown 0.3s ease;
}

.current-status-title i {
    color: #6366f1;
    font-size: 1.5rem;
}

.current-status-title #currentStatusText {
    flex: 1;
}

body.dark-mode .current-status-title {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(59, 130, 246, 0.08));
    border-color: rgba(99, 102, 241, 0.25);
}

/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
    width: 100%;
    margin-top: 10px;
}

.dropdown-trigger {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.dropdown-trigger:hover {
    border-color: var(--primary);
}

.dropdown-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-options.show {
    display: block;
    animation: fadeInDown 0.2s ease;
}

.dropdown-item {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--bg-app);
}

.dropdown-item .option-text {
    font-size: 0.95rem;
    color: var(--text-main);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.procesado {
    background: #dcfce7;
    color: #166534;
}

.status-badge.pendiente {
    background: #fef9c3;
    color: #854d0e;
}

.status-badge.descartado {
    background: #fee2e2;
    color: #991b1b;
}

/* Enhanced Modal Styles */
.modal-content.large {
    max-width: 800px;
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
    max-height: 96vh;
    display: flex;
    flex-direction: column;
}

.modal-header-main {
    padding: 12px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.header-icon.green {
    background: #dcfce7;
    color: #166534;
}

.modal-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 15px;
    background: var(--bg-app);
    overflow-y: auto;
    scrollbar-width: thin;
}

.m-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}

.m-card-title {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.h-green {
    color: #10b981;
}

.h-blue {
    color: #3b82f6;
}

.h-orange {
    color: #f59e0b;
}

.h-blue-alt {
    color: #6366f1;
}

.m-input-group {
    margin-bottom: 10px;
}

.m-input-group label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.m-input-group input,
.m-input-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--bg-card);
    color: var(--text-main);
}

.m-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.modal-footer-btns {
    padding: 12px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-confirm {
    background: #10b981;
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-cancel {
    background: #f1f5f9;
    color: #64748b;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Dark Mode Overrides for new elements */
body.dark-mode .dropdown-trigger,
body.dark-mode .dropdown-options,
body.dark-mode .m-card,
body.dark-mode .m-input-group input,
body.dark-mode .m-input-group select {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-mode .modal-header-main,
body.dark-mode .modal-footer-btns {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .modal-cards-grid {
    background: #0f172a;
}

body.dark-mode .btn-cancel {
    background: #334155;
    color: #cbd5e1;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Delete Modal Styles */
.modal-content.delete-confirm {
    max-width: 380px;
    padding: 40px 30px;
    text-align: center;
    border-radius: 40px;
}

.delete-icon-wrapper {
    width: 80px;
    height: 80px;
    background: #fff1f2;
    color: #e11d48;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 24px;
}

.delete-confirm h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 16px;
}

.delete-confirm p {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 32px;
    padding: 0 10px;
}

.delete-confirm strong {
    color: #0f172a;
    font-weight: 700;
}

.delete-modal-btns {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-delete-full {
    background: #e11d48;
    color: white;
    border: none;
    padding: 18px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 10px 15px -3px rgba(225, 29, 72, 0.3);
}

.btn-delete-full:hover {
    background: #be123c;
    transform: translateY(-2px);
    box-shadow: 0 15px 20px -3px rgba(225, 29, 72, 0.4);
}

.btn-delete-cancel {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    padding: 18px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete-cancel:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Dark Mode for Delete Modal */
body.dark-mode .modal-content.delete-confirm {
    background: #1e293b;
}

body.dark-mode .delete-icon-wrapper {
    background: rgba(225, 29, 72, 0.1);
}

body.dark-mode .delete-confirm h2,
body.dark-mode .delete-confirm strong {
    color: #f1f5f9;
}

body.dark-mode .delete-confirm p {
    color: #94a3b8;
}

body.dark-mode .btn-delete-cancel {
    background: #2d3748;
    color: #cbd5e1;
}

/* Login Page Styles */
.login-page {
    background: #f8fafc;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-family: 'Outfit', sans-serif;
}

.login-container {
    background: white;
    width: 900px;
    height: 550px;
    border-radius: 40px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

.login-sidebar {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    width: 45%;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
}

.login-logo-shield {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    position: relative;
    margin-bottom: 30px;
}

.logo-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #10b981;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border: 2px solid #2563eb;
}

.login-sidebar h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.1;
}

.login-sidebar p {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.6;
}

.login-main {
    flex: 1;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-wrapper h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
}

.subtitle {
    color: #64748b;
    margin-bottom: 40px;
}

.input-group-auth {
    margin-bottom: 24px;
}

.input-group-auth label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.input-with-icon input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    font-family: inherit;
    font-size: 1rem;
    color: #0f172a;
    transition: all 0.2s;
}

.input-with-icon input:focus {
    outline: none;
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.btn-login {
    width: 100%;
    background: #2563eb;
    color: white;
    border: none;
    padding: 18px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    transition: all 0.2s;
}

.btn-login:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.login-error {
    background: #fff1f2;
    color: #e11d48;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle-floating {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* Dark Mode Login */
body.dark-mode.login-page {
    background: #0f172a;
}

body.dark-mode .login-container {
    background: #1e293b;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

body.dark-mode .login-form-wrapper h2 {
    color: #f1f5f9;
}

body.dark-mode .input-with-icon input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-mode .theme-toggle-floating {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

/* Top Nav Redesign */
.logo-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    color: var(--text-main);
    font-size: 1.1rem;
    margin-right: 1.5rem;
}

.logo-top .logo-icon {
    width: 36px;
    height: 36px;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1rem;
    position: relative;
}

.logo-top .logo-icon .logo-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background-color: #10b981;
    /* Green trending */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: white;
    border: 3px solid #ffffff;
}

.user-badge {
    background: #f1f5f9;
    color: #64748b;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.05em;
}

.btn-action.outline {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-main);
    box-shadow: none;
    padding: 8px 16px;
}

.btn-action.outline.green {
    border-color: #10b981;
    color: #10b981;
}

.btn-action.outline.blue {
    border-color: #2563eb;
    color: #2563eb;
}

.btn-action.outline.orange {
    border-color: #f59e0b;
    color: #f59e0b;
}

.btn-action.outline.red {
    border-color: #ef4444;
    color: #ef4444;
}

/* Fix for Dark Mode: Ensure colors are maintained */
body.dark-mode .btn-action.outline {
    background: #1e293b;
}

body.dark-mode .btn-action.outline.green {
    color: #10b981;
    border-color: #10b981;
}

body.dark-mode .btn-action.outline.blue {
    color: #2563eb;
    border-color: #2563eb;
}

body.dark-mode .btn-action.outline.orange {
    color: #f59e0b;
    border-color: #f59e0b;
}

body.dark-mode .btn-action.outline.red {
    color: #ef4444;
    border-color: #ef4444;
}

.logout-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.logout-btn:hover {
    transform: scale(1.1);
}

/* Initial Upload State */
.content-area.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    height: calc(100vh - 70px);
}

.initial-upload-state {
    text-align: center;
    max-width: 500px;
}

.upload-big-icon {
    width: 100px;
    height: 100px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 30px;
}

.initial-upload-state h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 12px;
}

.initial-upload-state p {
    color: #64748b;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.drop-zone {
    border: 2px dashed #e2e8f0;
    border-radius: 24px;
    padding: 40px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.drop-zone:hover {
    border-color: #2563eb;
    background: #f8fafc;
}

.drop-zone.drag-over {
    border-color: #2563eb;
    background: #f1f5f9;
    transform: scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.1);
}

.drop-zone i {
    font-size: 2rem;
    color: #cbd5e1;
}

.drop-zone span {
    font-weight: 700;
    color: #475569;
}

/* Dark Mode Updates */
body.dark-mode .logo-top {
    color: white;
}

body.dark-mode .user-badge {
    background: #334155;
    color: #cbd5e1;
}

body.dark-mode .btn-action.outline {
    background: #1e293b;
    color: #f1f5f9;
    border-color: #334155;
}

body.dark-mode .content-area.empty {
    background: #0f172a;
}

body.dark-mode .initial-upload-state h2 {
    color: white;
}

body.dark-mode .drop-zone {
    border-color: #334155;
}

body.dark-mode .drop-zone:hover {
    background: #1e293b;
}

body.dark-mode .upload-big-icon {
    background: rgba(37, 99, 235, 0.1);
}

/* Main View Dark Mode */
body.dark-mode .client-main-card {
    background: #1e293b;
    border: 1px solid #334155;
}

body.dark-mode .main-info {
    border-color: #334155;
}

body.dark-mode .result-side {
    background: #1e293b;
}

body.dark-mode .client-name,
body.dark-mode .contact-name,
body.dark-mode .item-value,
body.dark-mode .contact-value {
    color: #f1f5f9;
}

body.dark-mode .contact-group {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .contact-group.tel {
    background: rgba(249, 115, 22, 0.05);
}

body.dark-mode .contact-group.email {
    background: rgba(59, 130, 246, 0.05);
}

body.dark-mode .observations textarea {
    background: #0f172a;
    color: #f1f5f9;
    border-color: #334155;
}

body.dark-mode .observations textarea::placeholder {
    color: #475569;
}

body.dark-mode .dropdown-trigger {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-mode .dropdown-options {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

body.dark-mode .dropdown-item:hover {
    background: #334155;
}

body.dark-mode .dropdown-item .option-text {
    color: #f1f5f9;
}

body.dark-mode .nav-arrow,
body.dark-mode .page-indicator {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-mode .round-btn.grey {
    background: #334155;
    color: #cbd5e1;
}

body.dark-mode .status-pill {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

.hidden-input {
    display: none !important;
}

/* Side Actions Layout */
.side-actions-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
}

.main-side-actions {
    display: flex;
    gap: 1rem;
}

.text-btn.highlight {
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.text-btn.highlight:hover {
    background: var(--primary);
    color: white;
}

.text-btn.blue-btn {
    color: #2563eb;
    background: #eff6ff;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.text-btn.blue-btn:hover {
    background: #2563eb;
    color: white;
}

/* Export Buttons Redesign */
/* Export Pill Bar Redesign */
.export-pill {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 40px;
    padding: 3px 3px 3px 15px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-top: 10px;
}

.export-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-right: 15px;
}

.stat-group {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.stat-group:hover {
    transform: scale(1.05);
}

.stat-group.stat-success:hover i,
.stat-group.stat-success:hover span {
    color: #10b981;
}

.stat-group.stat-warning:hover i,
.stat-group.stat-warning:hover span {
    color: #f59e0b;
}

.stat-group.stat-danger:hover i,
.stat-group.stat-danger:hover span {
    color: #ef4444;
}

.stat-group i {
    font-size: 1.1rem;
    color: #cbd5e1;
    /* Very light grey as in the image */
}

.stat-group span {
    font-size: 1.05rem;
    font-weight: 800;
    color: #cbd5e1;
}

/* History Section */
.history-section {
    margin-top: 2rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.history-item {
    padding: 1rem;
    background: white;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.history-date {
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.75rem;
}

.history-status {
    font-weight: 800;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.history-status.pendiente {
    background: #fef9c3;
    color: #854d0e;
}

.history-status.procesado {
    background: #dcfce7;
    color: #166534;
}

.history-status.descartado {
    background: #fee2e2;
    color: #991b1b;
}

.history-summary {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.history-notes {
    color: #64748b;
    line-height: 1.4;
    font-style: italic;
    padding-left: 8px;
    border-left: 2px solid #e2e8f0;
}

/* Dark Mode for History */
body.dark-mode .history-item {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .history-summary {
    color: #f1f5f9;
}

body.dark-mode .history-notes {
    color: #94a3b8;
    border-left-color: #334155;
}

.export-all-pill {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 10px 24px;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.export-all-pill:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

body.dark-mode .export-pill {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

body.dark-mode .stat-group span {
    color: #cbd5e1;
}

body.dark-mode .export-all-pill {
    background: #3b82f6;
}


body.dark-mode .export-btn.pendiente {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border-color: #d97706;
}

body.dark-mode .export-btn.descartado {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: #b91c1c;
}

body.dark-mode .export-btn.procesado {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: #047857;
}

/* New Delete Modal UI */
.delete-confirm-ui {
    max-width: 400px !important;
    border-radius: 40px !important;
    padding: 40px 30px !important;
    text-align: center;
}

.delete-icon-wrapper-new {
    width: 80px;
    height: 80px;
    background: #fff5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.delete-icon-wrapper-new i {
    font-size: 32px;
    color: #e11d48;
}

.delete-confirm-ui h2 {
    font-size: 1.75rem;
    color: #0f172a;
    margin-bottom: 20px;
    font-weight: 800;
}

.delete-confirm-ui p {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 32px;
}

.delete-confirm-ui p strong {
    color: #1e293b;
    font-weight: 700;
}

.delete-modal-btns-new {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-delete-confirm-new {
    background: #e11d48;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(225, 29, 72, 0.4);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-delete-confirm-new:hover {
    transform: translateY(-2px);
    background: #be123c;
    box-shadow: 0 12px 24px -5px rgba(225, 29, 72, 0.5);
}

.btn-delete-cancel-new {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    padding: 16px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-delete-cancel-new:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Dark mode adjustments for delete modal */
body.dark-mode .delete-confirm-ui {
    background: #1e293b !important;
}

body.dark-mode .delete-confirm-ui h2 {
    color: white;
}

body.dark-mode .delete-confirm-ui p {
    color: #94a3b8;
}

body.dark-mode .delete-confirm-ui p strong {
    color: #e2e8f0;
}

body.dark-mode .delete-icon-wrapper-new {
    background: rgba(225, 29, 72, 0.1);
}

body.dark-mode .btn-delete-cancel-new {
    background: #334155;
    color: #94a3b8;
}

body.dark-mode .btn-delete-cancel-new:hover {
    background: #475569;
    color: #f1f5f9;
}

/* Premium Modal Layout */
.modal-content.large {
    max-width: 1000px !important;
    width: 95% !important;
    border-radius: 40px !important;
    padding: 30px !important;
    background: #f8fafc;
}

.modal-premium-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 25px;
    margin-top: 10px;
}


.m-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.m-group {
    background: white;
    padding: 20px;
    border-radius: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.m-group.full-height {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.m-label-blue {
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.m-label-grey {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
}

.inline-input-large {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    transition: all 0.2s;
}

.inline-input-large:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Gestiones Mini Breakdown Styles */
.gestiones-mini-breakdown {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.mini-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    padding: 8px;
    border-radius: 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.mini-item:hover {
    transform: translateY(-2px);
    filter: brightness(0.95);
}

.mini-item i {
    font-size: 1.1rem;
}

.mini-item span {
    font-size: 0.9rem;
    font-weight: 800;
}

.mini-item.green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.mini-item.orange {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.mini-item.red {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

body.dark-mode .gestiones-mini-breakdown {
    border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .mini-item.green {
    background: rgba(16, 185, 129, 0.15);
}

body.dark-mode .mini-item.orange {
    background: rgba(245, 158, 11, 0.15);
}

body.dark-mode .mini-item.red {
    background: rgba(239, 68, 68, 0.15);
}

.export-all-sidebar {
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.export-all-sidebar:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

body.dark-mode .export-all-sidebar {
    background: #3b82f6;
}

body.dark-mode .export-all-sidebar:hover {
    background: #2563eb;
}



.m-static-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
}

.inline-input-grey {
    width: 100%;
    padding: 10px 15px;
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 600;
}

.inline-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    font-weight: 600;
}

.mt-10 {
    margin-top: 10px;
}

/* Themed Cards */
.m-card-phone {
    background: #fffaf5;
    border: 1px solid #fed7aa;
    padding: 20px;
    border-radius: 24px;
}

.m-label-orange {
    color: #f97316;
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.m-card-email {
    background: #f5faff;
    border: 1px solid #bfe0ff;
    padding: 20px;
    border-radius: 24px;
}

.m-label-blue-alt {
    color: #0ea5e9;
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.m-input-pair {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.m-input-pair label {
    font-size: 0.6rem;
    font-weight: 800;
    color: #94a3b8;
    margin-bottom: 4px;
    margin-left: 4px;
    text-transform: uppercase;
}

.m-input-pair input {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-weight: 600;
}

/* Results Column */
.m-label-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.m-header-btns {
    display: flex;
    gap: 15px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #94a3b8;
}

.m-header-btns span {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.inline-select-large {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    font-weight: 600;
    color: #475569;
}

.m-textarea-blue {
    width: 100%;
    flex-grow: 1;
    border: 2px solid #60a5fa;
    border-radius: 24px;
    padding: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.6;
    color: #1e293b;
    resize: none;
    background: white;
}

/* Modal Footer Footer */
.modal-footer-btns-premium {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-save-premium {
    background: #2563eb;
    color: white;
    border: none;
    padding: 18px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1rem;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
    transition: all 0.2s;
}

.btn-save-premium:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.btn-cancel-premium {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    padding: 14px;
    border-radius: 20px;
    font-weight: 800;
    cursor: pointer;
}

body.dark-mode .m-group,
body.dark-mode .m-static-text,
body.dark-mode .inline-input-large,
body.dark-mode .inline-select,
body.dark-mode .inline-input-grey,
body.dark-mode .m-textarea-blue {
    background: #1e293b;
    color: #f1f5f9;
    border-color: #334155;
}

body.dark-mode .modal-content.large {
    background: #0f172a;
}

/* Inline Edit Mode Styles - COMPACT */
.edit-premium-container {
    background: #f8fafc;
    border-radius: 32px;
    padding: 15px 20px;
    margin-top: 5px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.edit-header {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edit-header .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-header .header-icon.blue {
    width: 32px;
    height: 32px;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9rem;
}

.edit-header h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
}

/* Compact Grid Overrides */
.edit-premium-container .modal-premium-grid {
    gap: 12px;
    margin-top: 0;
}

.edit-premium-container .m-column {
    gap: 10px;
}

.edit-premium-container .m-group {
    padding: 12px;
    border-radius: 16px;
}

.edit-premium-container .m-card-phone,
.edit-premium-container .m-card-email {
    padding: 12px;
    border-radius: 16px;
}

.edit-premium-container .inline-input-large {
    padding: 8px 12px;
    font-size: 0.95rem;
    border-radius: 10px;
}

.edit-premium-container .m-static-text {
    font-size: 0.9rem;
}

.edit-premium-container .inline-input-grey,
.edit-premium-container .inline-select,
.edit-premium-container .inline-select-large {
    padding: 6px 10px;
    font-size: 0.85rem;
    border-radius: 8px;
}

.edit-premium-container .m-textarea-blue {
    height: 100px !important;
    min-height: 100px;
    padding: 10px;
    font-size: 0.85rem;
}

.edit-footer-btns {
    margin-top: 15px;
    display: flex;
    flex-direction: row;
    /* Horizontal buttons for space */
    gap: 10px;
}

.edit-footer-btns .btn-save-premium,
.edit-footer-btns .btn-cancel-premium {
    padding: 10px;
    font-size: 0.85rem;
    border-radius: 12px;
    margin: 0;
}

.edit-footer-btns .btn-save-premium {
    flex: 2;
}

.edit-footer-btns .btn-cancel-premium {
    flex: 1;
}

body.dark-mode .edit-premium-container {
    background: #0f172a;
}

body.dark-mode .edit-header h2 {
    color: white;
}

body.dark-mode .edit-header .header-icon.blue {
    background: rgba(37, 99, 235, 0.1);
}

/* Body-Editing Compact Overrides */
body.body-editing .quick-stats,
body.body-editing .sidebar-header,
body.body-editing .user-badge {
    display: none !important;
}

body.body-editing .main-header {
    height: 45px;
    padding: 0 15px;
}

body.body-editing .nav-right button {
    padding: 4px 10px;
    font-size: 0.7rem;
}

body.body-editing .content-area {
    padding: 5px 10px;
}

body.body-editing .edit-premium-container {
    padding: 8px 12px;
    border-radius: 20px;
}

/* Extra Tight Form Gaps */
body.body-editing .modal-premium-grid {
    gap: 8px;
    margin-top: 0;
}

body.body-editing .m-column {
    gap: 6px;
}

body.body-editing .m-group {
    padding: 6px 10px;
    border-radius: 10px;
}

body.body-editing .m-card-phone,
body.body-editing .m-card-email {
    padding: 8px;
    border-radius: 10px;
}

body.body-editing .m-label-blue,
body.body-editing .m-label-orange,
body.body-editing .m-label-blue-alt,
body.body-editing .m-label-grey {
    margin-bottom: 4px;
    font-size: 0.6rem;
}

body.body-editing .m-input-pair {
    margin-bottom: 4px;
}

body.body-editing .m-input-pair label {
    font-size: 0.5rem;
    margin-bottom: 1px;
}

body.body-editing .edit-footer-btns {
    margin-top: 8px;
}

body.body-editing .m-textarea-blue {
    height: 80px !important;
    min-height: 80px;
}

/* NIF Search Tool Styles */
.m-label-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    width: 100%;
}

.nif-search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.btn-nif-search {
    font-size: 0.6rem;
    font-weight: 800;
    color: #6366f1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f5f3ff;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-nif-search:hover {
    background: #e0e7ff;
    color: #4338ca;
}

.nif-search-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    width: 220px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    padding: 6px;
    margin-top: 5px;
    border: 1px solid #e2e8f0;
}

.nif-search-menu div {
    padding: 8px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.nif-search-menu div:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.nif-search-menu div i {
    width: 14px;
    text-align: center;
    color: #94a3b8;
}

body.dark-mode .nif-search-menu {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

body.dark-mode .nif-search-menu div {
    color: #cbd5e1;
}

body.dark-mode .nif-search-menu div:hover {
    background: #334155;
    color: #60a5fa;
}

body.dark-mode .btn-nif-search {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
}

/* =====================================================
   NEW CONTACT MODAL STYLES
   ===================================================== */
.new-contact-modal {
    max-width: 680px !important;
    width: 92% !important;
    border-radius: 24px !important;
    padding: 0 !important;
    background: #f4f6f9;
    overflow: hidden;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
}

.nc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: white;
    border-bottom: 1px solid #e8ecf1;
}

.nc-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nc-icon {
    width: 36px;
    height: 36px;
    background: #f0fdf4;
    color: #16a34a;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.nc-header h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1e293b;
}

.nc-close {
    font-size: 1.6rem;
    cursor: pointer;
    color: #94a3b8;
    line-height: 1;
    transition: color 0.2s;
}

.nc-close:hover {
    color: #475569;
}

.nc-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nc-grid-top,
.nc-grid-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.nc-card {
    background: white;
    border: 1px solid #e8ecf1;
    border-radius: 16px;
    padding: 18px;
}

.nc-card-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.nc-card-title.green {
    color: #16a34a;
}

.nc-card-title.orange {
    color: #ea580c;
}

.nc-card-title.blue {
    color: #2563eb;
}

.nc-field {
    margin-bottom: 10px;
}

.nc-field:last-child {
    margin-bottom: 0;
}

.nc-field label {
    display: block;
    font-size: 0.62rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.nc-field input,
.nc-field select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #1e293b;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Outfit', sans-serif;
}

.nc-field input:focus,
.nc-field select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.nc-field input::placeholder {
    color: #cbd5e1;
    font-weight: 400;
}

.nc-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.nc-field-row:last-child {
    margin-bottom: 0;
}

.nc-field-row .nc-field {
    margin-bottom: 0;
}

.nc-footer {
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    background: white;
    border-top: 1px solid #e8ecf1;
}

.nc-btn-submit {
    flex: 1;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    letter-spacing: 0.03em;
    box-shadow: 0 6px 16px -3px rgba(22, 163, 74, 0.35);
    transition: all 0.2s;
}

.nc-btn-submit:hover {
    background: linear-gradient(135deg, #15803d, #166534);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -3px rgba(22, 163, 74, 0.4);
}

.nc-btn-cancel {
    flex: 1;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 14px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
}

.nc-btn-cancel:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Dark Mode - New Contact Modal */
body.dark-mode .new-contact-modal {
    background: #0f172a;
}

body.dark-mode .nc-header {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .nc-header h2 {
    color: #f1f5f9;
}

body.dark-mode .nc-icon {
    background: rgba(22, 163, 74, 0.1);
}

body.dark-mode .nc-close {
    color: #64748b;
}

body.dark-mode .nc-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .nc-card-title {
    border-bottom-color: #334155;
}

body.dark-mode .nc-field input,
body.dark-mode .nc-field select {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-mode .nc-field input::placeholder {
    color: #475569;
}

body.dark-mode .nc-footer {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .nc-btn-cancel {
    background: #334155;
    color: #94a3b8;
    border-color: #475569;
}



body.dark-mode #currentStatusText {
    color: #f1f5f9 !important;
}

body.dark-mode .current-status-title {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(30, 41, 59, 0.5)) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
}