/* Dark = default. Light overrides via [data-theme="light"] (no invert, no duplicate sheets). */
:root {
    --bg-dark: #0f1115;
    --surface: #1e2128;
    --surface-hover: #2a2e38;
    --primary: #4ade80;
    /* Neo-green / Electric green */
    --primary-hover: #22c55e;
    --secondary: #3b82f6;
    --danger: #ef4444;
    --attention: #f59e0b;
    --attention-soft: #eab308;
    --text-main: #f8fafc;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: #334155;
    --on-primary: #000;
    --on-danger: #fff;
    --switch-track: #334155;
    --star-idle: rgba(255, 255, 255, 0.15);

    --topbar-bg: rgba(15, 17, 21, 0.65);
    --topbar-border: rgba(255, 255, 255, 0.05);
    --panel-elevated: rgba(30, 33, 40, 0.96);
    --panel-glass: rgba(30, 33, 40, 0.95);
    --muted-fill: rgba(255, 255, 255, 0.03);
    --muted-fill-2: rgba(255, 255, 255, 0.05);
    --muted-fill-3: rgba(255, 255, 255, 0.1);
    --input-fill: rgba(255, 255, 255, 0.05);
    --hover-fill: rgba(255, 255, 255, 0.1);
    --scrim: rgba(10, 10, 12, 0.72);
    --streetview-header: rgba(0, 0, 0, 0.4);
    --hairline: rgba(255, 255, 255, 0.05);

    --radius-lg: 20px;
    --radius-sm: 8px;

    --shadow-up: 0 -4px 20px rgba(0, 0, 0, 0.5);
    --shadow-down: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-sheet: 0 -10px 30px rgba(0, 0, 0, 0.6);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-toast: 0 10px 25px rgba(0, 0, 0, 0.4);
    --shadow-fab: 0 4px 20px rgba(0, 0, 0, 0.5);
}

html[data-theme="light"] {
    color-scheme: light;
}

[data-theme="light"] {
    --bg-dark: #f4f6f9;
    --surface: #ffffff;
    --surface-hover: #e8edf4;
    --primary: #4ade80;
    --primary-hover: #22c55e;
    --secondary: #3b82f6;
    --danger: #ef4444;
    --attention: #f59e0b;
    --attention-soft: #ca8a04;
    --text-main: #0f172a;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border: #cbd5e1;
    --on-primary: #052e16;
    --on-danger: #fff;
    --switch-track: #cbd5e1;
    --star-idle: rgba(15, 23, 42, 0.18);

    --topbar-bg: rgba(244, 246, 249, 0.88);
    --topbar-border: rgba(15, 23, 42, 0.08);
    --panel-elevated: rgba(255, 255, 255, 0.97);
    --panel-glass: rgba(255, 255, 255, 0.96);
    --muted-fill: rgba(15, 23, 42, 0.04);
    --muted-fill-2: rgba(15, 23, 42, 0.06);
    --muted-fill-3: rgba(15, 23, 42, 0.08);
    --input-fill: #eef2f7;
    --hover-fill: rgba(15, 23, 42, 0.06);
    --scrim: rgba(15, 23, 42, 0.45);
    --streetview-header: rgba(15, 23, 42, 0.08);
    --hairline: rgba(15, 23, 42, 0.08);

    --shadow-up: 0 -4px 20px rgba(15, 23, 42, 0.1);
    --shadow-down: 0 4px 20px rgba(15, 23, 42, 0.1);
    --shadow-sheet: 0 -10px 30px rgba(15, 23, 42, 0.12);
    --shadow-card: 0 10px 40px rgba(15, 23, 42, 0.12);
    --shadow-toast: 0 10px 25px rgba(15, 23, 42, 0.12);
    --shadow-fab: 0 4px 20px rgba(15, 23, 42, 0.14);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html {
    color-scheme: dark;
    height: 100%;
    height: -webkit-fill-available;
    height: 100svh;
    height: 100dvh;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    /* Fullscreen iOS: svh estable + dvh dinámico; fill-available para Safari antiguo. */
    height: 100vh;
    height: -webkit-fill-available;
    height: 100svh;
    height: 100dvh;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100svh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Map Container */
#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: 100svh;
    height: 100dvh;
    z-index: 10;
    background: #e5e3df;
}

/* Top Bar UI */
.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem 1rem 1rem;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--topbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--topbar-border);
    pointer-events: none;
    /* Let map clicks through unless on children */
}

.top-bar>div,
.top-bar>button {
    pointer-events: auto;
}

.user-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem 0.4rem 0.4rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
    box-shadow: var(--shadow-down);
    transition: all 0.2s ease;
}

.user-pill:hover {
    background: var(--hover-fill);
}

.user-pill .avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-pill .avatar::after {
    content: "👤";
    font-size: 0.8rem;
}

.hidden {
    display: none !important;
}

.btn-icon {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-down);
}

/* Bottom Sheets (Uber Style).
   En iPhone, transform + overflow dejan una capa que sigue capturando toques
   aunque la ficha parezca fuera de pantalla. Ocultar es display:none. */
.bottom-sheet {
    position: absolute;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    background: var(--surface);
    background-color: var(--surface);
    color: var(--text-main);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1rem 1.5rem 1.5rem;
    z-index: 100;
    max-height: 78vh;
    max-height: min(78vh, 78dvh);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    box-shadow: var(--shadow-sheet);
    transform: none;
    pointer-events: auto;
}

.bottom-sheet.sheet-front {
    z-index: 160;
}

.bottom-sheet.sheet-hidden,
.bottom-sheet.sheet-hidden * {
    pointer-events: none !important;
}

.bottom-sheet.sheet-hidden {
    display: none !important;
    visibility: hidden !important;
    overflow: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    z-index: -1 !important;
}

.sheet-hide-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 48px;
    margin: 0 0 0.75rem;
    padding: 8px 12px;
    border: 0;
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-main);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    cursor: pointer;
    touch-action: manipulation;
    position: sticky;
    top: 0;
    z-index: 3;
}

.sheet-grip {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    display: block;
}

