/* ==========================================================================
   CSS Variables & Design Tokens (Premium Proptech Theme)
   ========================================================================== */
   :root {
    /* Colors */
    --primary-dark: #0B132B;       /* Azul marino profundo (Base) */
    --primary: #1C2541;            /* Azul marino medio */
    --accent-gold: #D4AF37;        /* Dorado premium para destacar */
    --accent-green: #2ecc71;       /* Verde para métricas de rentabilidad */
    --accent-red: #e74c3c;         /* Rojo para urgencias (fechas próximas) */
    
    --bg-color: #F4F7F6;           /* Gris muy claro para el fondo */
    --surface: #FFFFFF;            /* Blanco para tarjetas */
    
    --text-main: #2C3E50;
    --text-muted: #7F8C8D;
    
    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Effects */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(11, 19, 43, 0.08);
    --shadow-hover: 0 15px 35px rgba(11, 19, 43, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    
    /* Borders & Radius */
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================================================
   Base Reset & Typography
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    /* Anti-Scraping / Anti-Copy básico transversal */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Permitir selección de texto solo en inputs y campos editables */
input, textarea, select, [contenteditable] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

h1, h2, h3, h4 {
    color: var(--primary-dark);
    font-weight: 700;
}

/* Utilidades */
.text-gold { color: var(--accent-gold); }
.w-100 { width: 100%; }
.mt-2 { margin-top: 1rem; }

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
    background-color: var(--primary-dark);
    padding: 1.2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.logo-accent { color: var(--accent-gold); }

.logo-badge {
    background: var(--accent-gold);
    color: var(--primary-dark);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: top;
    margin-left: 4px;
}

.nav-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    margin: 0 1.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    color: #fff;
}

/* ==========================================================================
   Hamburger Menu & Responsive Nav
   ========================================================================== */
.hamburger-menu {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    fill: white;
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 900px) {
    .navbar { flex-wrap: wrap; padding: 1rem 5%; }
    .hamburger-menu { display: block; }
    .nav-container {
        display: none;
        width: 100%;
        flex-direction: column;
        padding-top: 1.5rem;
        gap: 1.5rem;
        align-items: center;
    }
    .nav-container.active { display: flex; }
    .nav-links {
        display: flex;
        flex-direction: column;
        text-align: center;
    }
    .nav-links a { margin: 0.8rem 0; font-size: 1.1rem; }
    .nav-actions { flex-direction: column; width: 100%; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary {
    background: var(--accent-gold);
    color: var(--primary-dark);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
}

.btn-primary:hover {
    background: #e6c243;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-text:hover { color: var(--primary-dark); text-decoration: underline; }

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 3rem 5%;
    color: #fff;
    border-bottom: 4px solid var(--accent-gold);
    text-align: center;
}

.hero-content h1 {
    color: #fff;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.hero-content p {
    color: rgba(255,255,255,0.8);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   Layout (CSS Grid) & Glassmorphism
   ========================================================================== */
.layout-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    padding: 3rem 5%;
    max-width: 1600px;
    margin: 0 auto;
}

.layout-grid.layout-full {
    grid-template-columns: 1fr;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Sidebar Filters
   ========================================================================== */
.sidebar {
    padding: 2rem;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    position: sticky;
    top: 100px;
}

.sidebar-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--primary-dark);
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    background: rgba(255,255,255,0.9);
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.row {
    display: flex;
    gap: 1rem;
}

/* ==========================================================================
   Content Area & Cards Grid
   ========================================================================== */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.results-count {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

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

/* Property Card Design */
.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.12);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: var(--primary);
}

.card.fiscal::before {
    background: var(--accent-green);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

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

.tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.tag-default { background: #e2e8f0; color: #475569; }
.tag-fiscal { background: #dcfce7; color: #166534; }
.tag-urgent { background: #fee2e2; color: #991b1b; }
.tag-recurring { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.tag-reiterado { background: #fdf2f8; color: #9d174d; border: 1px solid #ec4899; }
.tag-discount { background: #dbeafe; color: #1e40af; border: 1px solid #3b82f6; }

.card-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.card-meta p { margin-bottom: 0.3rem; }
.card-meta strong { color: var(--text-main); }

/* ==========================================================================
   Loading State
   ========================================================================== */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 0;
    color: var(--text-muted);
}

.spinner {
    width: 40px; height: 40px;
    border: 4px solid rgba(0,0,0,0.1);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

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

/* ==========================================================================
   Modal (Details)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11, 19, 43, 0.6);
    backdrop-filter: blur(4px);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.modal-close {
    position: absolute;
    top: 1.5rem; right: 1.5rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

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

.modal-title {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.data-row {
    margin-bottom: 1rem;
}

.data-row span {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.data-box {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-gold);
    font-size: 0.95rem;
}

.disclaimer {
    margin-top: 2rem;
    padding: 1rem;
    background: #fdf2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.85rem;
}

/* ==========================================================================
   Responsive (Mobile First Overrides)
   ========================================================================== */
@media (max-width: 992px) {
    .layout-grid { grid-template-columns: 1fr !important; }
    .sidebar { position: static; margin-bottom: 2rem; display: none !important; }
    .nav-links { display: none; } /* En un proyecto real llevaría menú hamburguesa */
}

/* ==========================================================================
   Toast Notifications (Premium UI)
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast {
    background: var(--primary-dark);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border-left: 4px solid var(--accent-gold);
    animation: slideInRight 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    opacity: 0;
    transform: translateX(100%);
    font-size: 0.9rem;
    font-weight: 500;
}

@keyframes slideInRight {
    to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   Data Tables Premium (Módulos 2 y 4)
   ========================================================================== */
.table-container {
    padding: 1.5rem;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.data-table thead tr {
    border-bottom: 2px solid var(--primary-dark);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 700;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.data-table tbody tr:hover {
    background-color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transform: scale(1.005);
    border-left-color: var(--accent-gold);
}

/* ==========================================================================
   Pagination Controls
   ========================================================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    padding: 1rem;
    background: var(--glass-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.pagination .page-indicator {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 1rem;
    background: rgba(212, 175, 55, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   Módulo de Alertas (Premium CSS)
   ========================================================================== */
.alert-card-premium {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    margin-bottom: 2.5rem;
}

.alert-card-premium::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-gold), #ffd700, var(--accent-gold));
}

.alert-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(26, 31, 54, 0.03);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px dashed rgba(26, 31, 54, 0.1);
    margin-bottom: 1.5rem;
}

.alert-hud-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.alert-input-group {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.05);
}

.alert-submit-btn {
    background: linear-gradient(135deg, var(--primary-dark), #2c3e50);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(26, 31, 54, 0.2);
    width: 100%;
    margin-top: 1rem;
}

.alert-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 31, 54, 0.3);
    background: linear-gradient(135deg, #2c3e50, var(--primary-dark));
}

.alert-table-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    overflow-x: auto;
    border: 1px solid rgba(0,0,0,0.05);
}

/* ==========================================================================
   Responsive Design & Media Queries
   ========================================================================== */
@media (max-width: 1024px) {
    .layout-grid {
        grid-template-columns: 250px 1fr;
        padding: 2rem 3%;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .nav-links a {
        margin: 0;
        padding: 0.5rem;
    }

    .layout-grid {
        grid-template-columns: 1fr;
        padding: 1rem 5%;
    }
    
    .sidebar {
        position: static;
        margin-bottom: 2rem;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    .hero {
        padding: 2rem 5%;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .properties-grid {
        grid-template-columns: 1fr;
    }
    
    .row {
        flex-direction: column;
    }
    
    .alert-hud {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .alert-card-premium {
        padding: 1rem;
    }
    
    .data-table, .data-table thead, .data-table tbody, .data-table th, .data-table td, .data-table tr { 
        display: block; 
    }
    
    .data-table thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .data-table tr { border: 1px solid #ccc; margin-bottom: 1rem; border-radius: 8px; overflow: hidden; }
    
    .data-table td { 
        border: none;
        border-bottom: 1px solid #eee; 
        position: relative;
        padding-left: 50% !important; 
        text-align: right;
    }
    
    .data-table td:before { 
        position: absolute;
        top: 1rem;
        left: 1rem;
        width: 45%; 
        padding-right: 10px; 
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: var(--primary-dark);
    }
    
    /* Inject labels directly from CSS for Dashboard tables */
    .data-table td:nth-of-type(1):before { content: "Dato 1"; }
    .data-table td:nth-of-type(2):before { content: "Dato 2"; }
    .data-table td:nth-of-type(3):before { content: "Dato 3"; }
    .data-table td:nth-of-type(4):before { content: "Dato 4"; }
}

/* ==========================================================================
   Utility Classes (Removed from inline HTML)
   ========================================================================== */
.banner-robot {
    background: linear-gradient(135deg, #0B132B 0%, #1e293b 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-left: 4px solid var(--accent-gold);
}
.banner-robot h3 { margin: 0 0 0.5rem 0; color: var(--accent-gold); display: flex; align-items: center; gap: 8px; }
.banner-robot p { margin: 0; font-size: 0.95rem; color: #cbd5e1; max-width: 600px; }
.banner-robot button { background: var(--accent-gold); color: var(--primary-dark); border: none; white-space: nowrap; font-weight: bold; cursor: pointer; padding: 0.8rem 1.5rem; }

.kpi-container {
    background: #fff;
    margin-bottom: 2rem;
    border: 1px solid var(--accent-gold);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.kpi-summary {
    padding: 1rem;
    cursor: pointer;
    font-weight: bold;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    user-select: none;
}
.kpi-body { padding: 1rem; border-top: 1px solid rgba(0,0,0,0.05); }

.info-box-blue {
    background: rgba(43, 91, 132, 0.1);
    border-left: 4px solid #2b5b84;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}
.info-box-gold {
    background: rgba(212, 175, 55, 0.05);
    border-left: 4px solid var(--accent-gold);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-color);
}

.footer-legal-container {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
    font-size: 0.85rem;
}
.footer-legal-content { max-width: 1200px; margin: auto; }
.footer-legal-content p { margin-bottom: 1rem; }
.footer-legal-links { display: flex; justify-content: center; gap: 1.5rem; }
.footer-legal-links a { color: rgba(255,255,255,0.9); text-decoration: underline; }

/* ==========================================================================
   Banner Legal Institucional (Desactivado de cabecera - Migrado a Registro y Email)
   ========================================================================== */
.legal-top-banner {
    display: none !important;
}

.legal-top-banner .legal-banner-text {
    display: inline;
    letter-spacing: -0.01em;
}

.legal-top-banner a.legal-banner-link {
    color: #0f172a;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease-in-out;
    cursor: pointer;
}

.legal-top-banner a.legal-banner-link:hover,
.legal-top-banner a.legal-banner-link:focus-visible {
    color: #000000;
    text-decoration: none;
    outline: 2px solid #0f172a;
    outline-offset: 2px;
    border-radius: 2px;
}

.legal-top-banner .legal-banner-cta {
    margin-left: 8px;
    display: inline-block;
}

@media (max-width: 640px) {
    .legal-top-banner {
        padding: 8px 12px;
        font-size: 0.78rem;
    }
    .legal-top-banner .legal-banner-cta {
        display: inline;
        margin-left: 6px;
    }
}

/* ==========================================================================
   Header Nav Dropdown & Sub-Navigation Pills (Oportunidades)
   ========================================================================== */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    display: inline-block;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 280px;
    background: #0B132B;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
    display: none;
    flex-direction: column;
    padding: 6px;
    z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.nav-dropdown-menu a {
    display: flex !important;
    flex-direction: column;
    padding: 10px 12px !important;
    margin: 2px 0 !important;
    border-radius: 6px;
    text-decoration: none;
    color: #e2e8f0 !important;
    transition: background 0.15s ease;
}

.nav-dropdown-menu a:hover {
    background: rgba(212, 175, 55, 0.15);
    color: #ffffff !important;
}

.nav-dropdown-menu a strong {
    font-size: 0.88rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-dropdown-menu a small {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 2px;
}

/* Subnav Pills dentro de la vista Oportunidades */
.subnav-pills {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    background: #e2e8f0;
    padding: 5px;
    border-radius: 8px;
    width: fit-content;
    flex-wrap: wrap;
}

.subnav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.subnav-btn:hover {
    color: var(--primary-dark);
}

.subnav-btn.active {
    background: #ffffff;
    color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.badge-mini-gold {
    background: var(--accent-gold);
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

/* Comparativa Cards */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.comparison-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.comparison-card.card-flipping {
    border-top: 4px solid var(--accent-gold);
}

.comparison-card.card-ocultas {
    border-top: 4px solid #3b82f6;
}

.comparison-card h3 {
    margin-top: 0;
    font-size: 1.25rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.comparison-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 0;
    font-size: 0.9rem;
}

.comparison-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
}

.comparison-list li strong {
    color: var(--primary-dark);
    margin-bottom: 2px;
}

.comparison-list li span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.badge-cross-region {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #f87171;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-cross-prov {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #93c5fd;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ==========================================================================
   OPORTUNIDADES PERFECTAS (DOBLE ARBITRAJE: 2° LLAMADO + JURISDICCIÓN CRUZADA)
   ========================================================================== */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 6px rgba(217, 119, 6, 0.35);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 18px rgba(245, 158, 11, 0.75), 0 0 28px rgba(217, 119, 6, 0.25);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 6px rgba(217, 119, 6, 0.35);
        transform: scale(1);
    }
}

.badge-perfect-opportunity {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fbbf24;
    border: 1px solid #f59e0b;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
    animation: pulseGlow 3s infinite ease-in-out;
    white-space: nowrap;
}

.badge-perfect-opportunity span.gem {
    font-size: 0.9rem;
    filter: drop-shadow(0 0 3px #f59e0b);
}

.card-perfect-opportunity {
    border: 2px solid #f59e0b !important;
    background: linear-gradient(180deg, #fffdf5 0%, #ffffff 100%) !important;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.16) !important;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-perfect-opportunity:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(245, 158, 11, 0.28) !important;
}

.card-perfect-ribbon {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.row-perfect-opportunity {
    background-color: rgba(254, 243, 199, 0.4) !important;
    border-left: 4px solid #f59e0b !important;
    transition: background-color 0.2s ease;
}

.row-perfect-opportunity:hover {
    background-color: rgba(254, 243, 199, 0.7) !important;
}

/* Banner Hero Oportunidad Perfecta */
.hero-perfect-box {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #311042 100%);
    color: #f8fafc;
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
    position: relative;
    overflow: hidden;
}

.hero-perfect-box::before {
    content: "💎";
    position: absolute;
    right: -15px;
    bottom: -25px;
    font-size: 9rem;
    opacity: 0.08;
    pointer-events: none;
}

.hero-perfect-title {
    color: #fbbf24;
    font-size: 1.35rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.6rem;
}

.hero-perfect-desc {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    max-width: 900px;
}

.hero-perfect-formula {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.07);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border: 1px dashed rgba(245, 158, 11, 0.5);
}

.formula-pillar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.7);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fef08a;
    font-size: 0.85rem;
    font-weight: 600;
}

.formula-plus {
    color: #f59e0b;
    font-weight: 900;
    font-size: 1.2rem;
}

.formula-equals {
    color: #38bdf8;
    font-weight: 900;
    font-size: 1.2rem;
}

.formula-result {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #0f172a;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

/* ==========================================================================
   ALERTA DE ROLES MONITOREADOS (WATCHLIST REAL-TIME HUD)
   ========================================================================== */
.monitored-alert-banner {
    background: linear-gradient(135deg, #0b132b 0%, #1e293b 100%);
    border: 2px solid var(--accent-gold);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.8rem;
    margin-bottom: 2rem;
    color: #ffffff;
    box-shadow: 0 12px 35px rgba(11, 19, 43, 0.3), 0 0 20px rgba(212, 175, 55, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    animation: slideInDown 0.4s ease-out;
}

.monitored-alert-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 6px;
    background: linear-gradient(180deg, var(--accent-gold), #ef4444);
}

.monitored-alert-icon-box {
    font-size: 2.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 1rem;
    flex-shrink: 0;
    animation: pulseIcon 2s infinite ease-in-out;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(212, 175, 55, 0); }
    50% { transform: scale(1.08); box-shadow: 0 0 15px rgba(212, 175, 55, 0.4); }
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

.monitored-alert-content {
    flex: 1;
}

.monitored-alert-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.5);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.monitored-alert-title {
    color: #ffffff;
    font-size: 1.25rem;
    margin-bottom: 0.4rem;
    font-weight: 800;
}

.monitored-alert-title .highlight-gold {
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.monitored-alert-desc {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.monitored-alert-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex-shrink: 0;
}

.btn-monitored-action {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #d4af37 100%);
    color: #0b132b;
    font-weight: 800;
    padding: 0.7rem 1.4rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.35);
    transition: var(--transition);
    white-space: nowrap;
}

.btn-monitored-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

.btn-monitored-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-weight: 600;
    padding: 0.55rem 1.2rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-size: 0.82rem;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-monitored-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.card-monitored-role {
    border: 2px solid #ef4444 !important;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.2) !important;
    position: relative;
}

.card-monitored-role::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ef4444, #f59e0b);
    border-radius: 12px 12px 0 0;
}

.badge-monitored-role {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.nav-alert-counter {
    background: #ef4444;
    color: #ffffff;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 800;
    margin-left: 6px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@media (max-width: 768px) {
    .monitored-alert-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.2rem;
    }
    .monitored-alert-actions {
        width: 100%;
    }
    .btn-monitored-action, .btn-monitored-secondary {
        width: 100%;
        justify-content: center;
    }
}




