/* ==========================================================================
   SISTEMA DE ESTILOS Y UI - PRADERAS II PIURA (JESSAGO S.A.C)
   Cumple estrictamente con ui-guidelines.md:
   - Tamaño de fuente base: 13px
   - Modo Oscuro y Modo Claro nativos con variables CSS
   - Responsivo Mobile-First (Celular hasta PC pantalla grande)
   - Efectos Glassmorphism, micro-animaciones y diseño tipo app moderna
   ========================================================================== */

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

:root {
    /* Modo Oscuro Predeterminado (Deep Luxury Slate) */
    --bg-app: #090d16;
    --bg-surface: rgba(17, 24, 39, 0.82);
    --bg-surface-solid: #111827;
    --bg-elevated: #1e293b;
    --bg-input: rgba(15, 23, 42, 0.75);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.15);
    --border-focus: rgba(59, 130, 246, 0.6);
    
    /* Colores de Marca y Estados */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.15);
    
    --disponible: #10b981;
    --disponible-fill: rgba(16, 185, 129, 0.38);
    --disponible-hover: rgba(16, 185, 129, 0.75);
    
    --separado: #f59e0b;
    --separado-fill: rgba(245, 158, 11, 0.45);
    --separado-hover: rgba(245, 158, 11, 0.8);
    
    --vendido: #ef4444;
    --vendido-fill: rgba(239, 68, 68, 0.42);
    --vendido-hover: rgba(239, 68, 68, 0.78);
    
    --seleccionado: #06b6d4;
    --whatsapp-green: #25d366;
    --whatsapp-hover: #20bd5a;

    --svg-bg: #0b111e;
    --svg-calle-bg: #141e33;
    --svg-linea-calle: rgba(255, 255, 255, 0.2);
    --svg-text: #94a3b8;
    --svg-lot-stroke: #1e293b;

    --shadow-sm: 0 2px 4px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