.reopen-reservation {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin: 0.75rem 0 0;
    padding: 0.55rem 1rem;
    border: 1px solid rgba(74, 222, 128, 0.55);
    border-radius: 12px;
    background: rgba(74, 222, 128, 0.12);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.95rem;
    touch-action: manipulation;
    pointer-events: auto;
}

.reopen-reservation.hidden {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* Tras Ocultar en nav: solo FAB reopen (sin Dejo/Busco ni radio). */
#main-actions.floating-actions.encounter-minimized {
    max-height: none;
    padding: 0.75rem 1rem 0.9rem;
    overflow: visible;
}

#main-actions.floating-actions.encounter-minimized #main-sheet-content {
    max-height: none !important;
    opacity: 1 !important;
    pointer-events: auto;
    margin: 0;
    padding: 0;
}

#main-actions.floating-actions.encounter-minimized h2,
#main-actions.floating-actions.encounter-minimized .action-grid,
#main-actions.floating-actions.encounter-minimized .map-tools,
#main-actions.floating-actions.encounter-minimized .btn-hide-actions,
#main-actions.floating-actions.encounter-minimized #main-sheet-handle {
    display: none !important;
}

#main-actions.floating-actions.encounter-minimized .reopen-reservation:not(.hidden) {
    margin: 0;
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 1.5rem auto;
}

.bottom-sheet h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

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

/* Buttons */
.btn {
    /* WebKit/iOS: appearance:auto + transparent fill paints native black chrome.
       menuctr fixed outline text color only — not this fill trap. */
    appearance: none;
    -webkit-appearance: none;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.2s, transform 0.1s;
    background-image: none;
}

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

.btn.primary {
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.2);
}

.btn.primary:hover {
    background: var(--primary-hover);
}

.btn.secondary {
    background: var(--surface-hover);
    color: var(--text-main);
}

.btn.danger {
    background: var(--danger);
    color: var(--on-danger);
}

.btn.outline {
    /* Explicit fill (not transparent): prevents iOS native black button face */
    background-color: var(--muted-fill);
    background-image: none;
    border: 2px solid var(--border);
    color: var(--text-main);
    box-shadow: none;
}

/* Outline variants: do not inherit filled-btn ink (e.g. --on-primary #000 on
   .btn.primary). Black text on dark/transparent panels fails on mobile. */
.btn.primary.outline {
    color: var(--primary);
    border-color: var(--primary);
    background-color: var(--muted-fill);
    box-shadow: none;
}

.btn.secondary.outline {
    color: var(--text-main);
    background-color: var(--muted-fill);
}

.btn.danger.outline {
    color: var(--danger);
    border-color: var(--danger);
    background-color: var(--muted-fill);
}

.btn.text-btn {
    background: transparent;
    padding: 0.5rem;
}

.btn-large {
    flex-direction: column;
    padding: 1.5rem 1rem;
    height: 120px;
    border-radius: var(--radius-lg);
}

.btn-large svg {
    margin-bottom: 0.5rem;
    color: var(--on-primary);
}

.btn-large.outline svg {
    color: var(--text-main);
}

.btn-large small {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
    display: block;
    font-weight: 400;
}

.full-width {
    width: 100%;
}

.mt-1 {
    margin-top: 1rem;
}

/* Spot Details Header */
.spot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Auth / Full Screen Overlays */
.fs-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-dark);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s;
}

.fs-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.auth-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    text-align: center;
}

.brand {
    margin-bottom: 2rem;
}

.brand h1 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.brand p {
    color: var(--text-secondary);
}

.auth-back-home {
    margin: -0.75rem 0 1rem;
    text-align: center;
}

.auth-back-home .btn.text-btn {
    display: inline-flex;
}

.sim-entry {
    display: block;
    margin-top: 1.1rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    opacity: 0.8;
}

.sim-entry:hover {
    color: var(--primary);
    opacity: 1;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#auth-form input {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
}

#auth-form input:focus {
    border-color: var(--primary);
}

.error-msg {
    color: var(--danger);
    margin-top: 1rem;
    font-size: 0.875rem;
    min-height: 1.2rem;
}

.error-msg.auth-ok {
    color: var(--primary);
}

/* Loaders */
.loader-horizontal {
    height: 4px;
    width: 100%;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin: 1.5rem 0;
    position: relative;
}

.loader-horizontal::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: var(--primary);
    animation: slide 1.5s infinite linear;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s infinite cubic-bezier(0.5, 0, 0.5, 1);
}

@keyframes slide {
    100% {
        left: 100%;
    }
}

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

.gm-html-marker {
    position: absolute;
    pointer-events: auto;
}

.gm-html-marker .gm-tip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    background: #fff;
    color: #111;
    border-radius: 6px;
    padding: 3px 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
    z-index: 2;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gm-html-marker .gm-tip[hidden] {
    display: none;
}

/* Custom Marker */
.pulse-marker {
    background: var(--primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    box-shadow: 0 0 0 rgba(74, 222, 128, 0.4);
    animation: pulse 2s infinite;
    /* iOS/Safari: el overlay de Maps a veces aplana capas; fuerza composición. */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform, box-shadow;
}

@keyframes pulse {
    0% {
        transform: translateZ(0) scale(0.95);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }

    70% {
        transform: translateZ(0) scale(1);
        box-shadow: 0 0 0 15px rgba(74, 222, 128, 0);
    }

    100% {
        transform: translateZ(0) scale(0.95);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

/* Plaza nueva (propia o recién visible por plan): rojo 10–15 s, no infinito. */
.pulse-marker.new-spot-pulse {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    background: var(--danger);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.65);
    animation: newSpotPulse 1.1s ease-out 11; /* ~12 s */
}

@keyframes newSpotPulse {
    0% {
        transform: translateZ(0) scale(0.92);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
        opacity: 1;
    }
    70% {
        transform: translateZ(0) scale(1.08);
        box-shadow: 0 0 0 16px rgba(239, 68, 68, 0);
        opacity: 1;
    }
    100% {
        transform: translateZ(0) scale(0.92);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
        opacity: 1;
    }
}

/* Prioridad: plaza nueva > plazas reales > usuario real > sim tip > sim > bocadillo */
.gm-html-marker[data-own-published="true"],
.gm-html-marker[data-new-spot="true"] {
    z-index: 600 !important;
}

.gm-html-marker[data-real-user="true"] {
    z-index: 160;
}

.gm-html-marker[data-simulated="true"] {
    z-index: 120;
}

.gm-html-marker.sim-tip-open {
    z-index: 140 !important;
}

.gm-html-marker.sim-tip-open .gm-tip {
    z-index: 3;
}

/* ==========================================================================
   NEW PREMIUM FEATURES STYLES
   ========================================================================== */

/* Toast Notifications */
.geo-banner {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    width: min(420px, calc(100% - 32px));
    background: var(--panel-elevated);
    border: 1px solid var(--border);
    border-left: 4px solid var(--secondary);
    border-radius: 14px;
    box-shadow: var(--shadow-toast);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

.geo-banner[hidden],
.geo-banner.hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.geo-banner p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.35;
    font-weight: 600;
}

.geo-banner .geo-help {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.geo-banner .btn {
    width: 100%;
}

.geo-banner[data-geo-ui="locating"] #btn-recargar-ubicacion {
    display: none;
}

.geo-banner[data-geo-ui="locating"] #geo-banner-text {
    color: var(--text-secondary);
    font-weight: 600;
}

.sim-panel .geo-banner {
    position: static;
    transform: none;
    width: auto;
    z-index: auto;
}

.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    width: 90%;
    max-width: 380px;
}

