/* ==========================================================================
   SISTEMA DE DISEÑO - ARKADIA CRM (AGENCIA DE PUBLICIDAD & 3D)
   Estilo Premium con Estética Glassmorphism, Neón y Parallax 3D
   ========================================================================== */

/* Variables del Sistema de Diseño */
:root {
    --bg-color: #05020a;
    --bg-darker: #020005;
    --bg-sidebar: rgba(10, 5, 20, 0.7);
    --text-color: #f8f7fa;
    --text-muted: #a39fb4;
    
    /* Colores de Acento (Neón) */
    --primary-color: #8b2cf5;
    --primary-glow: rgba(139, 44, 245, 0.4);
    --secondary-color: #00f0ff;
    --secondary-glow: rgba(0, 240, 255, 0.4);
    --accent-color: #ff007f;
    --accent-glow: rgba(255, 0, 127, 0.4);
    --success-color: #39ff14; /* Cyber Verde */
    --success-glow: rgba(57, 255, 20, 0.4);
    
    /* Vidrio Templado (Glassmorphism) */
    --card-bg: rgba(13, 8, 24, 0.45);
    --card-bg-hover: rgba(22, 14, 38, 0.65);
    --card-border: rgba(255, 255, 255, 0.05);
    --card-border-hover: rgba(0, 240, 255, 0.3);
    
    /* Tipografías */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;
    
    /* Transiciones */
    --transition-fast: 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-smooth: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-slow: 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset y Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-color);
    overflow-x: hidden;
    width: 100%;
}

body {
    background: radial-gradient(circle at 50% 50%, #150a2b 0%, var(--bg-color) 70%);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* Canvas de Fondo e Interacciones */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
    opacity: 0.08;
}

/* Cursor Personalizado */
.custom-cursor-dot, .custom-cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: width 0.3s, height 0.3s, background-color 0.3s, border-color 0.3s;
    display: none;
}

@media (pointer: fine) {
    .custom-cursor-dot {
        display: block;
        width: 8px;
        height: 8px;
        background-color: var(--secondary-color);
        box-shadow: 0 0 10px var(--secondary-color);
    }
    
    .custom-cursor-outline {
        display: block;
        width: 35px;
        height: 35px;
        border: 1px solid rgba(0, 240, 255, 0.4);
        box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
    }
    
    body.cursor-hover .custom-cursor-dot {
        width: 12px;
        height: 12px;
        background-color: var(--accent-color);
        box-shadow: 0 0 15px var(--accent-color);
    }
    
    body.cursor-hover .custom-cursor-outline {
        width: 50px;
        height: 50px;
        border-color: var(--accent-color);
        background-color: rgba(255, 0, 127, 0.05);
        box-shadow: 0 0 25px rgba(255, 0, 127, 0.2);
    }
}

/* ==========================================================================
   ESTILOS COMPONENTES GLASSMORPHISM & BOTONES
   ========================================================================== */

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition-smooth), background-color var(--transition-smooth), transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.glass-card:hover {
    background: var(--card-bg-hover);
    border-color: var(--card-border-hover);
    box-shadow: 0 15px 35px rgba(0, 240, 255, 0.08), 0 0 25px rgba(139, 44, 245, 0.05);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(255, 255, 255, 0.06), transparent 40%);
    pointer-events: none;
    z-index: 1;
}

.gradient-text {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 50%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.highlight-cyan { color: var(--secondary-color); text-shadow: 0 0 10px var(--secondary-glow); }
.highlight-purple { color: #b26eff; text-shadow: 0 0 10px var(--primary-glow); }
.highlight-pink { color: var(--accent-color); text-shadow: 0 0 10px var(--accent-glow); }
.highlight-green { color: var(--success-color); text-shadow: 0 0 10px var(--success-glow); }

/* Botones Premium */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 30px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    outline: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: rgba(139, 44, 245, 0.15);
    color: #ffffff;
    border: 2px solid #a453f7;
    box-shadow: 0 0 15px rgba(139, 44, 245, 0.5), inset 0 0 8px rgba(139, 44, 245, 0.2);
    text-shadow: 0 0 5px var(--primary-color);
}
.btn-primary:hover {
    background: rgba(139, 44, 245, 0.25);
    border-color: #b26eff;
    box-shadow: 0 0 25px rgba(139, 44, 245, 0.85), inset 0 0 12px rgba(139, 44, 245, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 0, 127, 0.15);
    color: #ffffff;
    border: 2px solid #ff33aa;
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.5), inset 0 0 8px rgba(255, 0, 127, 0.2);
    text-shadow: 0 0 5px var(--accent-color);
}
.btn-secondary:hover {
    background: rgba(255, 0, 127, 0.25);
    border-color: #ff5ebc;
    box-shadow: 0 0 25px rgba(255, 0, 127, 0.85), inset 0 0 12px rgba(255, 0, 127, 0.4);
    transform: translateY(-2px);
}

