:root {
    --vh-navy: #0b1a31;
    --vh-green: #00a651;
    --vh-yellow: #fdbd2d;
    --vh-red: #9e3b20;
    --vh-white: #ffffff;
    --vh-gray-bg: #f8fafc;
    --vh-whatsapp: #25D366;
    --vh-text-dark: #0f172a;
    --vh-text-light: #64748b;
    --vh-border: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--vh-navy);
    color: var(--vh-white);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    height: 95px;
    padding: 0 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(11, 26, 49, 0.98);
    border-bottom: 3px solid var(--vh-red);
    z-index: 100;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.header-brand { display: flex; align-items: center; gap: 20px; }
header img { height: 80px; width: auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15)); }
.header-title { display: flex; flex-direction: column; }
.header-title h1 { font-size: 1.1rem; font-weight: 900; color: var(--vh-yellow); margin: 0; letter-spacing: 1px; text-transform: uppercase; }


.main-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    background: #fff;
    position: relative;
}

#map-area {
    flex: 1;
    position: relative;
    background: #f1f5f9;
    cursor: grab;
    overflow: hidden;
}

#sidebar {
    width: 330px;
    background: var(--vh-gray-bg);
    color: var(--vh-text-dark);
    overflow-y: auto;
    padding: 25px;
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    z-index: 50;
}

.summary-section h3 {
    font-size: 0.9rem;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--vh-navy);
    padding-bottom: 8px;
    color: var(--vh-navy);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.manzana-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border-left: 6px solid var(--vh-navy);
}

.manzana-title {
    font-weight: 800;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--vh-navy);
}

.stat-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: #e2e8f0;
    margin: 10px 0;
}

.stat-segment { height: 100%; transition: width 1s ease; }