.toast {
    background: var(--panel-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-main);
    padding: 12px 18px;
    border-radius: 12px;
    border-left: 4px solid var(--secondary);
    box-shadow: var(--shadow-toast);
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-20px);
    animation: toast-in 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.toast.toast-success {
    border-left-color: var(--primary);
}

.toast.toast-error {
    border-left-color: var(--danger);
}

.toast.toast-info {
    border-left-color: var(--secondary);
}

.toast.hide {
    animation: toast-out 0.3s forwards;
}

@keyframes toast-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Spot Metadata Form inside Bottom Sheet */
.spot-form-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 1rem;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.form-group label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group select, .form-group input {
    background: var(--input-fill);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.form-group select:focus, .form-group input:focus {
    border-color: var(--primary);
}

/* Badges for Spot Details */
.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.spot-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--muted-fill-2);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.spot-badge.type-gratis {
    background: rgba(74, 222, 128, 0.1);
    color: var(--primary);
    border-color: rgba(74, 222, 128, 0.2);
}

.spot-badge.type-azul {
    background: rgba(59, 130, 246, 0.1);
    color: var(--secondary);
    border-color: rgba(59, 130, 246, 0.2);
}

.spot-badge.type-verde {
    background: rgba(234, 179, 8, 0.1);
    color: var(--attention-soft);
    border-color: rgba(234, 179, 8, 0.2);
}

/* Typing Indicator Bubble */
.typing-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 18px;
    background: var(--muted-fill-3);
    border-radius: 15px;
    border-bottom-left-radius: 4px;
    max-width: 80%;
    align-self: flex-start;
}

.typing-dot {
    width: 7px;
    height: 7px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.visibility-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--muted-fill);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 15px;
    cursor: pointer;
}

.visibility-row > span:first-child {
    font-weight: 600;
    font-size: 0.92rem;
    text-align: left;
}

.fcm-notify-row {
    cursor: default;
    align-items: flex-start;
}

.fcm-notify-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    min-width: 0;
}

.fcm-notify-copy > span {
    font-weight: 600;
    font-size: 0.92rem;
}

.fcm-notify-copy > small {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.35;
    font-weight: 400;
}

.fcm-notify-row[data-fcm-state="blocked"] .fcm-notify-copy > small,
.fcm-notify-row[data-fcm-state="unsupported"] .fcm-notify-copy > small {
    color: var(--attention);
}

.fcm-notify-row .switch {
    margin-top: 2px;
}