.btn-outline {
    background: rgba(0, 240, 255, 0.1);
    color: #ffffff;
    border: 2px solid #33f5ff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4), inset 0 0 8px rgba(0, 240, 255, 0.2);
    text-shadow: 0 0 5px var(--secondary-color);
}
.btn-outline:hover {
    background: rgba(0, 240, 255, 0.2);
    border-color: #80f9ff;
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.75), inset 0 0 12px rgba(0, 240, 255, 0.45);
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1rem;
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   VISTA DE LOGIN (PANTALLA COMPLETA)
   ========================================================================== */

#login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background: radial-gradient(circle at 50% 50%, #150a2b 0%, #030107 80%);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.login-card {
    width: 100%;
    max-width: 450px;
    padding: 3rem 2.5rem;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
}

.login-logo {
    margin-bottom: 2rem;
}
.login-logo .logo-txt {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 2px;
}
.login-logo .logo-subtxt {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 6px;
    margin-top: 4px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    width: 18px;
    height: 18px;
}

.form-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--secondary-color);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
}

.login-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 14px;
    border-radius: 12px;
}

.login-error {
    color: var(--accent-color);
    font-size: 0.85rem;
    margin-top: 1rem;
    text-shadow: 0 0 5px var(--accent-glow);
    display: none;
}

/* ==========================================================================
   ESTRUCTURA PRINCIPAL (SIDEBAR + CONTENIDO)
   ========================================================================== */

#app-container {
    display: flex;
    min-height: 100vh;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
    height: 100vh;
    overflow: hidden;
}

#app-container.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Barra Lateral (Sidebar) */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-smooth);
    flex-shrink: 0;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
}

.sidebar-logo .logo-main {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 1px;
}

.sidebar-logo .logo-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    border: 1px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-color);
}

.nav-item.active {
    background: rgba(139, 44, 245, 0.08);
    border-color: rgba(139, 44, 245, 0.25);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(139, 44, 245, 0.15), inset 0 0 6px rgba(139, 44, 245, 0.1);
}

.nav-item.active i {
    color: var(--secondary-color);
    filter: drop-shadow(0 0 5px var(--secondary-glow));
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 0 10px var(--primary-glow);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.btn-logout:hover {
    color: var(--accent-color);
}

/* Área de Contenido Principal */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Barra Superior (Header de App) */
.main-header {
    height: 70px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    backdrop-filter: blur(10px);
    z-index: 10;
    background: rgba(5, 2, 10, 0.4);
}

.header-title-container h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.control-badge {
    position: relative;
    cursor: pointer;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-color);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    box-shadow: 0 0 8px var(--accent-color);
}

.header-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    border-left: 1px solid var(--card-border);
    padding-left: 1.5rem;
}

