/* ==========================================================================
   Contacto CRM — Hoja de Estilos Premium (Dark Mode & Glassmorphism)
   ========================================================================== */

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

:root {
    /* Tipografía */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Paleta de Colores Dark Premium */
    --bg-app: #090d16;
    --bg-sidebar: #0f1524;
    --bg-card: rgba(22, 30, 49, 0.7);
    --bg-card-hover: rgba(30, 41, 67, 0.85);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-focus: rgba(99, 102, 241, 0.4);
    
    /* Colores Principales */
    --color-primary: #6366f1; /* Indigo */
    --color-primary-hover: #4f46e5;
    --color-secondary: #22d3ee; /* Cyan */
    --color-whatsapp: #25d366; /* Verde WA */
    --color-whatsapp-hover: #20ba5a;
    
    /* Estados Semánticos */
    --color-success: #10b981; /* Emerald */
    --color-danger: #f43f5e; /* Rose */
    --color-warning: #f59e0b; /* Amber */
    --color-info: #3b82f6; /* Blue */
    --color-muted: #64748b; /* Slate-500 */
    
    /* Textos */
    --text-primary: #f8fafc; /* Slate-50 */
    --text-secondary: #94a3b8; /* Slate-400 */
    --text-muted: #64748b; /* Slate-500 */
    
    /* Efectos */
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-inset: inset 0 1px 1px rgba(255, 255, 255, 0.05);
    --blur-glass: blur(16px);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* Transiciones */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 1. Reseteo y Estilos Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
}

body {
    display: flex;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}
a:hover {
    color: var(--color-secondary);
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

/* Scrollbar Personalizado */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* 2. Layout Estructura */
.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
}

/* 3. Sidebar */
.sidebar {
    width: 270px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 100;
    transition: var(--transition-normal);
}

.sidebar-brand {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-glass);
}
.sidebar-brand span {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    padding: 1.5rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
    position: relative;
}
.sidebar-link:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}
.sidebar-link.active {
    color: var(--text-primary);
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), transparent);
    border-left: 3px solid var(--color-primary);
    padding-left: calc(1.25rem - 3px);
}
.sidebar-link .badge {
    margin-left: auto;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.user-info {
    font-size: 0.9rem;
    line-height: 1.2;
}
.user-name {
    font-weight: 600;
    color: var(--text-primary);
}
.user-role {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* 4. Navbar */
.navbar {
    height: 70px;
    background-color: rgba(9, 13, 22, 0.5);
    backdrop-filter: var(--blur-glass);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    z-index: 90;
}

.navbar-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-container {
    position: relative;
    width: 300px;
}
.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition-normal);
}
.search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}
.search-icon-inside {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0f1626;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-premium);
    display: none;
}
.search-results-dropdown.show {
    display: block;
}
.search-result-item {
    padding: 0.75rem 1.25rem;
    display: block;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-glass);
}
.search-result-item:last-child {
    border-bottom: none;
}
.search-result-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

/* 5. Tarjetas y Grid (Glassmorphism) */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--blur-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-premium);
    transition: var(--transition-normal);
}
.card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.grid-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}
.kpi-card.purple .kpi-icon {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}
.kpi-card.cyan .kpi-icon {
    background: rgba(34, 211, 238, 0.1);
    color: var(--color-secondary);
}
.kpi-card.success .kpi-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}
.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}
.kpi-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* 6. Tablas */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th, .table td {
    padding: 1rem 1.25rem;
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-glass);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* 7. Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid transparent;
    outline: none;
    transition: var(--transition-normal);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
    color: white;
    border: none;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary-hover), #7c3aed);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: var(--color-success);
    color: white;
}
.btn-success:hover {
    background: #059669;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}
.btn-danger:hover {
    background: #e11d48;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--border-glass);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

.btn-wa {
    background: var(--color-whatsapp);
    color: white;
}
.btn-wa:hover {
    background: var(--color-whatsapp-hover);
    box-shadow: 0 0 15px rgba(37, 211, 102, 0.4);
}

/* 8. Formularios */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-control, .form-select, .form-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 0.65rem 1rem;
    font-family: var(--font-sans);
    outline: none;
    transition: var(--transition-normal);
}

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

.form-control:focus, .form-select:focus, .form-textarea:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.form-select option {
    background: #0f1626;
    color: var(--text-primary);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.checkbox-group input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
}

/* 9. Badges / Etiquetas */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    line-height: 1;
}