.switch {
    position: relative;
    width: 46px;
    height: 26px;
    flex: 0 0 auto;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.switch-ui {
    position: absolute;
    inset: 0;
    background: var(--switch-track);
    border-radius: 999px;
    transition: background 0.2s;
}

.switch-ui::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.switch input:checked + .switch-ui {
    background: var(--primary);
}

.switch input:checked + .switch-ui::after {
    transform: translateX(20px);
}

.switch input:focus-visible + .switch-ui {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

/* Profile drawer: fixed head + single scroll body (avoids clipped logout / 0-height history). */
.profile-card {
    margin: 0;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 600px;
    height: 85%;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-align: left;
}

.profile-card-head {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.profile-card-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: 4px;
}

/* Profile statistics grid (3 cajas: reputación / cedidas / usadas) */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

@media (max-width: 420px) {
    .profile-stats-grid {
        grid-template-columns: 1fr;
    }
}

.profile-stat-card {
    background: var(--muted-fill);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    transition: transform 0.2s, background 0.2s;
}

.profile-stat-card:hover {
    transform: translateY(-2px);
    background: var(--muted-fill-2);
}

.profile-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.profile-stat-value.highlight-primary {
    color: var(--primary);
}

.profile-stat-value.highlight-secondary {
    color: var(--secondary);
}

.profile-stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.profile-history {
    flex: none;
    overflow: visible;
    text-align: left;
    margin-top: 4px;
    padding-right: 0;
}

.profile-history-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 8px 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.profile-history-toggle:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
    border-radius: 6px;
}

.profile-history-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.profile-history-chevron {
    flex: 0 0 auto;
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid var(--text-secondary);
    border-bottom: 2px solid var(--text-secondary);
    transform: rotate(45deg);
    transition: transform 0.18s ease;
}

.profile-history-toggle[aria-expanded="true"] .profile-history-chevron {
    transform: rotate(-135deg);
}

.profile-history-panel {
    padding-top: 4px;
}

.profile-history-panel[hidden] {
    display: none;
}

.history-group {
    margin-bottom: 14px;
}

.history-group h4 {
    margin: 0 0 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.history-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-row {
    background: var(--muted-fill);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
}

.history-when {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.history-time {
    color: var(--secondary);
    font-variant-numeric: tabular-nums;
}

.history-place {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.history-plate {
    margin-top: 6px;
    font-family: monospace;
    font-size: 0.9rem;
    letter-spacing: 0.4px;
    color: var(--text-main);
}

.history-empty {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 4px 0 8px;
}

/* Rating Screen Overlay & Card */
.rating-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 380px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    text-align: center;
    animation: scale-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scale-up {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.rating-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 1.5rem 0;
}

.rating-star-btn {
    font-size: 2.25rem;
    background: none;
    border: none;
    color: var(--star-idle);
    cursor: pointer;
    transition: color 0.15s, transform 0.1s;
}

.rating-star-btn:hover {
    transform: scale(1.15);
}

.rating-star-btn.selected {
    color: var(--attention); /* Golden Yellow */
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* Floating Street View Panel */
.streetview-panel {
    position: absolute;
    top: 90px;
    right: 20px;
    width: 320px;
    height: 240px;
    background: var(--panel-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-up);
    z-index: 150;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.streetview-panel.hidden {
    transform: scale(0.8) translateY(-20px);
    opacity: 0;
    pointer-events: none;
}

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

.streetview-header h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.streetview-iframe {
    width: 100%;
    flex: 1;
    border: none;
    background: #000;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .streetview-panel {
        top: auto;
        bottom: 140px;
        right: 10px;
        left: 10px;
        width: calc(100% - 20px);
        height: 200px;
    }
}

/* Floating Street View Toggle FAB */
.streetview-fab {
    position: absolute;
    bottom: 24px;
    right: 16px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--panel-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-fab);
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 151;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
    color: var(--text-main);
}

.streetview-fab:hover {
    transform: scale(1.1);
}

.streetview-fab.hidden {
    opacity: 0;
    transform: scale(0.7);
    pointer-events: none;
}

/* Panel flotante. position:fixed respecto al viewport: en Safari,
   absolute dentro del body flex lo deja bajo la barra y fuera de pantalla. */
#main-actions.floating-actions {
    position: fixed;
    top: auto;
    left: auto;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: min(340px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: min(58vh, 58svh, 58dvh);
    max-height: min(58dvh, calc(100svh - 7.5rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    max-height: min(58dvh, calc(100dvh - 7.5rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    height: auto;
    margin: 0;
    padding: 1rem 1.1rem 1.1rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    background-color: var(--surface);
    color: var(--text-main);
    box-shadow: var(--shadow-card);
    z-index: 180;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    pointer-events: auto;
    transform: none;
    flex: none;
    align-self: auto;
}

#main-actions.floating-actions.hidden,
#main-actions.floating-actions.actions-panel-hidden {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

#main-actions.floating-actions h2 {
    margin: 0.35rem 0 1rem;
    font-size: 1.15rem;
}

#main-actions .btn-hide-actions {
    margin-top: 0.85rem;
}

#main-sheet-content {
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    max-height: 420px;
    opacity: 1;
}

#main-sheet-content.collapsed {
    max-height: 0 !important;
    opacity: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

/* Radio fuera del bloque plegable: visible al buscar plaza. */
.map-tools {
    position: relative;
    z-index: 4;
    pointer-events: auto;
    visibility: visible;
}

#main-actions.sheet-collapsed .map-tools,
#main-actions .map-tools .radius-panel,
#main-actions .map-tools .btn-stop-find-spot:not([hidden]) {
    display: block;
    pointer-events: auto;
    visibility: visible;
}

#btn-stop-find-spot.btn-stop-find-spot {
    margin: 0.65rem 0 0.25rem;
    min-height: 44px;
    touch-action: manipulation;
}

#btn-stop-find-spot[hidden] {
    display: none !important;
}

#main-actions.sheet-collapsed .btn-hide-actions {
    display: none !important;
}

.radius-panel input[type="range"] {
    min-height: 44px;
    touch-action: manipulation;
    pointer-events: auto;
}

#main-sheet-content:has(#btn-reopen-reservation:not(.hidden)) {
    max-height: 480px;
}

#main-sheet-handle {
    touch-action: manipulation;
    min-height: 44px;
    display: none;
}

#main-actions.sheet-collapsed #main-sheet-handle {
    display: block;
    width: 100%;
    height: auto;
    background: transparent;
    margin: 0 0 0.35rem;
    padding: 0;
    cursor: pointer;
}

#main-actions.sheet-collapsed #main-sheet-handle::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 0.55rem;
}

#main-actions.sheet-collapsed #main-sheet-handle::after {
    content: 'Atrás';
    display: block;
    text-align: center;
    transform: none;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 0;
}

#main-actions.sheet-collapsed {
    padding: 0.75rem 1rem 0.9rem;
}

/* FAB para reabrir el panel tras Ocultar */
.actions-fab {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 52px;
    height: 52px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--panel-elevated);
    color: var(--text-main);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    z-index: 190;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-fab);
    touch-action: manipulation;
    pointer-events: auto;
    flex: none;
}

.actions-fab.hidden {
    display: none !important;
    pointer-events: none !important;
}

/* Bocadillo FREE: 1–2 líneas, abajo-izquierda + safe-area. Bajo tips SIM. Franjas intactas. */
.activity-bubble {
    position: fixed;
    left: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: clamp(160px, 42vw, 220px);
    max-width: min(220px, calc(100vw - 88px));
    margin: 0;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--panel-elevated);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-toast);
    text-align: left;
    z-index: 50;
    pointer-events: none;
    overflow: hidden;
    flex: none;
}

.activity-bubble[hidden] {
    display: none !important;
}

.activity-bubble .activity-text {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-main);
}