.leyenda-flotante {
    position: absolute;
    top: 50%;
    left: 25px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 18px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    z-index: 90;
    backdrop-filter: blur(8px);
    border: 1px solid var(--vh-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    pointer-events: none;
    width: 140px;
}
.leyenda-items { display: flex; flex-direction: column; gap: 15px; width: 100%; align-items: flex-start; }
.leyenda-item { display: flex; align-items: center; gap: 12px; font-size: 0.85rem; font-weight: 800; color: var(--vh-navy); }
.dot { width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); }
.timestamp { font-size: 0.55rem; color: var(--vh-text-light); font-weight: 800; border-top: 2px solid #e2e8f0; padding-top: 15px; text-transform: uppercase; text-align: center; width: 100%; line-height: 1.4; }
.timestamp span { display: block; font-size: 0.75rem; color: var(--vh-navy); margin-top: 5px; font-weight: 900; }

.watermark {
    position: absolute;
    bottom: 25px;
    left: 25px;
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    opacity: 0.65;
    text-decoration: none;
    transition: opacity 0.3s ease;
}
.watermark:hover { opacity: 1; }
.watermark span { font-size: 0.6rem; font-weight: 800; color: var(--vh-navy); text-transform: uppercase; letter-spacing: 0.5px; }
.watermark img { height: 28px; width: auto; }

svg { width: 100%; height: 100%; display: block; touch-action: none; }
path {
    cursor: pointer;
    pointer-events: all;
    stroke-width: 0.8;
    stroke: #000;
    fill: transparent;
    fill-opacity: 0.5;
    transition: all 0.25s ease;
}
path:hover { fill-opacity: 0.8; stroke: #000; stroke-width: 2.5; }
path.disponible { fill: var(--vh-green) !important; }
path.reservado { fill: var(--vh-yellow) !important; }
path.vendido { fill: var(--vh-red) !important; }

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
}

.modal.active { opacity: 1; visibility: visible; pointer-events: auto; }

.modal-content {
    background: white;
    color: var(--vh-text-dark);
    padding: 35px;
    border-radius: 32px;
    width: 95%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 30px 60px -12px rgba(0,0,0,0.4);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-lot-id { font-size: 0.9rem; font-weight: 800; color: var(--vh-text-light); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 5px; }

.status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.7rem;
    color: white;
    margin-bottom: 20px;
    text-transform: capitalize;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.area-box {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--vh-border);
}
.area-label { font-size: 0.6rem; font-weight: 800; color: var(--vh-text-light); text-transform: uppercase; margin-bottom: 5px; display: block; }
.area-val { font-size: 2.4rem; font-weight: 900; color: var(--vh-navy); line-height: 1; }

.measures-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    text-align: left;
    margin-bottom: 25px;
}
.measure-item { background: #f8fafc; padding: 10px 15px; border-radius: 12px; border: 1px solid #f1f5f9; }
.measure-item label { display: block; font-size: 0.55rem; font-weight: 800; color: var(--vh-text-light); text-transform: uppercase; margin-bottom: 2px; }
.measure-item span { font-size: 1rem; font-weight: 700; color: var(--vh-navy); }

.btn {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: none;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-whatsapp-premium {
    width: 100%;
    margin-top: 15px;
    background: #ffffff;
    color: #128C7E;
    padding: 14px 20px;
    border-radius: 14px;
    font-weight: 900;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.15);
    border: 2px solid #25D366;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.btn-whatsapp-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(37, 211, 102, 0.25);
    background: #f0fdf4;
}

.btn-close { background: white; color: #64748b; margin-top: 10px; border: 1px solid var(--vh-border); }
.btn-auth { width: auto; background: rgba(255,255,255,0.1); color: white; padding: 8px 16px; border-radius: 8px; font-size: 0.7rem; border: 1px solid rgba(255,255,255,0.2); }

#admin-panel {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--vh-border);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
#admin-panel button { padding: 8px; font-size: 0.65rem; margin: 0; }

.hidden { display: none !important; }

.login-content { max-width: 350px; padding: 30px 25px; }
.input-group { margin-bottom: 15px; text-align: left; }
.input-group label { display: block; font-size: 0.65rem; font-weight: 800; color: var(--vh-text-light); text-transform: uppercase; margin-bottom: 5px; }
.input-group input { width: 100%; padding: 12px 15px; border-radius: 10px; border: 1px solid var(--vh-border); font-size: 0.9rem; font-family: inherit; transition: border-color 0.3s; }
.input-group input:focus { outline: none; border-color: var(--vh-navy); box-shadow: 0 0 0 3px rgba(11, 26, 49, 0.1); }
.password-wrapper { position: relative; display: flex; align-items: center; }
.password-wrapper input { width: 100%; padding-right: 45px; }
.password-wrapper input::-ms-reveal,
.password-wrapper input::-ms-clear { display: none; }
.btn-toggle-pass { position: absolute; right: 10px; background: transparent; border: none; cursor: pointer; color: var(--vh-text-light); display: flex; align-items: center; justify-content: center; padding: 5px; transition: color 0.3s ease; }
.btn-toggle-pass:hover { color: var(--vh-navy); }

@media (max-width: 768px) {
    body { overflow-y: auto; height: auto; }
    .main-content { flex-direction: column; overflow: visible; height: auto; }
    #map-area { height: 65vh; flex: none; width: 100%; }
    #sidebar { width: 100%; box-shadow: 0 -5px 15px rgba(0,0,0,0.05); flex: none; }
   .header-brand { gap: 12px; }
    header img { height: 55px; }
    .header-title h1 { font-size: 0.85rem; }
    
    .leyenda-flotante { 
        top: auto; 
        bottom: 15px; 
        left: 50%; 
        transform: translateX(-50%); 
        width: 92%; 
        padding: 12px; 
        border-radius: 12px; 
        align-items: center; 
    }
    .leyenda-items { flex-direction: row; flex-wrap: wrap; gap: 10px; justify-content: center; }
    .timestamp { padding-top: 8px; }
    .timestamp span { display: inline; margin-left: 5px; }
    .dot { width: 12px; height: 12px; }
    
    .watermark { 
        position: static;
        padding: 10px 25px 30px 25px;
        background: var(--vh-gray-bg);
        width: 100%;
        align-items: flex-start;
        opacity: 0.8;
    }
    .watermark img { height: 28px; }
    
    header img { height: 55px; }
}