[data-theme="light"] {
    /* Modo Claro (Clean Modern Architectural) */
    --bg-app: #f1f5f9;
    --bg-surface: rgba(255, 255, 255, 0.88);
    --bg-surface-solid: #ffffff;
    --bg-elevated: #f8fafc;
    --bg-input: #ffffff;
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-medium: rgba(0, 0, 0, 0.14);
    --border-focus: rgba(37, 99, 235, 0.6);

    --svg-bg: #e2e8f0;
    --svg-calle-bg: #cbd5e1;
    --svg-linea-calle: rgba(0, 0, 0, 0.25);
    --svg-text: #475569;
    --svg-lot-stroke: #94a3b8;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 24px rgba(0,0,0,0.1);
    --shadow-glass: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   RESET Y BASE TIPOGRÁFICA (13px estricto)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px; /* BASE ESTRICTA DE 13PX SEGÚN UI-GUIDELINES */
    line-height: 1.45;
    color: var(--text-primary);
    background-color: var(--bg-app);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

input, button, select, textarea {
    font-family: inherit;
    font-size: 13px;
    color: inherit;
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */
.app-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ==========================================================================
   HEADER / NAVBAR FLOTANTE
   ========================================================================== */
.app-header {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    transition: all 0.25s ease;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
}

.brand-text h1 {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    margin: 0;
    line-height: 1.2;
}

.brand-text p {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
}

/* Quick Stats en Navbar (Oculto en móviles muy pequeños) */
.header-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 500;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot-disp { background-color: var(--disponible); box-shadow: 0 0 6px var(--disponible); }
.dot-sep  { background-color: var(--separado); box-shadow: 0 0 6px var(--separado); }
.dot-vend { background-color: var(--vendido); box-shadow: 0 0 6px var(--vendido); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Buscador Rápido */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 170px;
    height: 32px;
    padding: 0 12px 0 32px;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    width: 220px;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    pointer-events: none;
    font-size: 12px;
}

/* Botones Icono y Generales */
.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-icon:hover {
    background: var(--border-subtle);
    transform: translateY(-1px);
}

.btn-icon:active {
    transform: scale(0.95);
}

.btn-sm {
    padding: 5px 12px;
    height: 32px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-primary);
    transition: all 0.2s;
}

.btn-primary-active {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

/* Badge de Usuario en Sesión Activa */
.user-session-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 6px 3px 10px;
    background: var(--primary-light);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-badge-info {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
}

.btn-logout-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--vendido);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout-icon:hover {
    background: var(--vendido);
    color: #ffffff;
}

/* Inputs con Icono para Login y Formularios */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-input.with-left-icon {
    padding-left: 36px;
}

.form-input.with-right-btn {
    padding-right: 36px;
}

.input-right-btn {
    position: absolute;
    right: 8px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.2s;
}

.input-right-btn:hover {
    color: var(--text-primary);
}

/* Modal de Login Moderno */
.login-modal-card {
    max-width: 400px;
}

.auth-icon-badge {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-auth-hint {
    background: var(--bg-elevated);
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
}

.hint-header {
    color: var(--text-muted);
    font-weight: 600;
}

.hint-row {
    color: var(--text-secondary);
}

.hint-row code {
    background: var(--bg-input);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
    font-weight: 600;
}

.pulse-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* ==========================================================================
   BARRA DE FILTROS FLOTANTE
   ========================================================================== */
.filter-bar {
    position: absolute;
    top: 72px;
    left: 12px;
    z-index: 35;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    max-width: calc(100% - 24px);
    overflow-x: auto;
    scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-select {
    padding: 4px 10px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    font-size: 12px;
}

.filter-pills {
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-estado-btn {
    padding: 3px 10px;
    height: 26px;
    border-radius: var(--radius-full);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-estado-btn:hover {
    color: var(--text-primary);
}

.filter-estado-btn.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-medium);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   VISOR INTERACTIVO DEL PLANO
   ========================================================================== */
.viewport-container {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: grab;
    background-color: var(--bg-app);
}

.viewport-container:active {
    cursor: grabbing;
}

.plano-svg-canvas {
    width: 1050px;
    height: 2200px;
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
}

/* Estilos SVG de alta fidelidad */
.svg-bg {
    fill: var(--svg-bg);
    transition: fill 0.25s ease;
}

.via-asfalto, .calle-asfalto {
    fill: var(--svg-calle-bg);
}

.via-eje, .calle-linea-centro {
    stroke: var(--svg-linea-calle);
}

.via-borde {
    stroke: var(--border-medium);
}

.calle-texto-vertical, .calle-label {
    fill: var(--svg-text);
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
}

.mz-badge-bg {
    fill: var(--bg-surface-solid);
    stroke: var(--primary);
    stroke-width: 1.2;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

.mz-badge-text {
    fill: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 11.5px;
    font-weight: 700;
}

/* Lotes Interactivos en SVG */
.lote-elemento {
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.2s ease;
}

.lote-rect {
    stroke: var(--svg-lot-stroke);
    stroke-width: 1;
    transition: fill 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
}

.lote-numero {
    fill: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 11px;
    pointer-events: none;
}

.lote-area {
    fill: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 8.5px;
    pointer-events: none;
    opacity: 0.9;
}

/* Colores de Estado de Lotes */
.estado-disponible .lote-rect {
    fill: var(--disponible-fill);
}
.estado-disponible:hover .lote-rect {
    fill: var(--disponible-hover);
    stroke: var(--disponible);
    stroke-width: 2;
}

.estado-separado .lote-rect {
    fill: var(--separado-fill);
}
.estado-separado:hover .lote-rect {
    fill: var(--separado-hover);
    stroke: var(--separado);
    stroke-width: 2;
}

.estado-vendido .lote-rect {
    fill: var(--vendido-fill);
}
.estado-vendido:hover .lote-rect {
    fill: var(--vendido-hover);
    stroke: var(--vendido);
    stroke-width: 2;
}

/* Lote Seleccionado / Foco Activo */
.lote-seleccionado .lote-rect {
    fill: rgba(6, 182, 212, 0.75) !important;
    stroke: var(--seleccionado) !important;
    stroke-width: 2.8 !important;
    filter: url(#glowEffect);
}

.lote-seleccionado .lote-numero {
    fill: #ffffff !important;
    font-size: 13px !important;
}

/* Cuadros Técnicos y Rótulo Oficial */
.card-plano-bg {
    fill: var(--bg-surface-solid);
    stroke: var(--border-medium);
    stroke-width: 1.2;
}

.card-plano-header {
    fill: var(--text-primary);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.card-plano-sub {
    fill: var(--text-muted);
    font-size: 9.5px;
}

.utm-th {
    fill: var(--primary);
    font-size: 9px;
    font-weight: 700;
}

.utm-td {
    fill: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.5px;
}

.rotulo-label {
    fill: var(--text-muted);
    font-size: 9px;
    font-weight: 600;
}

.rotulo-valor {
    fill: var(--text-secondary);
    font-size: 10.5px;
    font-weight: 500;
}

.rotulo-valor-bold {
    fill: var(--text-primary);
    font-size: 12px;
    font-weight: 800;
}

.lamina-badge {
    fill: var(--primary);
}

.lamina-code {
    fill: #ffffff;
    font-weight: 800;
    font-size: 18px;
    font-family: 'Outfit', sans-serif;
}

.brujula-circle {
    fill: var(--bg-surface-solid);
    stroke: var(--border-medium);
    stroke-width: 1.5;
}

.brujula-n {
    fill: #ef4444;
    font-weight: 800;
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
}

.ingreso-box {
    fill: var(--primary);
    filter: drop-shadow(0 4px 10px rgba(59, 130, 246, 0.4));
}

.ingreso-texto {
    fill: #ffffff;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 1px;
}

.equip-titulo {
    fill: var(--text-primary);
    font-weight: 800;
    font-size: 20px;
}

.equip-subtitulo {
    fill: var(--text-primary);
    font-weight: 700;
    font-size: 13px;
}

.equip-subtitulo-sm {
    fill: var(--text-primary);
    font-size: 10px;
    font-weight: 600;
}

.equip-badge {
    fill: #10b981;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ==========================================================================
   CONTROLES FLOTANTES (+, -, RESET, MINIMAPA)
   ========================================================================== */
.floating-controls {
    position: absolute;
    bottom: 24px;
    left: 16px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-ctrl {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 16px;
    font-weight: 700;
}

.btn-ctrl:hover {
    background: var(--bg-elevated);
    transform: translateY(-2px);
}

.btn-ctrl:active {
    transform: scale(0.92);
}

/* Minimapa en Esquina */
.minimap-wrapper {
    position: absolute;
    bottom: 24px;
    right: 16px;
    z-index: 30;
    width: 90px;
    height: 180px;
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    pointer-events: none;
}

.minimap-preview {
    width: 100%;
    height: 100%;
    position: relative;
    background: rgba(0,0,0,0.15);
}

.minimap-viewport-box {
    position: absolute;
    border: 1.5px solid var(--seleccionado);
    background: rgba(6, 182, 212, 0.2);
    border-radius: 2px;
    transition: all 0.1s ease;
}

/* ==========================================================================
   DRAWER / FICHA DE DETALLE DEL LOTE (TIPO APP MODERNO)
   - Móvil: Bottom Sheet deslizable
   - Desktop: Panel Lateral Flotante Glassmorphism
   ========================================================================== */
.lote-drawer {
    position: absolute;
    z-index: 50;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-glass);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    display: flex;
    flex-direction: column;
}

/* En Desktop (> 768px): Sidebar Flotante Derecho */
@media (min-width: 769px) {
    .lote-drawer {
        top: 80px;
        right: 16px;
        bottom: 24px;
        width: 380px;
        border-radius: var(--radius-lg);
        transform: translateX(420px);
        opacity: 0;
        pointer-events: none;
    }

    .lote-drawer.drawer-open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .drawer-handle-bar {
        display: none;
    }
}

/* En Celular (< 768px): Bottom Sheet Deslizable */
@media (max-width: 768px) {
    .lote-drawer {
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 85vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(105%);
        border-bottom: none;
    }

    .lote-drawer.drawer-open {
        transform: translateY(0);
    }

    .drawer-handle-bar {
        width: 100%;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: grab;
    }

    .drawer-handle {
        width: 38px;
        height: 4.5px;
        background: var(--text-muted);
        opacity: 0.4;
        border-radius: var(--radius-full);
    }

    .header-stats {
        display: none; /* Simplificar cabecera en celulares */
    }

    .search-input {
        width: 120px;
    }
    .search-input:focus {
        width: 160px;
    }

    .minimap-wrapper {
        display: none;
    }
}

/* Contenido del Drawer */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.drawer-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Tarjetas de Métricas del Lote */
.lote-grid-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.spec-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.spec-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.spec-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.spec-card-full {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-color: rgba(59, 130, 246, 0.25);
}

.spec-price {
    font-size: 19px;
    font-weight: 800;
    color: var(--text-primary);
}

/* Badges de Estado */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.badge-disponible {
    background: rgba(16, 185, 129, 0.15);
    color: var(--disponible);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-separado {
    background: rgba(245, 158, 11, 0.15);
    color: var(--separado);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-vendido {
    background: rgba(239, 68, 68, 0.15);
    color: var(--vendido);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Cotizador Financiero Integrado */
.cotizador-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cotizador-title {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--text-muted);
}

.slider-val {
    font-weight: 700;
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    background: var(--border-medium);
    border-radius: var(--radius-full);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 8px var(--primary);
    transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.calculo-resumen {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
}

.cuota-valor {
    font-size: 16px;
    font-weight: 800;
    color: var(--disponible);
    font-family: 'JetBrains Mono', monospace;
}

/* Botón WhatsApp Principal */
.btn-whatsapp {
    width: 100%;
    padding: 11px 16px;
    background: linear-gradient(135deg, var(--whatsapp-green) 0%, #128c7e 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-whatsapp:hover {
    background: linear-gradient(135deg, var(--whatsapp-hover) 0%, #075e54 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
}

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

/* ==========================================================================
   MODALES Y DIÁLOGOS (GLASSMORPHISM)
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-backdrop.modal-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: 100%;
    max-width: 520px;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    transform: translateY(16px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal-backdrop.modal-open .modal-card {
    transform: translateY(0);
}

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

.modal-title {
    font-size: 15px;
    font-weight: 700;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

/* Formularios de Edición */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Consola SQL Explorer */
.sql-console {
    width: 100%;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    min-height: 80px;
    resize: vertical;
}

.sql-table-wrapper {
    max-height: 240px;
    overflow: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.sql-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
}

.sql-table th, .sql-table td {
    padding: 6px 10px;
    border: 1px solid var(--border-subtle);
    text-align: left;
}

.sql-table th {
    background: var(--bg-elevated);
    color: var(--text-primary);
    position: sticky;
    top: 0;
}

.sql-error {
    color: #ef4444;
    padding: 8px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.sql-success {
    color: #10b981;
    padding: 8px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast-item {
    background: var(--bg-surface-solid);
    color: var(--text-primary);
    padding: 9px 18px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-lg);
    font-size: 12.5px;
    font-weight: 600;
    pointer-events: auto;
    animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-success { border-color: var(--disponible); color: var(--disponible); }
.toast-error   { border-color: var(--vendido); color: var(--vendido); }
.toast-info    { border-color: var(--primary); color: var(--primary); }

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

.hidden { display: none !important; }