@media (max-width: 520px) {
    #main-actions.floating-actions {
        left: 12px;
        right: 12px;
        width: auto;
        max-width: calc(100vw - 24px);
        /* Compact: Ocultar visible sin scroll en SE / alturas bajas */
        padding: 0.7rem 0.9rem 0.75rem;
        max-height: min(72dvh, calc(100dvh - 5.5rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    }

    #main-actions.floating-actions h2 {
        margin: 0.15rem 0 0.45rem;
        font-size: 1.05rem;
    }

    #main-actions .action-grid {
        gap: 0.65rem;
    }

    #main-actions .btn-large {
        height: 96px;
        padding: 0.85rem 0.65rem;
    }

    #main-actions .btn-large svg {
        margin-bottom: 0.25rem;
        width: 20px;
        height: 20px;
    }

    #main-actions .btn-large small {
        margin-top: 0.1rem;
    }

    #main-actions .radius-panel {
        margin-top: 6px;
        padding-top: 6px;
    }

    #main-actions .radius-head {
        margin-bottom: 4px;
        gap: 6px;
    }

    #main-actions .radius-title {
        font-size: 0.88rem;
    }

    #main-actions .radius-caption {
        margin: 2px 0 0;
        font-size: 0.72rem;
        line-height: 1.25;
    }

    #main-actions .theme-selector-row--actions {
        margin: 0.4rem 0 0.15rem;
        padding-top: 0.25rem;
    }

    #main-actions .theme-option {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
        min-height: 32px;
    }

    #main-actions .btn-hide-actions {
        margin-top: 0.4rem;
        padding: 0.7rem 1rem;
        min-height: 44px;
    }

    /* Menú aparcamiento: mismo objetivo — menos aire, controles intactos */
    .bottom-sheet {
        padding: 0.65rem 1rem 0.9rem;
        max-height: min(78vh, 78dvh);
    }

    .bottom-sheet .sheet-hide-btn {
        min-height: 40px;
        margin: 0 0 0.4rem;
        padding: 6px 10px;
        gap: 4px;
        font-size: 0.92rem;
    }

    .bottom-sheet h2 {
        margin-bottom: 0.55rem;
        font-size: 1.1rem;
    }

    .bottom-sheet #booking-desc,
    .bottom-sheet #details-comment {
        margin-bottom: 0.35rem !important;
        margin-top: 0.25rem !important;
    }

    .bottom-sheet .btn.mt-1,
    .bottom-sheet .mt-1.btn {
        margin-top: 0.45rem;
    }

    .bottom-sheet .btn {
        padding: 0.7rem 1rem;
        min-height: 44px;
    }

    .activity-bubble {
        top: auto;
        left: 12px;
        right: auto;
        width: clamp(150px, 48vw, 200px);
        max-width: calc(100vw - 88px);
        bottom: calc(12px + min(50dvh, 300px) + env(safe-area-inset-bottom, 0px));
    }

    body.actions-panel-hidden .activity-bubble {
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }
}

/* Altura baja (SE landscape/short phones): recortar más el radio + tema */
@media (max-width: 520px) and (max-height: 720px) {
    #main-actions .btn-large {
        height: 88px;
        padding: 0.7rem 0.55rem;
    }

    #main-actions .radius-caption {
        display: none;
    }

    #main-actions .radius-panel {
        margin-top: 4px;
        padding-top: 4px;
    }

    #main-actions .theme-selector-row--actions {
        margin: 0.3rem 0 0.1rem;
        padding-top: 0.2rem;
    }

    #main-actions .btn-hide-actions {
        margin-top: 0.3rem;
    }

    .bottom-sheet .btn.mt-1,
    .bottom-sheet .mt-1.btn {
        margin-top: 0.35rem;
    }

    .bottom-sheet h2 {
        margin-bottom: 0.4rem;
    }
}

body.admin-page {
    overflow: auto;
    height: auto;
    min-height: 100vh;
    display: block;
}

.admin-page [hidden] {
    display: none !important;
}

.admin-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 24px;
}

.admin-header h1 {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.admin-header p,
.admin-note p,
.admin-status {
    color: var(--text-secondary);
    line-height: 1.4;
}

.admin-note {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}

.admin-note .btn {
    text-decoration: none;
    width: auto;
}

.admin-login-card {
    max-width: 420px;
    width: 100%;
}

.admin-login-title {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.admin-login-lead {
    margin: 0;
}

.admin-login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.admin-login-form .admin-field-block {
    width: 100%;
}

.admin-login-form .admin-field-block input {
    width: 100%;
    box-sizing: border-box;
    background: var(--input-fill);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.admin-login-form .btn {
    width: 100%;
    margin-top: 4px;
}

.admin-logout-btn {
    width: auto;
}

#admin-login-error:not([hidden]) {
    display: block;
    width: 100%;
    margin: 0;
}

.admin-users {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.admin-user {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    text-align: left;
}

.admin-email {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    word-break: break-all;
}

.admin-field {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.92rem;
    margin-top: 6px;
}

.admin-label {
    color: var(--text-secondary);
}

.admin-toggle {
    width: 100%;
    margin-top: 14px;
}

.admin-history {
    margin-top: 14px;
}

.admin-history h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}

#chat-modal.fs-overlay {
    position: fixed !important;
    inset: 0;
    z-index: 6000 !important;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: var(--scrim);
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}

#chat-modal .chat-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    height: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    border: 1px solid var(--border);
    overflow: hidden;
    text-align: left;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}

#chat-modal .chat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    padding: calc(16px + env(safe-area-inset-top)) 20px 10px;
    border-bottom: 1px solid var(--hairline);
}

#chat-modal .chat-head h2 {
    margin: 0;
    font-size: 1.2rem;
}

#btn-close-chat,
#btn-send-chat,
#btn-open-chat-seller,
#btn-open-chat-buyer {
    touch-action: manipulation;
}

#btn-close-chat {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 8px;
    margin-left: -8px;
}

#chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--muted-fill);
}

#chat-messages .chat-note {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

#chat-form {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--hairline);
    background: var(--surface);
}

#chat-input {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    height: 45px;
    border-radius: 20px;
    padding: 0 16px;
    font-size: 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-main);
}

#btn-send-chat {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 50%;
    padding: 0;
    flex: 0 0 45px;
}

body.chat-open .bottom-sheet {
    pointer-events: none !important;
}

/* Planes y actividad Básico */
.profile-plan-block {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--muted-fill);
    text-align: left;
}

.profile-plan-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
}