/* Workspace de Vistas */
.view-workspace {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.app-view {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity var(--transition-smooth), transform var(--transition-smooth);
}

.app-view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   VISTA 1: DASHBOARD
   ========================================================================== */

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

.metric-card {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-data {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.metric-value {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.metric-trend {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up { color: var(--success-color); }
.trend-down { color: var(--accent-color); }

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
}

.metric-icon.purple { background: rgba(139, 44, 245, 0.1); color: var(--primary-color); border: 1px solid rgba(139, 44, 245, 0.25); }
.metric-icon.cyan { background: rgba(0, 240, 255, 0.1); color: var(--secondary-color); border: 1px solid rgba(0, 240, 255, 0.25); }
.metric-icon.pink { background: rgba(255, 0, 127, 0.1); color: var(--accent-color); border: 1px solid rgba(255, 0, 127, 0.25); }
.metric-icon.green { background: rgba(57, 255, 20, 0.1); color: var(--success-color); border: 1px solid rgba(57, 255, 20, 0.25); }

/* Layout del Dashboard */
.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.three-container-card {
    height: 450px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.card-header-actions {
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    z-index: 2;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
}

.card-title i {
    margin-right: 8px;
    color: var(--secondary-color);
}

.three-canvas-wrapper {
    flex: 1;
    position: relative;
    outline: none;
}

.three-canvas-instructions {
    position: absolute;
    bottom: 1.2rem;
    left: 1.5rem;
    background: rgba(5, 2, 10, 0.7);
    border: 1px solid var(--card-border);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
    backdrop-filter: blur(5px);
    z-index: 2;
    pointer-events: none;
}

.activities-card {
    display: flex;
    flex-direction: column;
    max-height: 450px;
}

.activity-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.activity-item {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    align-items: flex-start;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}
.dot-purple { background: var(--primary-color); box-shadow: 0 0 8px var(--primary-color); }
.dot-cyan { background: var(--secondary-color); box-shadow: 0 0 8px var(--secondary-color); }
.dot-pink { background: var(--accent-color); box-shadow: 0 0 8px var(--accent-color); }

.activity-details {
    flex: 1;
}

.activity-text {
    color: var(--text-color);
}

.activity-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==========================================================================
   VISTA 2: PIPELINE KANBAN (LEADS / PROSPECTOS)
   ========================================================================== */

.pipeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.pipeline-board {
    display: flex;
    gap: 1.2rem;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 1.5rem;
    width: 100%;
}

.pipeline-column {
    background: rgba(13, 8, 24, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 1rem 0.8rem;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
    flex: 0 0 280px;
}

.pipeline-column.drag-over {
    background: rgba(139, 44, 245, 0.05);
    border-color: var(--primary-color);
}

.column-header-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.column-header:hover .column-header-actions {
    opacity: 1;
}

.column-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.column-action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.column-action-btn.delete:hover {
    color: var(--accent-color);
    background: rgba(255, 0, 127, 0.1);
}

.add-column-card {
    flex: 0 0 280px;
    height: 120px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    background: rgba(13, 8, 24, 0.15);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    transition: border-color var(--transition-smooth), background-color var(--transition-smooth), color var(--transition-smooth), box-shadow var(--transition-smooth);
    margin-top: 5px;
}

.add-column-card:hover {
    border-color: var(--secondary-color);
    background: rgba(0, 240, 255, 0.03);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.05);
}

.add-column-card i {
    font-size: 1.4rem;
    color: var(--secondary-color);
    filter: drop-shadow(0 0 6px var(--secondary-glow));
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 6px 10px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 0.4rem;
}

.column-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.column-badge {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.lead-card {
    padding: 1.2rem;
    cursor: grab;
    user-select: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.lead-card:active {
    cursor: grabbing;
}

.lead-card.dragging {
    opacity: 0.4;
    border-color: var(--secondary-color);
    transform: scale(0.96);
}

.lead-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.lead-name {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.lead-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.lead-company {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.lead-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 8px;
}

.lead-tag {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.tag-meta { background: rgba(0, 240, 255, 0.1); color: var(--secondary-color); border: 1px solid rgba(0, 240, 255, 0.2); }
.tag-google { background: rgba(255, 0, 127, 0.1); color: var(--accent-color); border: 1px solid rgba(255, 0, 127, 0.2); }
.tag-branding { background: rgba(139, 44, 245, 0.1); color: var(--primary-color); border: 1px solid rgba(139, 44, 245, 0.2); }
.tag-web { background: rgba(57, 255, 20, 0.1); color: var(--success-color); border: 1px solid rgba(57, 255, 20, 0.2); }

.lead-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================================
   VISTA 3: CAMPAÑAS PUBLICITARIAS
   ========================================================================== */

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: rgba(13, 8, 24, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: #ffffff;
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--transition-fast);
}

.search-input:focus {
    border-color: var(--secondary-color);
}

.filter-options {
    display: flex;
    gap: 0.8rem;
}

.filter-select {
    padding: 8px 12px;
    background: rgba(13, 8, 24, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text-color);
    outline: none;
    cursor: pointer;
    font-family: var(--font-body);
}

.campaigns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.campaign-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.campaign-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.campaign-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
}

.campaign-client {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.campaign-status {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-active { background: rgba(57, 255, 20, 0.12); color: var(--success-color); border: 1px solid rgba(57, 255, 20, 0.25); }
.status-paused { background: rgba(0, 240, 255, 0.12); color: var(--secondary-color); border: 1px solid rgba(0, 240, 255, 0.25); }
.status-draft { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); border: 1px solid rgba(255, 255, 255, 0.12); }
.status-completed { background: rgba(139, 44, 245, 0.12); color: #c084fc; border: 1px solid rgba(139, 44, 245, 0.25); }

.campaign-budget-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.budget-val {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    margin-top: 2px;
}

.campaign-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.progress-bar-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    width: 0;
    transition: width 1s ease-out;
}

.campaign-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 12px;
}

.metric-mini-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.metric-mini-val {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 2px;
}

.campaign-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.platform-icons {
    display: flex;
    gap: 8px;
}

.platform-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.platform-icon.active {
    color: #ffffff;
    background: rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.3);
}

/* ==========================================================================
   VISTA 4: BOVEDA CREATIVA
   ========================================================================== */

.creative-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.creative-card {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.creative-preview-container {
    height: 180px;
    position: relative;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
}

.creative-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.creative-placeholder i {
    font-size: 2.2rem;
    color: var(--primary-color);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.creative-body {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex: 1;
}

.creative-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
}

.creative-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.creative-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 10px;
    margin-top: auto;
}

.creative-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.creative-badge.approved { background: rgba(57, 255, 20, 0.1); color: var(--success-color); border: 1px solid rgba(57, 255, 20, 0.2); }
.creative-badge.pending { background: rgba(0, 240, 255, 0.1); color: var(--secondary-color); border: 1px solid rgba(0, 240, 255, 0.2); }
.creative-badge.rejected { background: rgba(255, 0, 127, 0.1); color: var(--accent-color); border: 1px solid rgba(255, 0, 127, 0.2); }

.creative-actions {
    display: flex;
    gap: 6px;
}

.btn-mini {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.btn-mini:hover {
    color: #ffffff;
}

.btn-mini.approve:hover {
    background: rgba(57, 255, 20, 0.15);
    border-color: var(--success-color);
    color: var(--success-color);
    box-shadow: 0 0 10px var(--success-glow);
}

.btn-mini.reject:hover {
    background: rgba(255, 0, 127, 0.15);
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* ==========================================================================
   VISTA 5: TAREAS (PLANNER DEL EQUIPO)
   ========================================================================== */

.planner-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.planner-menu {
    padding: 1.2rem;
}

.planner-menu-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.planner-roles {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.role-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.role-btn:hover {
    background: rgba(255, 255, 255, 0.02);
    color: #ffffff;
}

.role-btn.active {
    background: rgba(0, 240, 255, 0.08);
    color: var(--secondary-color);
}

.role-color-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.dot-designer { background: var(--accent-color); box-shadow: 0 0 8px var(--accent-color); }
.dot-copy { background: #ffaa00; box-shadow: 0 0 8px #ffaa00; }
.dot-buyer { background: var(--secondary-color); box-shadow: 0 0 8px var(--secondary-color); }
.dot-developer { background: var(--primary-color); box-shadow: 0 0 8px var(--primary-color); }

.tasks-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-item-card {
    padding: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.task-item-card:hover {
    transform: translateX(4px);
}

.task-main-info {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
}

.task-checkbox-container {
    margin-top: 3px;
    position: relative;
    cursor: pointer;
}

.task-checkbox-input {
    display: none;
}

.task-checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all var(--transition-fast);
}

.task-checkbox-input:checked + .task-checkbox-custom {
    background: var(--success-color);
    border-color: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
}

.task-checkbox-input:checked + .task-checkbox-custom i {
    display: block;
}

.task-checkbox-custom i {
    display: none;
    font-size: 0.65rem;
    color: #000000;
}

.task-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.task-checkbox-input:checked ~ .task-content .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-sub-details {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.task-assignee {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-priority-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
}

.priority-high { background: rgba(255, 0, 127, 0.12); color: var(--accent-color); border: 1px solid rgba(255, 0, 127, 0.2); }
.priority-medium { background: rgba(255, 170, 0, 0.12); color: #ffaa00; border: 1px solid rgba(255, 170, 0, 0.2); }
.priority-low { background: rgba(0, 240, 255, 0.12); color: var(--secondary-color); border: 1px solid rgba(0, 240, 255, 0.2); }

.task-actions {
    display: flex;
    gap: 8px;
}

/* ==========================================================================
   VISTA 6: FINANZAS & FACTURAS
   ========================================================================== */

.finance-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    align-items: start;
}

.finance-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Tarjeta de Crédito 3D interactiva */
.premium-card-3d-wrapper {
    perspective: 1000px;
    width: 100%;
}

.premium-card-3d {
    height: 200px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(20, 10, 35, 0.8) 0%, rgba(5, 2, 10, 0.9) 100%);
    border: 1px solid rgba(0, 240, 255, 0.25);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 44, 245, 0.2);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform var(--transition-fast) ease-out;
}

.premium-card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--card-tilt-x, 50%) var(--card-tilt-y, 50%), rgba(0, 240, 255, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.card-3d-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-3d-logo {
    display: flex;
    flex-direction: column;
}

.card-3d-logo span {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.card-3d-chip {
    width: 40px;
    height: 30px;
    background: linear-gradient(135deg, #ffd700, #b8860b);
    border-radius: 6px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.3);
}

.card-3d-number {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    letter-spacing: 3px;
    margin: 1.5rem 0 1rem 0;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.card-3d-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

.card-label {
    text-transform: uppercase;
    color: var(--text-muted);
    font-size: 0.65rem;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.card-holder, .card-expiry {
    font-weight: 600;
    text-transform: uppercase;
}

.finance-stats {
    padding: 1.5rem;
}

.finance-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.finance-stat-row:last-child {
    border-bottom: none;
}

.finance-stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.finance-stat-val {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
}

/* Tabla de Facturas */
.invoices-card {
    padding: 1.5rem;
}

.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.invoice-table th {
    padding: 12px 16px;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.invoice-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.invoice-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.invoice-status-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.invoice-paid { background: rgba(57, 255, 20, 0.12); color: var(--success-color); border: 1px solid rgba(57, 255, 20, 0.25); }
.invoice-pending { background: rgba(0, 240, 255, 0.12); color: var(--secondary-color); border: 1px solid rgba(0, 240, 255, 0.25); }
.invoice-overdue { background: rgba(255, 0, 127, 0.12); color: var(--accent-color); border: 1px solid rgba(255, 0, 127, 0.25); }

/* ==========================================================================
   MODALES (GLASSMORPHISM POPUP)
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 0, 5, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.modal-card {
    width: 100%;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(139, 44, 245, 0.15);
    border: 1px solid rgba(139, 44, 245, 0.25);
    transform: scale(0.95) translateY(15px);
    transition: transform var(--transition-smooth);
}

.modal-backdrop.active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: color var(--transition-fast);
}

.btn-close-modal:hover {
    color: var(--accent-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px !important;
}

.form-textarea {
    resize: none;
}

/* ==========================================================================
   ANIMACIONES CLAVE
   ========================================================================== */

.anim-spin {
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Media Queries Responsivas */
@media (max-width: 992px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .finance-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
    }
    .sidebar-header {
        padding: 1.2rem;
    }
    .sidebar-nav {
        flex-direction: row;
        padding: 0.5rem;
        overflow-x: auto;
        height: auto;
        gap: 6px;
    }
    .nav-item {
        padding: 8px 12px;
        white-space: nowrap;
    }
    .sidebar-footer {
        display: none;
    }
    .main-header {
        padding: 0 1.2rem;
    }
    .view-workspace {
        padding: 1.2rem;
    }
    .pipeline-board {
        gap: 0.8rem;
    }
    .planner-layout {
        grid-template-columns: 1fr;
    }
}