.badge-lead { background: rgba(108, 117, 125, 0.15); color: #a1a1aa; }
.badge-active { background: rgba(34, 211, 238, 0.15); color: var(--color-secondary); }
.badge-customer { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.badge-inactive { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.badge-churned { background: rgba(244, 63, 94, 0.15); color: var(--color-danger); }

.tag-badge {
    background: var(--border-glass);
    border: 1px solid rgba(255,255,255,0.05);
    color: var(--text-secondary);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* 10. Kanban Board */
.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1.5rem;
    align-items: flex-start;
}

.kanban-column {
    min-width: 290px;
    width: 290px;
    background: rgba(22, 30, 49, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 190px);
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-glass);
    margin-bottom: 1rem;
}

.kanban-stage-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kanban-stage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.kanban-stage-count {
    background: rgba(255,255,255,0.06);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.kanban-stage-value {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.kanban-cards-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 150px;
    padding: 0.25rem;
}
.kanban-cards-container.dragover {
    background: rgba(99, 102, 241, 0.05);
    border: 1px dashed var(--color-primary);
    border-radius: var(--radius-md);
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: grab;
    transition: var(--transition-fast);
}
.kanban-card:active {
    cursor: grabbing;
}
.kanban-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(22, 30, 49, 0.85);
}
.kanban-card.dragging {
    opacity: 0.4;
    border: 1px dashed var(--color-primary);
}

.kanban-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.kanban-card-contact {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-glass);
    padding-top: 0.5rem;
    font-size: 0.8rem;
}

.kanban-card-value {
    font-weight: 600;
    color: var(--color-secondary);
}

.kanban-card-date {
    color: var(--text-muted);
}

/* 11. Chat de WhatsApp */
.chat-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    height: calc(100vh - 180px);
}

.conversations-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.conversations-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    font-weight: 600;
}

.conversation-list-item {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-glass);
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition-fast);
}
.conversation-list-item:hover, .conversation-list-item.active {
    background: rgba(255,255,255,0.03);
}
.conversation-list-item.active {
    border-left: 3px solid var(--color-whatsapp);
    padding-left: calc(1.25rem - 3px);
}

.conversation-meta {
    flex: 1;
    overflow: hidden;
}
.conversation-name-time {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.25rem;
}
.conversation-name {
    font-weight: 600;
    font-size: 0.95rem;
}
.conversation-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.conversation-preview {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-box {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.01);
}
.chat-client-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.03), transparent 60%);
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}
.message-wrapper.outbound {
    align-self: flex-end;
}
.message-wrapper.inbound {
    align-self: flex-start;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.message-wrapper.outbound .message-bubble {
    background: #075e54; /* Verde WA Clásico */
    color: white;
    border-top-right-radius: 2px;
}
.message-wrapper.inbound .message-bubble {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-top-left-radius: 2px;
    border: 1px solid var(--border-glass);
}

.message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
    padding: 0 0.25rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}
.message-star-btn {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: var(--transition-fast);
}
.message-star-btn.starred {
    color: var(--color-warning);
}

.chat-input-bar {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-glass);
    background: rgba(255,255,255,0.01);
}

/* 12. Timeline de Actividades */
.timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid var(--border-glass);
    margin-left: 0.5rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}
.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -2.35rem;
    top: 0.25rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    border: 2px solid var(--bg-app);
}
.timeline-item.call .timeline-dot { background: var(--color-info); }
.timeline-item.whatsapp .timeline-dot { background: var(--color-whatsapp); }
.timeline-item.deal_stage_changed .timeline-dot { background: var(--color-primary); }
.timeline-item.deal_won .timeline-dot { background: var(--color-success); }
.timeline-item.deal_lost .timeline-dot { background: var(--color-danger); }
.timeline-item.contact_created .timeline-dot { background: var(--color-success); }

.timeline-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.timeline-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.timeline-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 13. Tareas y Seguimiento */
.task-section-header {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}
.task-item:hover {
    background: var(--bg-card-hover);
}
.task-item.completed {
    opacity: 0.5;
}
.task-item.completed .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.task-details {
    flex: 1;
}

.task-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.task-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.25rem;
}

.priority-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.priority-indicator.urgent { background: var(--color-danger); box-shadow: 0 0 8px var(--color-danger); }
.priority-indicator.high { background: var(--color-danger); }
.priority-indicator.medium { background: var(--color-warning); }
.priority-indicator.low { background: var(--color-success); }

/* 14. Modales */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}
.modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-dialog {
    background: #0f1626;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    width: 500px;
    max-width: 90%;
    box-shadow: var(--shadow-premium);
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform var(--transition-normal);
}
.modal.show .modal-dialog {
    transform: translateY(0);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-close {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

/* 15. Pestañas (Tabs) */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 1.5rem;
}
.tab-item {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
}
.tab-item.active {
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* 16. Alertas */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
}
.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.alert-danger {
    background: rgba(244, 63, 94, 0.15);
    color: var(--color-danger);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

/* 17. Perfil de Contacto 360 y Detalles */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 2.5fr;
    gap: 1.5rem;
}
.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.profile-avatar-block {
    text-align: center;
    padding: 2rem 1rem;
}
.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
}
.profile-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* 18. Pantalla de Login */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #111827 0%, #030712 100%);
}

.login-card {
    width: 400px;
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border-radius: var(--radius-lg);
}

.login-logo {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
}
.login-logo span {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 19. Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}
.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}