.profile-plan-heading {
    margin: 0 0 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.profile-plan-name {
    margin: 0 0 4px;
    font-size: 1.1rem;
    font-weight: 700;
}

.profile-plan-access {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.profile-billing-block {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--muted-fill);
    text-align: left;
}

.profile-billing-plan-line {
    margin: 0 0 6px;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.35;
}

.profile-billing-plan-name {
    font-weight: 700;
}

.profile-billing-sub-status {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: var(--secondary);
    line-height: 1.35;
}

.profile-billing-hint {
    margin: 0 0 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.profile-billing-btn {
    margin-top: 2px;
    letter-spacing: 0.02em;
}

.profile-billing-helper {
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.profile-billing-error {
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: var(--danger);
    line-height: 1.35;
}

.profile-billing-period,
.profile-billing-pending {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: var(--secondary);
    line-height: 1.35;
}

/* .btn { display:flex } would otherwise paint [hidden] controls */
.profile-billing-block [hidden] {
    display: none !important;
}

.profile-plan-change {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 10px;
}

.profile-plan-change-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-billing-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 10px;
}

.profile-billing-subheading {
    margin: 12px 0 6px;
    font-size: 0.95rem;
    font-weight: 650;
    color: var(--text-primary);
}

.profile-billing-invoices-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.profile-billing-btn-inline {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 0.8rem;
}

.profile-billing-invoices-list {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
}

.profile-billing-invoices-list li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.profile-billing-invoices-list a {
    color: var(--secondary);
    text-decoration: underline;
}

.profile-withdrawal-reason {
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-primary);
    font: inherit;
    resize: vertical;
}

.plans-intro {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0 0 14px;
    text-align: left;
}

.plans-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 2px;
    text-align: left;
}

.plan-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    background: var(--muted-fill);
}

.plan-card-current {
    border-color: rgba(59, 130, 246, 0.55);
    background: rgba(59, 130, 246, 0.08);
}

.plan-card h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.plan-price {
    margin: 0 0 6px;
    font-weight: 700;
    color: var(--secondary);
}

.plan-access,
.plan-delay {
    margin: 0 0 4px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.plan-current-badge {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary);
}

.plan-hire-btn {
    margin-top: 10px;
    width: 100%;
}

.plans-manage-btn {
    margin-top: 12px;
    flex-shrink: 0;
}

.plans-billing-status {
    margin: 10px 0 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

/* Vertical spacing ~15% tighter vs prior 14/12/8/6; fonts + slider min-height 44px intact. */
.radius-panel {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    text-align: left;
}

.radius-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 7px;
}

.radius-title {
    margin: 0;
    font-size: 0.95rem;
}

.radius-value {
    font-weight: 700;
    color: var(--secondary);
    font-variant-numeric: tabular-nums;
}

.radius-panel input[type="range"] {
    width: 100%;
    accent-color: #38bdf8;
}

.radius-caption {
    margin: 5px 0 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.sim-user-marker {
    background: transparent;
}

/* Icono propio en NAVIGATING: variante local (no cambia .moving-car-icon global). */
.moving-car-icon--self-nav {
    background: transparent;
}

.moving-car-icon--self-nav .moving-car-self-nav {
    display: block;
    text-align: center;
}

/* REAL_USER: disco verde + coche + label fijo (sin matrícula). */
.real-user-marker {
    background: transparent;
}

.real-user-shell,
.sim-user-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 68px;
    pointer-events: auto;
    -webkit-user-select: none;
    user-select: none;
}

.real-user-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(22, 163, 74, 0.92);
    border: 2px solid #bbf7d0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.35), 0 2px 5px rgba(0, 0, 0, 0.35);
    animation: real-user-pulse 2.6s ease-out infinite;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.real-user-car {
    font-size: 16px;
    line-height: 1;
    display: block;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

/* SIM: SVG cenital rojo (look 🚗 previo) · size ≈ font-size 16 emoji · frontal = norte. */
.sim-user-car {
    display: block;
    width: 22px;
    height: 22px;
    overflow: visible;
    transform-origin: center center;
    will-change: transform;
    transition: transform 0.22s linear;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.sim-car-body {
    fill: #ef4444;
    stroke: #991b1b;
    stroke-width: 1.4;
}

.sim-car-glass {
    fill: #bae6fd;
}

.sim-car-glass-rear {
    fill: #7dd3fc;
}

.sim-car-wheel {
    fill: #0f172a;
}

.sim-car-nose {
    fill: #fbbf24;
}

.real-user-label {
    display: block;
    max-width: 68px;
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(134, 239, 172, 0.55);
    color: #ecfdf5;
    font-size: 0.50rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

@keyframes real-user-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.35), 0 2px 5px rgba(0, 0, 0, 0.35); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0), 0 2px 5px rgba(0, 0, 0, 0.35); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.35), 0 2px 5px rgba(0, 0, 0, 0.35); }
}

/* SIMULATED_USER: misma estructura que REAL; disco cyan/azul (diferencia inmediata). */
.sim-user-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(14, 165, 233, 0.92);
    border: 2px solid #bae6fd;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4), 0 2px 5px rgba(0, 0, 0, 0.35);
    animation: sim-pulse 2.4s ease-out infinite;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.sim-user-label {
    display: block;
    max-width: 68px;
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(125, 211, 252, 0.6);
    color: #e0f2fe;
    font-size: 0.50rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

@keyframes sim-pulse {
    0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4), 0 2px 5px rgba(0, 0, 0, 0.35); }
    70% { box-shadow: 0 0 0 8px rgba(14, 165, 233, 0), 0 2px 5px rgba(0, 0, 0, 0.35); }
    100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4), 0 2px 5px rgba(0, 0, 0, 0.35); }
}

/* 390 / 430: etiqueta legible sin tapar el mapa */
@media (max-width: 430px) {
    .real-user-shell,
    .sim-user-shell {
        width: 61px;
        gap: 1px;
    }

    .real-user-dot,
    .sim-user-dot {
        width: 25px;
        height: 25px;
    }

    .real-user-car {
        font-size: 14px;
    }

    .sim-user-car {
        width: 20px;
        height: 20px;
    }

    .real-user-label,
    .sim-user-label {
        max-width: 61px;
        font-size: 0.48rem;
        padding: 1px 4px;
    }
}

@media (max-width: 390px) {
    .real-user-shell,
    .sim-user-shell {
        width: 56px;
    }

    .real-user-label,
    .sim-user-label {
        max-width: 56px;
        font-size: 0.45rem;
    }
}

