:root {
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --bg-dark: #0f172a;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-subtle: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
}

html, body { 
    width: 100%; 
    height: 100%; 
    overflow: hidden; 
    background: var(--bg-dark); 
}

#map { 
    position: absolute; 
    inset: 0; 
    z-index: 1; 
}

.top-bar-right { 
    position: absolute; 
    top: 16px; 
    right: 16px; 
    z-index: 10; 
    pointer-events: none; 
}

.auth-card { 
    background: rgba(255, 255, 255, 0.9); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 16px; 
    border-radius: var(--radius-lg); 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); 
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex; 
    align-items: center; 
    gap: 12px; 
    pointer-events: auto; 
}

.btn-primary { 
    background: var(--primary); 
    color: #fff; 
    border: 0; 
    padding: 8px 14px; 
    border-radius: 8px; 
    font-weight: 600; 
    font-size: 0.85rem; 
    cursor: pointer; 
    transition: background 0.2s ease, transform 0.1s ease;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(0.97); }

.btn-danger { 
    background: #ef4444; 
    color: #fff; 
    border: 0; 
    padding: 6px 12px; 
    border-radius: 6px; 
    font-size: 0.78rem; 
    font-weight: 600;
    cursor: pointer; 
    transition: background 0.2s ease;
}
.btn-danger:hover { background: #dc2626; }

.dropdown-menu { 
    position: absolute; 
    top: 70px; 
    left: 16px; 
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(12px);
    padding: 14px; 
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-subtle); 
    border: 1px solid var(--border-color);
    display: none; 
    flex-direction: column; 
    gap: 12px; 
    min-width: 210px; 
    pointer-events: auto; 
    z-index: 3000; 
}
.dropdown-menu label { 
    font-size: 0.85rem; 
    font-weight: 600; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    cursor: pointer; 
    color: var(--text-main); 
}

.mini-pin { 
    width: 32px; 
    height: 32px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 15px; 
    color: #fff; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); 
    border: 2px solid #fff; 
    cursor: pointer; 
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.mini-pin:hover { transform: scale(1.15); }
.mini-free { background: #10b981; }
.mini-paid { background: #ef4444; }
.mini-gas { background: #f59e0b; }

.ficha-autor { 
    font-size: 0.75rem; 
    font-weight: 700; 
    color: var(--primary); 
    background: #e0f2fe; 
    border: 1px solid #bae6fd; 
    padding: 4px 10px; 
    border-radius: 20px; 
    display: inline-flex; 
    align-items: center; 
    gap: 5px; 
    white-space: nowrap; 
}

.cluster-circle { 
    background: rgba(2, 132, 199, 0.95); 
    color: #fff; 
    width: 38px; 
    height: 38px; 
    border-radius: 50%; 
    font-size: 0.85rem; 
    font-weight: 800; 
    border: 3px solid #fff; 
    box-shadow: 0 6px 16px rgba(0,0,0,0.25); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: transform 0.2s ease;
}
.cluster-circle:hover { transform: scale(1.08); }

.ramp-drawer { 
    position: fixed; 
    bottom: -100%; 
    left: 0; 
    right: 0; 
    width: 100%; 
    max-width: 500px; 
    margin: 0 auto; 
    background: #fff; 
    border-radius: 24px 24px 0 0; 
    box-shadow: 0 -10px 40px rgba(0,0,0,0.25); 
    z-index: 2000; 
    transition: bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1); 
    max-height: 88vh; 
    display: flex; 
    flex-direction: column; 
    padding: 16px 24px 24px; 
}
.ramp-drawer.open { bottom: 0; }

.drawer-handle { 
    width: 48px; 
    height: 5px; 
    background: #cbd5e1; 
    border-radius: 10px; 
    margin: 0 auto 16px; 
    flex-shrink: 0; 
}

.drawer-content { overflow-y: auto; padding-right: 4px; }

.badge { 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    padding: 6px 10px; 
    border-radius: var(--radius-md); 
    font-size: 0.78rem; 
    font-weight: 700; 
    margin: 0 4px 6px 0; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); 
}
.badge-free { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge-paid { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.badge-type { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.badge-gas { background: #fef3c7; color: #d97706; border: 1px solid #fde68a; }
.badge-water { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

.action-buttons { display: flex; gap: 10px; margin: 14px 0; }
.btn-accion { 
    flex: 1; 
    text-align: center; 
    color: #fff; 
    padding: 11px; 
    border-radius: var(--radius-md); 
    text-decoration: none; 
    font-size: 0.85rem; 
    font-weight: 700; 
    cursor: pointer; 
    border: 0; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 8px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: filter 0.2s ease;
}
.btn-accion:hover { filter: brightness(1.08); }
.btn-nav { background: #16a34a; }
.btn-share { background: #25d366; }

.ficha-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 10px; }

.modal-overlay { 
    display: none; 
    position: fixed; 
    inset: 0; 
    background: rgba(15, 23, 42, 0.65); 
    z-index: 3000; 
    justify-content: center; 
    align-items: center; 
    backdrop-filter: blur(6px); 
    -webkit-backdrop-filter: blur(6px);
    padding: 16px; 
}

.modal-content { 
    background: #fff; 
    border-radius: 20px; 
    padding: 28px; 
    width: 100%; 
    max-width: 420px; 
    max-height: 90vh; 
    overflow-y: auto; 
    position: relative; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.3); 
    animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.btn-close { 
    position: absolute; 
    top: 18px; 
    right: 18px; 
    background: #f1f5f9; 
    border: 0; 
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem; 
    cursor: pointer; 
    color: var(--text-muted); 
    transition: background 0.2s ease, color 0.2s ease;
}
.btn-close:hover { background: #e2e8f0; color: var(--text-main); }

.form-group { margin-bottom: 14px; text-align: left; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 700; color: #334155; margin-bottom: 6px; }
.form-control { width: 100%; padding: 11px 14px; border: 1px solid #cbd5e1; border-radius: var(--radius-md); font-size: 0.88rem; outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15); }

.tab-buttons { display: flex; gap: 8px; margin-bottom: 18px; background: #f1f5f9; padding: 4px; border-radius: var(--radius-md); }
.tab-btn { flex: 1; padding: 9px; border: 0; background: none; font-weight: 700; font-size: 0.85rem; color: var(--text-muted); cursor: pointer; border-radius: 8px; transition: all 0.2s ease; }
.tab-btn.active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.media-gallery { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.media-wrapper { position: relative; flex-shrink: 0; }
.media-item { height: 95px; width: 120px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid #cbd5e1; cursor: pointer; transition: transform 0.2s ease; }
.media-item:hover { transform: scale(1.03); }

.btn-delete-media { 
    position: absolute; 
    top: 6px; 
    right: 6px; 
    background: rgba(239, 68, 68, 0.95); 
    color: #fff; 
    border: 0; 
    border-radius: 50%; 
    width: 24px; 
    height: 24px; 
    font-size: 11px; 
    cursor: pointer; 
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.leaflet-control-locate, .leaflet-control-menu { 
    background: rgba(255, 255, 255, 0.95) !important; 
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.15) !important; 
    border-radius: var(--radius-md) !important; 
    width: 38px !important; 
    height: 38px !important; 
    display: flex !important; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    font-size: 18px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important; 
    text-decoration: none; 
    color: #334155; 
    transition: background 0.2s ease;
}
.leaflet-control-locate:hover, .leaflet-control-menu:hover { background: #fff !important; }