.sim-user-tip {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    max-width: 130px;
    font-size: 0.72rem;
    line-height: 1.15;
}

.sim-user-tip .sim-tip-line {
    color: #0f172a;
    font-weight: 700;
}

.sim-user-tip .sim-tip-plate {
    color: #334155;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Tip SIM solo visible tras openTooltip (atributo hidden en .gm-tip). */
.gm-html-marker[data-simulated="true"] .gm-tip[hidden] {
    display: none !important;
}

@media (max-width: 520px) {
    .sim-user-tip {
        max-width: 110px;
        font-size: 0.68rem;
    }

    .gm-html-marker .gm-tip {
        max-width: 110px;
    }
}

/* Dev-only: arrival GPS panel (invisible unless parkomArrivalDebug=1) */
.arrival-debug-hotspot {
    position: fixed;
    top: 0;
    right: 0;
    width: 48px;
    height: 48px;
    z-index: 1250;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    opacity: 0;
    -webkit-tap-highlight-color: transparent;
}

.arrival-debug-panel {
    position: fixed;
    top: 56px;
    right: 10px;
    z-index: 1240;
    width: min(280px, calc(100vw - 20px));
    max-height: 45vh;
    overflow: auto;
    padding: 0;
    border-radius: 10px;
    background: var(--panel-elevated);
    border: 1px solid rgba(251, 191, 36, 0.45);
    color: var(--text-main);
    font-size: 0.72rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.arrival-debug-panel[hidden] {
    display: none !important;
}

.arrival-debug-head {
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.arrival-debug-body {
    padding: 8px 10px 10px;
}

.arrival-debug-body[hidden] {
    display: none !important;
}

.arrival-debug-pre {
    margin: 0 0 6px;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-secondary);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.68rem;
    line-height: 1.35;
}

.arrival-debug-log {
    max-height: 18vh;
    overflow: auto;
    border-top: 1px solid var(--border);
    padding-top: 6px;
}

.arrival-debug-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.arrival-debug-actions .btn {
    padding: 6px 10px;
    font-size: 0.72rem;
    min-height: 0;
}

.arrival-debug-fallback {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-main);
    font-size: 0.65rem;
    resize: vertical;
}

.arrival-debug-fallback.hidden,
.arrival-debug-fallback[hidden] {
    display: none !important;
}

.sim-users-debug {
    position: fixed;
    top: 72px;
    left: 12px;
    z-index: 1200;
    max-width: min(320px, calc(100vw - 24px));
    max-height: 40vh;
    overflow: auto;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--panel-elevated);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--text-main);
    font-size: 0.75rem;
}

.sim-users-debug[hidden] {
    display: none !important;
}

.sim-users-debug h3 {
    margin: 0 0 6px;
    font-size: 0.85rem;
    color: #7dd3fc;
}

.sim-users-debug pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-secondary);
}

.admin-sim-debug {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.admin-sim-rules {
    margin: 8px 0 12px;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.admin-sim-sample {
    margin: 0;
    padding: 12px;
    border-radius: 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: #7dd3fc;
    font-size: 0.85rem;
    white-space: pre-wrap;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.admin-nav-btn.is-active {
    border-color: rgba(59, 130, 246, 0.6);
    color: var(--secondary);
}

.admin-section-title {
    font-size: 1.2rem;
    margin: 0 0 8px;
}

.admin-activity-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.admin-field-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: left;
}

.admin-field-block input,
.admin-field-block select,
.admin-band input,
.admin-band select {
    width: 100%;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-main);
    padding: 0 10px;
}

.admin-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

.admin-bands-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.admin-bands-head h3 {
    margin: 0;
    font-size: 1rem;
}

.admin-bands {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-band {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    background: var(--surface);
}

.admin-days {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}

.admin-day {
    font-size: 0.85rem;
    color: var(--text-main);
}

.admin-activity-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-plan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.admin-plan-btn {
    width: auto;
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.8rem;
}

.admin-plan-btn.is-current-plan {
    border-color: rgba(59, 130, 246, 0.65);
    color: var(--secondary);
}

.admin-status-error {
    color: var(--danger);
}

.admin-entitlement-note {
    margin: 8px 0 12px;
    padding: 10px 12px;
    border-left: 3px solid var(--secondary, #3b82f6);
    background: var(--muted-fill, rgba(127, 127, 127, 0.12));
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-main);
}

.admin-entitlement-note code {
    font-size: 0.82em;
}

.admin-plan-dialog {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    max-width: min(520px, calc(100vw - 24px));
    width: 100%;
    background: var(--bg, #12141a);
    color: var(--text-main);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.admin-plan-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.admin-plan-dialog-form {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-plan-dialog-form h2 {
    margin: 0;
    font-size: 1.15rem;
}

.admin-plan-dialog-summary {
    font-size: 0.9rem;
    line-height: 1.4;
}

.admin-plan-dialog-summary p {
    margin: 0 0 6px;
}

.admin-plan-duration {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    display: grid;
    gap: 8px;
}

.admin-plan-duration legend {
    padding: 0 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.admin-plan-duration label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}

.admin-plan-custom-date {
    margin-top: 4px;
}

.admin-plan-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
}

#admin-plan-reason {
    width: 100%;
    resize: vertical;
    min-height: 72px;
}

@media (max-width: 560px) {
    .admin-grid-2 {
        grid-template-columns: 1fr;
    }

    .profile-plan-row {
        flex-direction: column;
    }
}

/* Theme selector — compact segmented control (profile + Admin) */
.theme-selector-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 14px;
    text-align: left;
}

/* Menú de acciones: mismo control que perfil (ParkomTheme.bind). */
#main-actions .theme-selector-row--actions {
    margin: 0.75rem 0 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--hairline);
}

.theme-selector-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex: 1 1 auto;
    min-width: 0;
}

.theme-selector-label [data-theme-live] {
    color: var(--text-main);
    font-weight: 700;
}

.theme-selector {
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--muted-fill);
    padding: 2px;
    max-width: 100%;
}

.theme-option {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    margin: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
    min-height: 32px;
    transition: background 0.15s ease, color 0.15s ease;
}

.theme-option:hover {
    color: var(--text-main);
}

.theme-option.is-active,
.theme-option[aria-pressed="true"] {
    background: var(--surface);
    color: var(--text-main);
    box-shadow: var(--shadow-down);
}

.theme-option:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

.admin-header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.admin-header .theme-selector-row {
    margin: 0;
    justify-content: flex-end;
}

.profile-vehicle-block {
    background: var(--muted-fill);
    padding: 12px 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
}

@media (max-width: 430px) {
    .theme-selector-row {
        flex-wrap: wrap;
    }

    .theme-option {
        padding: 6px 8px;
        font-size: 0.74rem;
    }
}


/* —— Admin dashboard FASE 3A (read-only) —— */
.admin-readonly-banner {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--muted-fill);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: left;
}

.admin-readonly-banner strong {
    color: var(--text-main);
}

.admin-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.admin-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 12px 10px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 84px;
}

.admin-kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.admin-kpi-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.admin-kpi-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.admin-dist {
    margin-bottom: 18px;
    text-align: left;
}

.admin-dist-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.admin-dist-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    text-align: left;
}

.admin-dist-card h3 {
    margin: 0 0 6px;
    font-size: 0.95rem;
}

.admin-dist-users,
.admin-dist-pct,
.admin-dist-mrr {
    margin: 2px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.admin-dist-bar {
    margin-top: 8px;
    height: 6px;
    border-radius: 999px;
    background: var(--muted-fill-3);
    overflow: hidden;
}

.admin-dist-bar span {
    display: block;
    height: 100%;
    background: var(--secondary);
}

.admin-dist-plus_30 .admin-dist-bar span { background: #38bdf8; }
.admin-dist-pro_15 .admin-dist-bar span { background: var(--primary); }
.admin-dist-live .admin-dist-bar span { background: var(--attention); }

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 8px 0 10px;
}

.admin-search {
    width: min(320px, 100%);
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-main);
    padding: 0 12px;
}

.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.admin-filters select {
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-main);
    padding: 0 10px;
}

.admin-filter-override {
    margin-left: 4px;
}

.admin-local-note {
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
    font-size: 0.84rem;
    text-align: left;
}

.admin-table th,
.admin-table td {
    padding: 10px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--muted-fill);
}

.admin-user-row:hover {
    background: var(--surface-hover);
}

.admin-user-row.is-expanded {
    background: var(--muted-fill-2);
}

.admin-col-email {
    word-break: break-all;
    max-width: 200px;
}

.admin-expand-btn {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--muted-fill);
    color: var(--text-main);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.admin-badge {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--muted-fill);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.admin-badge-admin,
.admin-badge-source-admin {
    border-color: rgba(245, 158, 11, 0.45);
    color: var(--attention);
}

.admin-badge-source-stripe {
    border-color: rgba(59, 130, 246, 0.45);
    color: var(--secondary);
}

.admin-badge-status-active,
.admin-badge-status-trialing {
    border-color: rgba(74, 222, 128, 0.45);
    color: var(--primary);
}

.admin-badge-status-past_due {
    border-color: rgba(245, 158, 11, 0.5);
    color: var(--attention);
}

.admin-badge-status-canceling {
    border-color: rgba(245, 158, 11, 0.55);
    color: var(--attention);
}

.admin-badge-status-canceled {
    border-color: rgba(239, 68, 68, 0.45);
    color: var(--danger);
}

.admin-user-detail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 8px 4px 14px;
    text-align: left;
}

.admin-detail-block {
    background: var(--muted-fill);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.admin-detail-block h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.admin-user-detail .admin-detail-block:nth-child(n+5) {
    grid-column: 1 / -1;
}

.admin-timeline {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-timeline-item {
    border-left: 3px solid var(--border);
    padding: 0 0 0 10px;
}

.admin-timeline-item.source-stripe {
    border-left-color: var(--secondary);
}

.admin-timeline-item.source-admin {
    border-left-color: var(--attention);
}

.admin-timeline-item.source-system {
    border-left-color: var(--text-secondary);
}

.admin-timeline-when {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.admin-timeline-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-timeline-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.admin-plan-btn:disabled,
.admin-plan-actions .btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* FASE 1 — resumen actividad + CSV */
.admin-activity-summary {
    margin: 1rem 0 1.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border, rgba(148, 163, 184, 0.25));
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface, #161a22) 92%, transparent);
}

.admin-summary-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.admin-summary-item {
    display: grid;
    grid-template-columns: 6.5rem minmax(8rem, 1.2fr) minmax(5rem, 0.6fr) minmax(10rem, 1.6fr);
    gap: 0.5rem 0.75rem;
    align-items: baseline;
    font-size: 0.84rem;
}

.admin-summary-label {
    color: var(--text-primary, inherit);
}

.admin-summary-value {
    font-weight: 650;
}

.admin-summary-note {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.78rem;
}

.admin-kind {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    width: fit-content;
}

.admin-kind-persisted {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
}

.admin-kind-derived {
    background: rgba(59, 130, 246, 0.16);
    color: #60a5fa;
}

.admin-kind-absent {
    background: rgba(148, 163, 184, 0.16);
    color: #94a3b8;
}

.admin-export-btn {
    margin-left: 0.25rem;
    white-space: nowrap;
}

.admin-ops-timeline {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    max-height: 28rem;
    overflow: auto;
}

.admin-ops-timeline .admin-timeline-item {
    padding: 0.55rem 0.75rem;
    border-left: 3px solid var(--border, #475569);
    margin-bottom: 0.4rem;
}

@media (max-width: 900px) {
    .admin-summary-item {
        grid-template-columns: 5.5rem 1fr;
    }

    .admin-summary-value,
    .admin-summary-note {
        grid-column: 1 / -1;
    }

    .admin-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-dist-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-user-detail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .admin-kpis {
        grid-template-columns: 1fr 1fr;
    }

    .admin-dist-grid {
        grid-template-columns: 1fr;
    }

    .admin-search {
        width: 100%;
    }

    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-filters {
        width: 100%;
    }

    .admin-filters select {
        flex: 1 1 auto;
        min-width: 0;
    }
}
