    :root {
        --primary: #243447;
        --primary-light: #32465f;
        --secondary: #1b2733;
        --accent: #243447;
        --accent-hover: #32465f;
        --gold: #c9a961;
        --gold-hover: #b8954a;
        --white: #fff;
        --off-white: #f7f6f3;
        --gray-50: #fafaf8;
        --gray-100: #f1f0ec;
        --gray-200: #e6e4de;
        --gray-300: #d6d3ca;
        --gray-400: #b8b4a8;
        --gray-500: #8f8b7e;
        --gray-600: #6b6760;
        --gray-700: #3d4349;
        --success: #3a7d5c;
        --danger: #c0473a;
        --reserved: #7d6699;
        --sold: #c0473a;
        --shadow-sm: 0 2px 8px rgba(36, 52, 71, .06);
        --shadow-md: 0 4px 16px rgba(36, 52, 71, .1);
        --shadow-lg: 0 8px 32px rgba(36, 52, 71, .14);
        --radius-sm: 8px;
        --radius-md: 12px;
        --radius-lg: 16px;
        --radius-xl: 24px;
        --radius-full: 50px
    }

    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box
    }

    html,
    body {
        overflow-x: hidden;
        width: 100%
    }

    body {
        font-family: 'Jost', sans-serif;
        background: var(--off-white);
        color: var(--gray-700);
        line-height: 1.6
    }

    h1,
    h2,
    h3 {
        font-family: 'Cormorant Garamond', serif;
        color: var(--primary)
    }

    a {
        text-decoration: none;
        color: inherit
    }

    button {
        cursor: pointer;
        font-family: inherit;
        border: none
    }

    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px
    }

    .hidden {
        display: none !important
    }

    .header {
        background: var(--white);
        box-shadow: var(--shadow-sm);
        position: sticky;
        top: 0;
        z-index: 100
    }

    .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 0;
        flex-wrap: wrap;
        gap: 16px
    }

    .logo {
        display: flex;
        align-items: center;
        gap: 13px;
        color: var(--primary);
        cursor: pointer
    }

    .logo-img {
        height: 50px;
        width: auto
    }

    .logo-text {
        height: 23px;
        width: auto;
        margin-top: 5px
    }

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

    .nav a,
    .nav button {
        padding: 10px 20px;
        border-radius: var(--radius-md);
        font-weight: 500;
        transition: all .3s;
        background: none;
        font-size: 14px
    }

    .nav a:hover {
        background: var(--gray-100)
    }

    .agent-access {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        padding: 9px 18px;
        background: transparent;
        color: var(--gray-500);
        border: 1px solid var(--gray-300);
        border-radius: var(--radius-full);
        font-family: 'Jost', sans-serif;
        font-size: 13px;
        font-weight: 500;
        letter-spacing: .02em;
        transition: all .25s
    }

    .agent-access i {
        font-size: 11px
    }

    .agent-access:hover {
        background: var(--primary);
        color: var(--white);
        border-color: var(--primary)
    }

    .btn-primary {
        background: var(--accent) !important;
        color: var(--white) !important
    }

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md)
    }

    .btn-secondary {
        background: transparent !important;
        color: var(--accent) !important;
        border: 2px solid var(--accent) !important
    }

    .btn-secondary:hover {
        background: var(--accent) !important;
        color: var(--white) !important
    }

    .user-info {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 8px 16px;
        background: var(--gray-100);
        border-radius: var(--radius-full);
        cursor: pointer;
        transition: all .3s;
        position: relative
    }

    .user-info:hover {
        background: var(--gray-200)
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent), var(--gold));
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        color: var(--white);
        font-weight: 600
    }

    .user-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover
    }

    .admin-badge {
        background: var(--gold);
        color: var(--white);
        padding: 4px 10px;
        border-radius: var(--radius-full);
        font-size: 11px;
        font-weight: 600
    }

    .logout-btn {
        background: var(--gray-200) !important;
        color: var(--gray-700) !important
    }

    .user-dropdown {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        width: 220px;
        background: var(--white);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        overflow: hidden;
        display: none;
        z-index: 1000
    }

    .user-dropdown.active {
        display: block;
        animation: slideDown .2s ease
    }

    .user-dropdown-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        color: var(--gray-700);
        transition: all .2s;
        cursor: pointer;
        border-bottom: 1px solid var(--gray-100)
    }

    .user-dropdown-item:last-child {
        border-bottom: none
    }

    .user-dropdown-item:hover {
        background: var(--gray-50);
        color: var(--accent)
    }

    .user-dropdown-item i {
        width: 20px;
        text-align: center;
        color: var(--gray-500)
    }

    .user-dropdown-item:hover i {
        color: var(--accent)
    }

    .notification-bell,
    .calendar-btn {
        position: relative;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--gray-100);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all .3s
    }

    .notification-bell:hover,
    .calendar-btn:hover {
        background: var(--gray-200);
        transform: scale(1.05)
    }

    .notification-bell i,
    .calendar-btn i {
        font-size: 20px;
        color: var(--gray-600)
    }

    .notification-bell.has-unread i {
        color: var(--accent)
    }

    .calendar-btn.has-events i {
        color: var(--gold)
    }

    .notification-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 22px;
        height: 22px;
        background: var(--accent);
        color: var(--white);
        font-size: 11px;
        font-weight: 700;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 6px;
        border: 2px solid var(--white);
        animation: pulse 2s infinite
    }

    @keyframes pulse {

        0%,
        100% {
            transform: scale(1)
        }

        50% {
            transform: scale(1.1)
        }
    }

    .notification-dropdown {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        width: 380px;
        max-height: 500px;
        background: var(--white);
        border-radius: var(--radius-lg);
        box-shadow: 0 10px 40px rgba(0, 0, 0, .15);
        overflow: hidden;
        display: none;
        z-index: 1001
    }

    .notification-dropdown.active {
        display: block;
        animation: slideDown .2s ease
    }

    .notification-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, .3);
        z-index: 9998
    }

    .notification-overlay.active {
        display: block
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px)
        }

        to {
            opacity: 1;
            transform: translateY(0)
        }
    }

    .notification-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid var(--gray-100);
        background: var(--gray-50)
    }

    .notification-header h3 {
        font-size: 16px;
        font-family: 'Jost', sans-serif;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 8px
    }

    .notification-header h3 i {
        color: var(--accent)
    }

    .notification-actions {
        display: flex;
        gap: 8px
    }

    .notification-actions button {
        background: none;
        color: var(--accent);
        font-size: 12px;
        font-weight: 500;
        padding: 4px 8px;
        border-radius: var(--radius-sm);
        transition: all .2s
    }

    .notification-actions button:hover {
        background: rgba(36, 52, 71, .1)
    }

    .notification-actions .btn-clear {
        color: var(--danger)
    }

    .notification-actions .btn-clear:hover {
        background: rgba(192, 71, 58, .1)
    }

    .notification-list {
        max-height: 400px;
        overflow-y: auto
    }

    .notification-item {
        display: flex;
        gap: 12px;
        padding: 16px 20px;
        border-bottom: 1px solid var(--gray-100);
        cursor: pointer;
        transition: background .2s;
        position: relative
    }

    .notification-item:hover {
        background: var(--gray-50)
    }

    .notification-item.unread {
        background: rgba(36, 52, 71, .08)
    }

    .notification-item.unread::after {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: var(--accent)
    }

    .notification-avatar {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent), var(--gold));
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        overflow: hidden;
        font-weight: 600;
        color: var(--white);
        font-size: 18px
    }

    .notification-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover
    }

    .notification-body {
        flex: 1;
        min-width: 0
    }

    .notification-body p {
        font-size: 14px;
        color: var(--gray-700);
        margin-bottom: 6px;
        line-height: 1.4
    }

    .notification-body p strong {
        color: var(--primary)
    }

    .notification-message {
        font-size: 13px;
        color: var(--gray-500);
        background: var(--gray-100);
        padding: 8px 12px;
        border-radius: var(--radius-sm);
        margin-bottom: 8px;
        border-left: 3px solid var(--accent)
    }

    .notification-meta {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 12px;
        color: var(--gray-400)
    }

    .notification-phone {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        color: #25D366;
        font-weight: 500
    }

    .notification-empty {
        text-align: center;
        padding: 60px 20px;
        color: var(--gray-400)
    }

    .notification-empty i {
        font-size: 48px;
        margin-bottom: 16px;
        opacity: .5
    }

    .btn-new-property {
        display: inline-flex;
        align-items: center;
        gap: 12px;
        padding: 14px 28px;
        background: linear-gradient(135deg, var(--accent) 0%, #ff6b8a 50%, var(--gold) 100%);
        background-size: 200% 200%;
        color: var(--white);
        font-size: 15px;
        font-weight: 600;
        border-radius: var(--radius-full);
        box-shadow: 0 4px 15px rgba(36, 52, 71, .4);
        transition: all .4s cubic-bezier(.175, .885, .32, 1.275);
        position: relative;
        overflow: hidden
    }

    .btn-new-property:hover {
        transform: translateY(-3px) scale(1.02);
        box-shadow: 0 8px 25px rgba(36, 52, 71, .5)
    }

    .btn-new-property i {
        font-size: 18px;
        transition: transform .3s
    }

    .btn-new-property:hover i {
        transform: rotate(90deg)
    }

    .hero {
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        padding: 80px 0;
        text-align: center;
        color: var(--white)
    }

    .hero h1 {
        font-size: 48px;
        margin-bottom: 16px;
        color: var(--white)
    }

    .hero h1 span {
        color: var(--gold)
    }

    .hero p {
        font-size: 18px;
        opacity: .9;
        max-width: 600px;
        margin: 0 auto 32px
    }

    .hero-stats {
        display: flex;
        justify-content: center;
        gap: 48px;
        margin-top: 40px;
        flex-wrap: wrap
    }

    .hero-stat {
        text-align: center
    }

    .hero-stat-number {
        font-size: 36px;
        font-weight: 700;
        font-family: 'Cormorant Garamond', serif
    }

    .hero-stat-label {
        font-size: 14px;
        opacity: .8
    }

    .hero-buttons {
        display: flex;
        gap: 16px;
        justify-content: center;
        margin-bottom: 40px;
        flex-wrap: wrap
    }

    .hero-btn {
        padding: 16px 32px;
        border-radius: var(--radius-lg);
        font-size: 18px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 10px;
        transition: all .3s
    }

    .hero-btn-primary {
        background: var(--gold);
        color: var(--primary)
    }

    .hero-btn-primary:hover {
        background: #b8954a;
        transform: translateY(-3px)
    }

    .hero-btn-secondary {
        background: rgba(255, 255, 255, .15);
        color: var(--white);
        border: 2px solid var(--white)
    }

    .hero-btn-secondary:hover {
        background: var(--white);
        color: var(--primary)
    }

    .filters {
        background: var(--white);
        padding: 24px;
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-md);
        margin: -40px auto 40px;
        max-width: 1000px;
        position: relative;
        z-index: 10
    }

    .filters-row {
        display: grid;
        grid-template-columns: 2fr 1fr 1fr 1fr auto;
        gap: 16px;
        align-items: end
    }

    .filter-group label {
        display: block;
        font-size: 12px;
        font-weight: 600;
        color: var(--gray-600);
        margin-bottom: 6px;
        text-transform: uppercase
    }

    .filter-group input,
    .filter-group select {
        width: 100%;
        padding: 12px 16px;
        border: 2px solid var(--gray-200);
        border-radius: var(--radius-md);
        font-size: 14px;
        transition: all .3s
    }

    .filter-group input:focus,
    .filter-group select:focus {
        border-color: var(--accent);
        outline: none
    }

    .filter-btn {
        padding: 12px 28px;
        background: var(--accent);
        color: var(--white);
        border-radius: var(--radius-md);
        font-weight: 600;
        transition: all .3s
    }

    .filter-btn:hover {
        background: var(--accent-hover)
    }

    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 32px;
        flex-wrap: wrap;
        gap: 16px
    }

    .section-title {
        font-size: 32px;
        margin-bottom: 0
    }

    .section-subtitle {
        color: var(--gray-500);
        margin-top: 4px
    }

    .properties-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 22px;
        margin-bottom: 60px
    }

    .property-card {
        background: var(--white);
        border-radius: var(--radius-xl);
        overflow: hidden;
        box-shadow: var(--shadow-sm);
        transition: all .3s;
        cursor: pointer;
        position: relative
    }

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

    /* El marco habla el mismo idioma que la banda de la foto:
       - Reservada: azul marino suave (su banda es la liviana, con filete blanco)
       - Vendida/Alquilada: el dorado sereno de los filetes (cierre, historia ganada)
       - Archivada: casi nada, se retira del escenario
       Ojo: es el dorado antiguo de la marca (#C9A227), no el amarillo brillante
       de las destacadas — jerarquías distintas, tonos distintos. */
    .property-card.status-reserved {
        border: 2px solid rgba(22, 39, 63, .25);
    }

    .property-card.status-sold,
    .property-card.status-rented {
        border: 2px solid rgba(201, 162, 39, .55);
    }

    .property-card.status-archived {
        border: 2px solid rgba(22, 39, 63, .15);
        opacity: .75;
    }

    .card-image {
        position: relative;
        height: 220px;
        overflow: hidden
    }

    .card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform .5s
    }

    .property-card:hover .card-image img {
        transform: scale(1.05)
    }

    /* ---- Estado de la propiedad (Reservada / Vendida / Alquilada) ----
       Tratamiento sobrio acorde a la estética del sitio: velo azul marino
       sobre la foto, banda horizontal con filetes dorados y tipografía
       espaciada. Nada de cintas diagonales: el lujo no grita. */
    .property-status-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 5;
        pointer-events: none;
        background: linear-gradient(168deg, rgba(22, 39, 63, .16), rgba(22, 39, 63, .44));
    }

    .property-status-overlay.reserved {
        background: linear-gradient(168deg, rgba(22, 39, 63, .10), rgba(22, 39, 63, .30));
    }

    .property-status-overlay.archived,
    .property-status-overlay.cerrado_externo {
        background: linear-gradient(168deg, rgba(22, 39, 63, .30), rgba(22, 39, 63, .55));
    }

    .status-ribbon {
        width: 100%;
        text-align: center;
        padding: 11px 8px;
        font-family: 'Jost', sans-serif;
        font-size: .82rem;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: .45em;
        text-indent: .45em; /* compensa el espaciado para centrar la palabra */
        color: #fff;
        background: rgba(14, 25, 43, .48);
        border-top: 1px solid rgba(201, 162, 39, .85);
        border-bottom: 1px solid rgba(201, 162, 39, .85);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        text-shadow: 0 1px 8px rgba(10, 20, 35, .5);
        transform: none;
    }

    /* Reservada: todavía puede volver al mercado; la banda es más liviana */
    .status-ribbon.reserved {
        background: rgba(14, 25, 43, .34);
        border-top-color: rgba(255, 255, 255, .55);
        border-bottom-color: rgba(255, 255, 255, .55);
    }

    .status-ribbon.sold,
    .status-ribbon.rented {
        background: rgba(14, 25, 43, .52);
    }

    .status-ribbon.archived,
    .status-ribbon.cerrado_externo {
        background: rgba(14, 25, 43, .6);
        border-top-color: rgba(255, 255, 255, .3);
        border-bottom-color: rgba(255, 255, 255, .3);
    }

    /* La foto se apaga con elegancia cuando la propiedad ya no está disponible */
    .property-card.status-sold .card-image img,
    .property-card.status-rented .card-image img {
        filter: grayscale(.55) brightness(.92);
    }

    .property-card.status-archived .card-image img {
        filter: grayscale(.85) brightness(.85);
    }

    @media (max-width: 640px) {
        .status-ribbon {
            font-size: .74rem;
            letter-spacing: .38em;
            text-indent: .38em;
            padding: 9px 6px;
        }
    }

    .card-badges {
        position: absolute;
        top: 16px;
        left: 16px;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        z-index: 6
    }

    .badge {
        padding: 6px 14px;
        border-radius: var(--radius-full);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase
    }

    .badge-sale {
        background: linear-gradient(135deg, var(--accent), #ff6b6b);
        color: var(--white)
    }

    .badge-rent {
        background: linear-gradient(135deg, #3498db, #2ecc71);
        color: var(--white)
    }

    .badge-ph {
        background: var(--gold);
        color: var(--white)
    }

    .badge-currency {
        background: var(--primary);
        color: var(--white)
    }

    .badge-garage {
        background: #6c5ce7;
        color: var(--white)
    }

    .badge-reserved {
        background: var(--reserved);
        color: var(--white)
    }

    .badge-sold {
        background: var(--sold);
        color: var(--white)
    }

    .badge-rented {
        background: #3498db;
        color: var(--white)
    }

    .badge-archived {
        background: #7f8c8d;
        color: var(--white)
    }

    .badge-reduced {
        background: var(--success);
        color: #fff;
        font-weight: 700;
        text-shadow: 0 1px 2px rgba(0, 0, 0, .2)
    }

    .badge-featured {
        background: linear-gradient(135deg, #f1c40f, #f39c12);
        color: #fff;
        font-weight: 700;
        animation: pulseFeature 2s ease-in-out infinite
    }

    .property-card.featured {
        border: 3px solid #f1c40f;
        box-shadow: 0 8px 32px rgba(241, 196, 15, .3)
    }

    .property-card.featured::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #f1c40f, #f39c12, #f1c40f);
        z-index: 10
    }

    @keyframes pulseFeature {

        0%,
        100% {
            box-shadow: 0 0 0 0 rgba(241, 196, 15, .5)
        }

        50% {
            box-shadow: 0 0 12px 4px rgba(241, 196, 15, .3)
        }
    }

    @keyframes flashBadge {

        0%,
        100% {
            box-shadow: 0 0 0 0 rgba(46, 204, 113, .6)
        }

        50% {
            box-shadow: 0 0 8px 2px rgba(46, 204, 113, .4)
        }
    }

    .card-actions {
        position: absolute;
        top: 12px;
        right: 12px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        opacity: 0;
        transition: opacity .3s;
        z-index: 10;
        background: rgba(255, 255, 255, .95);
        padding: 6px;
        border-radius: var(--radius-full);
        box-shadow: var(--shadow-sm)
    }

    .property-card:hover .card-actions {
        opacity: 1
    }

    .card-action-btn {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--white);
        color: var(--gray-600);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        transition: all .3s;
        box-shadow: none;
        border: 1px solid var(--gray-200)
    }

    .card-action-btn:hover {
        transform: scale(1.1)
    }

    .card-action-btn.edit:hover {
        background: #3498db;
        color: white;
        border-color: #3498db
    }

    .card-action-btn.delete:hover {
        background: var(--danger);
        color: white;
        border-color: var(--danger)
    }

    .card-action-btn.calendar:hover {
        background: var(--gold);
        color: white;
        border-color: var(--gold)
    }

    .btn-feature {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--white);
        color: var(--gray-400);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        transition: all .3s;
        border: 1px solid var(--gray-200);
        cursor: pointer
    }

    .btn-feature:hover {
        background: #f1c40f;
        color: white;
        transform: scale(1.1);
        border-color: #f1c40f
    }

    .btn-feature.active {
        background: linear-gradient(135deg, #f1c40f, #f39c12);
        color: white;
        border-color: #f1c40f
    }

    .card-owner {
        position: absolute;
        bottom: 12px;
        left: 12px;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 12px;
        background: rgba(0, 0, 0, .6);
        backdrop-filter: blur(10px);
        border-radius: var(--radius-full);
        color: var(--white);
        font-size: 12px;
        cursor: pointer;
        transition: all .3s;
        z-index: 6
    }

    .card-owner:hover {
        background: rgba(0, 0, 0, .8)
    }

    .card-owner img {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        object-fit: cover
    }

    .card-owner-initial {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent), var(--gold));
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 11px
    }

    .card-content {
        padding: 15px 16px 14px
    }

    .card-price {
        font-family: 'Cormorant Garamond', serif;
        font-size: 23px;
        font-weight: 700;
        color: var(--accent);
        margin-bottom: 4px
    }

    .card-price span {
        font-size: 14px;
        color: var(--gray-500);
        font-weight: 400
    }

    .card-price .price-drop-badge {
        font-size: 11px;
        color: #fff !important;
        font-weight: 700
    }

    .card-price-old {
        font-size: 14px;
        color: var(--gray-400);
        text-decoration: line-through;
        margin-right: 10px;
        font-weight: 400
    }

    .card-price-reduced {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap
    }

    .price-drop-badge {
        background: var(--success);
        color: #fff;
        padding: 4px 10px;
        border-radius: var(--radius-full);
        font-size: 12px;
        font-weight: 700;
        text-shadow: 0 1px 2px rgba(0, 0, 0, .3)
    }

    .card-title {
        font-size: 16px;
        font-weight: 600;
        color: var(--primary);
        line-height: 1.35;
        margin-bottom: 5px
    }

    .card-location {
        display: flex;
        align-items: center;
        gap: 6px;
        color: var(--gray-500);
        font-size: 13px;
        margin-bottom: 10px
    }

    .card-location i {
        color: var(--accent)
    }

    .card-features {
        display: flex;
        gap: 12px;
        padding-top: 11px;
        border-top: 1px solid var(--gray-100);
        flex-wrap: wrap
    }

    .card-feature {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 13px;
        color: var(--gray-600)
    }

    .card-feature i {
        color: var(--gray-400)
    }

    .card-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 16px;
        background: var(--gray-50);
        border-top: 1px solid var(--gray-100)
    }

    .card-views {
        font-size: 13px;
        color: var(--gray-500)
    }

    .btn-share {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        background: var(--gray-200);
        color: var(--gray-600);
        border-radius: var(--radius-md);
        font-size: 14px;
        transition: all .3s
    }

    .btn-share:hover {
        background: var(--primary);
        color: var(--white);
        transform: scale(1.05)
    }

    .btn-whatsapp {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 18px;
        background: #25D366;
        color: var(--white);
        border-radius: var(--radius-md);
        font-size: 13px;
        font-weight: 600;
        transition: all .3s
    }

    .btn-whatsapp:hover {
        background: #128C7E;
        transform: scale(1.05)
    }

    .btn-instagram {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 14px;
        background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
        color: var(--white);
        border-radius: var(--radius-md);
        font-size: 13px;
        font-weight: 600;
        transition: all .3s
    }

    .btn-instagram:hover {
        transform: scale(1.05);
        filter: brightness(1.1)
    }

    .share-modal .modal-content {
        max-width: 400px
    }

    .share-options {
        display: flex;
        flex-direction: column;
        gap: 12px
    }

    .share-option {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px;
        background: var(--gray-50);
        border-radius: var(--radius-md);
        cursor: pointer;
        transition: all .2s
    }

    .share-option:hover {
        background: var(--gray-100);
        transform: translateX(4px)
    }

    .share-option i {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        color: white
    }

    .share-option.whatsapp i {
        background: #25D366
    }

    .share-option.facebook i {
        background: #1877F2
    }

    .share-option.twitter i {
        background: #1DA1F2
    }

    .share-option.copy i {
        background: var(--primary)
    }

    .share-option span {
        font-weight: 500;
        color: var(--gray-700)
    }

    .share-url {
        display: flex;
        gap: 8px;
        margin-top: 16px;
        padding: 12px;
        background: var(--gray-100);
        border-radius: var(--radius-md)
    }

    .share-url input {
        flex: 1;
        background: none;
        border: none;
        font-size: 13px;
        color: var(--gray-600)
    }

    .share-url button {
        padding: 8px 16px;
        background: var(--accent);
        color: white;
        border-radius: var(--radius-sm);
        font-size: 12px;
        font-weight: 600
    }

    .modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, .6);
        backdrop-filter: blur(4px);
        z-index: 1000;
        align-items: center;
        justify-content: center;
        padding: 20px;
        overflow-y: auto
    }

    .modal.active {
        display: flex
    }

    .modal-content {
        background: var(--white);
        border-radius: var(--radius-xl);
        max-width: 500px;
        width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        animation: slideIn .3s ease;
        margin: auto
    }

    @keyframes slideIn {
        from {
            transform: translateY(-20px);
            opacity: 0
        }

        to {
            transform: translateY(0);
            opacity: 1
        }
    }

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

    .modal-header h2 {
        font-size: 24px
    }

    .modal-close {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--gray-100);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        color: var(--gray-600);
        transition: all .3s
    }

    .modal-close:hover {
        background: var(--gray-200)
    }

    .modal-body {
        padding: 24px
    }

    .form-group {
        margin-bottom: 20px
    }

    .form-group label {
        display: block;
        font-weight: 600;
        margin-bottom: 8px;
        color: var(--gray-700)
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 14px 16px;
        border: 2px solid var(--gray-200);
        border-radius: var(--radius-md);
        font-size: 15px;
        transition: all .3s;
        font-family: inherit
    }

    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-color: var(--accent);
        outline: none
    }

    .form-group small {
        display: block;
        margin-top: 6px;
        color: var(--gray-500);
        font-size: 12px
    }

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

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

    .form-row-4 {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr;
        gap: 16px;
        align-items: start
    }

    .form-row-4 .form-group label {
        min-height: 38px;
        display: flex;
        align-items: flex-end;
        line-height: 1.3
    }

    .form-error {
        background: rgba(192, 71, 58, .1);
        color: var(--danger);
        padding: 12px 16px;
        border-radius: var(--radius-md);
        margin-bottom: 20px;
        font-size: 14px
    }

    .form-success {
        background: rgba(46, 204, 113, .1);
        color: var(--success);
        padding: 12px 16px;
        border-radius: var(--radius-md);
        margin-bottom: 20px;
        font-size: 14px
    }

    .btn-submit {
        width: 100%;
        padding: 14px;
        background: linear-gradient(135deg, var(--accent), var(--gold));
        color: var(--white);
        border-radius: var(--radius-md);
        font-size: 16px;
        font-weight: 600;
        transition: all .3s;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px
    }

    .btn-submit:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md)
    }

    .btn-submit:disabled {
        opacity: .6;
        cursor: not-allowed;
        transform: none
    }

    .modal-footer {
        padding: 16px 24px;
        border-top: 1px solid var(--gray-100);
        text-align: center;
        color: var(--gray-500);
        font-size: 14px
    }

    .modal-footer a {
        color: var(--accent);
        font-weight: 600;
        cursor: pointer
    }

    .checkbox-group {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 20px
    }

    .checkbox-group input[type="checkbox"] {
        width: 20px;
        height: 20px;
        accent-color: var(--accent);
        cursor: pointer
    }

    .checkbox-group label {
        font-weight: 500;
        color: var(--gray-600);
        cursor: pointer;
        margin-bottom: 0
    }

    .image-upload-area {
        border: 2px dashed var(--gray-300);
        border-radius: var(--radius-lg);
        padding: 30px;
        text-align: center;
        cursor: pointer;
        transition: all .3s;
        background: var(--gray-50)
    }

    .image-upload-area:hover {
        border-color: var(--accent);
        background: rgba(36, 52, 71, .05)
    }

    .image-upload-area.dragover {
        border-color: var(--accent);
        background: rgba(36, 52, 71, .1)
    }

    .image-upload-area i {
        font-size: 48px;
        color: var(--gray-400);
        margin-bottom: 16px
    }

    .image-upload-area p {
        color: var(--gray-600);
        margin-bottom: 8px
    }

    .image-upload-area small {
        color: var(--gray-400)
    }

    .image-preview-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 12px;
        margin-top: 16px
    }

    .image-preview-item {
        position: relative;
        aspect-ratio: 1;
        border-radius: var(--radius-md);
        overflow: hidden;
        box-shadow: var(--shadow-sm);
        cursor: grab;
        transition: all .2s;
        border: 2px solid transparent
    }

    .image-preview-item:hover {
        border-color: var(--accent)
    }

    .image-preview-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        pointer-events: none
    }

    .image-preview-item .remove-image {
        position: absolute;
        top: 4px;
        right: 4px;
        width: 24px;
        height: 24px;
        background: var(--danger);
        color: var(--white);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        cursor: pointer;
        opacity: 0;
        transition: all .3s
    }

    .image-preview-item:hover .remove-image {
        opacity: 1
    }

    .image-preview-item.main::after {
        content: 'Principal';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--gold);
        color: var(--white);
        font-size: 9px;
        padding: 3px;
        text-align: center;
        font-weight: 600
    }

    .image-preview-item .drag-handle {
        position: absolute;
        top: 4px;
        left: 4px;
        width: 24px;
        height: 24px;
        background: rgba(0, 0, 0, .5);
        color: var(--white);
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        opacity: 0;
        transition: all .3s
    }

    .image-preview-item:hover .drag-handle {
        opacity: 1
    }

    .upload-progress {
        margin-top: 16px
    }

    .upload-progress-bar {
        height: 8px;
        background: var(--gray-200);
        border-radius: 4px;
        overflow: hidden
    }

    .upload-progress-fill {
        height: 100%;
        background: linear-gradient(90deg, var(--accent), var(--gold));
        transition: width .3s
    }

    .upload-progress-text {
        font-size: 12px;
        color: var(--gray-500);
        margin-top: 6px;
        text-align: center
    }

    .status-selector {
        display: flex;
        gap: 8px;
        flex-wrap: wrap
    }

    .status-option {
        padding: 10px 16px;
        border: 2px solid var(--gray-200);
        border-radius: var(--radius-md);
        cursor: pointer;
        transition: all .3s;
        display: flex;
        align-items: center;
        gap: 8px
    }

    .status-option:hover {
        border-color: var(--gray-400)
    }

    .status-option.active {
        border-color: var(--accent);
        background: rgba(36, 52, 71, .1)
    }

    .status-option.available.active {
        border-color: var(--success);
        background: rgba(46, 204, 113, .1)
    }

    .status-option.reserved.active {
        border-color: var(--reserved);
        background: rgba(155, 89, 182, .1)
    }

    .status-option.sold.active {
        border-color: var(--sold);
        background: rgba(192, 71, 58, .1)
    }

    .status-option.rented.active {
        border-color: #3498db;
        background: rgba(52, 152, 219, .1)
    }

    .status-option.archived.active {
        border-color: #7f8c8d;
        background: rgba(127, 140, 141, .1)
    }

    .status-option i {
        font-size: 16px
    }

    .status-option.available i {
        color: var(--success)
    }

    .status-option.reserved i {
        color: var(--reserved)
    }

    .status-option.sold i {
        color: var(--sold)
    }

    .status-option.rented i {
        color: #3498db
    }

    .status-option.archived i {
        color: #7f8c8d
    }

    .status-option.tasacion.active {
        border-color: #e67e22;
        background: rgba(230, 126, 34, .1)
    }

    .status-option.tasado.active {
        border-color: #C9A227;
        background: rgba(201, 162, 39, .1)
    }

    .status-option.tasacion i {
        color: #e67e22
    }

    .status-option.tasado i {
        color: #C9A227
    }

    .calendar-modal .modal-content {
        max-width: 900px
    }

    .calendar-container {
        display: grid;
        grid-template-columns: 1fr 300px;
        gap: 24px
    }

    .calendar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px
    }

    .calendar-nav {
        display: flex;
        gap: 8px
    }

    .calendar-nav button {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: var(--gray-100);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all .3s
    }

    .calendar-nav button:hover {
        background: var(--accent);
        color: white
    }

    .calendar-month {
        font-size: 20px;
        font-weight: 600
    }

    .calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 4px
    }

    .calendar-day-header {
        text-align: center;
        font-size: 12px;
        font-weight: 600;
        color: var(--gray-500);
        padding: 8px
    }

    .calendar-day {
        aspect-ratio: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 8px 4px;
        border-radius: var(--radius-sm);
        cursor: pointer;
        transition: all .2s;
        font-size: 14px;
        position: relative
    }

    .calendar-day:hover {
        background: var(--gray-100)
    }

    .calendar-day.other-month {
        color: var(--gray-400)
    }

    .calendar-day.today {
        background: var(--accent);
        color: white;
        font-weight: 600
    }

    .calendar-day.selected {
        background: var(--gold);
        color: white
    }

    .calendar-day.has-events::after {
        content: '';
        width: 6px;
        height: 6px;
        background: var(--accent);
        border-radius: 50%;
        position: absolute;
        bottom: 4px
    }

    .calendar-day.today.has-events::after {
        background: white
    }

    .calendar-sidebar {
        border-left: 1px solid var(--gray-200);
        padding-left: 24px
    }

    .calendar-sidebar h3 {
        font-size: 16px;
        margin-bottom: 16px;
        display: flex;
        align-items: center;
        gap: 8px
    }

    .calendar-sidebar h3 i {
        color: var(--accent)
    }

    .visit-item {
        background: var(--gray-50);
        padding: 12px;
        border-radius: var(--radius-md);
        margin-bottom: 12px;
        border-left: 3px solid var(--accent)
    }

    .visit-item.upcoming {
        border-left-color: var(--gold)
    }

    .visit-item.event-type-meeting {
        border-left-color: #9b59b6
    }

    .visit-item.event-type-delivery {
        border-left-color: #3498db
    }

    .visit-item.event-type-review {
        border-left-color: #e67e22
    }

    .visit-item.event-type-other {
        border-left-color: #95a5a6
    }

    .visit-item h4 {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 4px;
        color: var(--primary)
    }

    .visit-item .event-type-badge {
        display: inline-block;
        font-size: 10px;
        padding: 2px 8px;
        border-radius: var(--radius-full);
        margin-bottom: 6px;
        font-weight: 600
    }

    .visit-item .event-type-badge.visit {
        background: rgba(36, 52, 71, .1);
        color: var(--accent)
    }

    .visit-item .event-type-badge.meeting {
        background: rgba(155, 89, 182, .1);
        color: #9b59b6
    }

    .visit-item .event-type-badge.delivery {
        background: rgba(52, 152, 219, .1);
        color: #3498db
    }

    .visit-item .event-type-badge.review {
        background: rgba(230, 126, 34, .1);
        color: #e67e22
    }

    .visit-item .event-type-badge.other {
        background: rgba(149, 165, 166, .1);
        color: #95a5a6
    }

    .visit-item p {
        font-size: 12px;
        color: var(--gray-500);
        margin-bottom: 4px
    }

    .visit-item .visit-time {
        display: flex;
        align-items: center;
        gap: 6px;
        font-weight: 500;
        color: var(--gray-700)
    }

    .visit-item .visit-actions {
        display: flex;
        gap: 8px;
        margin-top: 8px
    }

    .visit-item .visit-actions button {
        padding: 6px 12px;
        font-size: 12px;
        border-radius: var(--radius-sm)
    }

    .btn-add-visit {
        width: 100%;
        padding: 12px;
        background: var(--accent);
        color: white;
        border-radius: var(--radius-md);
        font-weight: 600;
        margin-top: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px
    }

    .btn-add-visit:hover {
        background: var(--accent-hover)
    }

    .no-visits {
        text-align: center;
        padding: 30px 10px;
        color: var(--gray-400)
    }

    .no-visits i {
        font-size: 32px;
        margin-bottom: 8px
    }

    .event-type-selector {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-bottom: 8px
    }

    .event-type-option {
        padding: 10px 14px;
        border: 2px solid var(--gray-200);
        border-radius: var(--radius-md);
        cursor: pointer;
        transition: all .3s;
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 13px
    }

    .event-type-option:hover {
        border-color: var(--gray-400)
    }

    .event-type-option.active {
        border-color: var(--accent);
        background: rgba(36, 52, 71, .1)
    }

    .event-type-option i {
        font-size: 14px
    }

    .profile-header {
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        padding: 60px 0;
        color: var(--white);
        margin-bottom: 40px
    }

    .profile-header-content {
        display: flex;
        align-items: center;
        gap: 32px
    }

    .profile-avatar-container {
        position: relative
    }

    .profile-avatar {
        width: 120px;
        height: 120px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent), var(--gold));
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 48px;
        font-weight: 700;
        color: var(--white);
        border: 4px solid rgba(255, 255, 255, .3);
        overflow: hidden;
        flex-shrink: 0
    }

    .profile-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover
    }

    .profile-avatar-edit {
        position: absolute;
        bottom: 0;
        right: 0;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--accent);
        color: var(--white);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all .3s;
        border: 3px solid var(--white)
    }

    .profile-avatar-edit:hover {
        transform: scale(1.1)
    }

    .profile-info h1 {
        color: var(--white);
        margin-bottom: 8px
    }

    .profile-info p {
        opacity: .8;
        margin-bottom: 16px
    }

    .profile-bio {
        opacity: .9;
        font-size: 14px;
        max-width: 400px;
        margin-bottom: 12px
    }

    .profile-stats {
        display: flex;
        gap: 32px
    }

    .profile-stat {
        text-align: center
    }

    .profile-stat-number {
        font-size: 28px;
        font-weight: 700;
        font-family: 'Cormorant Garamond', serif
    }

    .profile-stat-label {
        font-size: 13px;
        opacity: .7
    }

    .profile-share {
        display: flex;
        gap: 12px;
        margin-top: 18px;
        flex-wrap: wrap;
        align-items: center
    }

    .profile-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 11px 20px;
        background: rgba(255, 255, 255, .15);
        color: var(--white);
        border: 1px solid rgba(255, 255, 255, .3);
        border-radius: var(--radius-full);
        font-family: 'Jost', sans-serif;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all .3s;
        white-space: nowrap
    }

    .profile-btn:hover {
        background: rgba(255, 255, 255, .28);
        transform: translateY(-2px)
    }

    .profile-btn i {
        font-size: 15px
    }

    .profile-btn-whatsapp {
        background: #25D366;
        border-color: #25D366
    }

    .profile-btn-whatsapp:hover {
        background: #1ebe5a;
        border-color: #1ebe5a
    }

    .profile-btn-edit {
        background: var(--gold);
        border-color: var(--gold);
        color: var(--primary)
    }

    .profile-btn-edit:hover {
        background: var(--gold-hover);
        border-color: var(--gold-hover)
    }

    .profile-social-links {
        display: flex;
        gap: 12px;
        margin-top: 16px;
        flex-wrap: wrap
    }

    .profile-social-link {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(255, 255, 255, .2);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--white);
        font-size: 18px;
        transition: all .3s
    }

    .profile-social-link:hover {
        background: rgba(255, 255, 255, .4);
        transform: scale(1.1)
    }

    .profile-social-link.whatsapp {
        background: #25D366
    }

    .profile-social-link.instagram {
        background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888)
    }

    .profile-social-link.facebook {
        background: #1877F2
    }

    .profile-social-link.linkedin {
        background: #0A66C2
    }

    .profile-social-link.twitter {
        background: #1DA1F2
    }

    .profile-social-link.tiktok {
        background: #000
    }

    .profile-social-link.youtube {
        background: #FF0000
    }

    .detail-modal .modal-content {
        max-width: 800px
    }

    .detail-gallery {
        position: relative;
        height: auto;
        background: var(--gray-100)
    }
    @media (min-width: 641px) { .detail-gallery { height: 400px; } }

    .detail-gallery img {
        width: 100%;
        height: auto;
        object-fit: contain;
        cursor: zoom-in
    }
    @media (min-width: 641px) { .detail-gallery img { height: 100%; object-fit: cover; } }

    .detail-zoom-hint {
        position: absolute;
        bottom: 14px;
        right: 14px;
        background: rgba(15, 20, 28, .6);
        color: #fff;
        padding: 7px 14px;
        border-radius: var(--radius-full);
        font-size: 12px;
        font-family: 'Jost', sans-serif;
        display: flex;
        align-items: center;
        gap: 7px;
        pointer-events: none;
        z-index: 9;
        backdrop-filter: blur(4px)
    }

    .lightbox {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 20, 28, .96);
        z-index: 3000;
        align-items: center;
        justify-content: center;
        animation: fadeIn .2s ease
    }

    .lightbox.active {
        display: flex
    }

    .lightbox-img {
        max-width: 92vw;
        max-height: 88vh;
        object-fit: contain;
        border-radius: 6px;
        box-shadow: 0 12px 60px rgba(0, 0, 0, .6);
        cursor: default;
        animation: lightboxZoom .25s ease
    }

    @keyframes lightboxZoom {
        from {
            opacity: 0;
            transform: scale(.94)
        }

        to {
            opacity: 1;
            transform: scale(1)
        }
    }

    .lightbox-close {
        position: absolute;
        top: 24px;
        right: 28px;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: rgba(255, 255, 255, .12);
        color: #fff;
        font-size: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all .2s;
        z-index: 3001;
        border: none
    }

    .lightbox-close:hover {
        background: rgba(255, 255, 255, .25);
        transform: scale(1.05)
    }

    .lightbox-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: rgba(255, 255, 255, .12);
        color: #fff;
        font-size: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all .2s;
        z-index: 3001;
        border: none
    }

    .lightbox-nav:hover {
        background: rgba(255, 255, 255, .25)
    }

    .lightbox-nav.prev {
        left: 28px
    }

    .lightbox-nav.next {
        right: 28px
    }

    .lightbox-counter {
        position: absolute;
        bottom: 28px;
        left: 50%;
        transform: translateX(-50%);
        color: #fff;
        background: rgba(0, 0, 0, .45);
        padding: 8px 18px;
        border-radius: var(--radius-full);
        font-size: 14px;
        font-family: 'Jost', sans-serif;
        letter-spacing: .03em
    }

    @media(max-width:768px) {
        .lightbox-nav {
            width: 44px;
            height: 44px;
            font-size: 18px
        }

        .lightbox-nav.prev {
            left: 10px
        }

        .lightbox-nav.next {
            right: 10px
        }

        .lightbox-close {
            top: 12px;
            right: 12px
        }

        .lightbox-img {
            max-width: 96vw
        }
    }

    .detail-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 50px;
        height: 50px;
        background: rgba(255, 255, 255, .9);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        color: var(--primary);
        transition: all .3s;
        z-index: 10
    }

    .detail-nav:hover {
        background: var(--white);
        transform: translateY(-50%) scale(1.1)
    }

    .detail-nav.prev {
        left: 16px
    }

    .detail-nav.next {
        right: 16px
    }

    .detail-status-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 5;
        pointer-events: none
    }

    .detail-status-overlay.reserved {
        background: rgba(155, 89, 182, .3)
    }

    .detail-status-overlay.sold {
        background: rgba(192, 71, 58, .4)
    }

    .detail-status-overlay.rented {
        background: rgba(52, 152, 219, .3)
    }

    .detail-status-overlay.archived {
        background: rgba(127, 140, 141, .4)
    }

    .detail-thumbnails {
        display: flex;
        gap: 8px;
        padding: 12px;
        overflow-x: auto;
        background: var(--gray-100)
    }

    .detail-thumb {
        width: 60px;
        height: 60px;
        border-radius: var(--radius-sm);
        overflow: hidden;
        cursor: pointer;
        opacity: .6;
        transition: all .3s;
        flex-shrink: 0;
        border: 2px solid transparent
    }

    .detail-thumb.active,
    .detail-thumb:hover {
        opacity: 1;
        border-color: var(--accent)
    }

    .detail-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover
    }

    .detail-content {
        padding: 32px
    }

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

    .detail-price {
        font-family: 'Cormorant Garamond', serif;
        font-size: 36px;
        font-weight: 700;
        color: var(--accent)
    }

    .detail-price-old {
        font-size: 20px;
        color: var(--gray-400);
        text-decoration: line-through;
        margin-right: 12px
    }

    .detail-price-container {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap
    }

    .detail-price-drop {
        background: var(--success);
        color: #fff;
        padding: 6px 14px;
        border-radius: var(--radius-full);
        font-size: 13px;
        font-weight: 700
    }

    .detail-owner {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        background: var(--gray-50);
        border-radius: var(--radius-lg);
        cursor: pointer;
        transition: all .3s;
        margin-bottom: 24px
    }

    .detail-owner:hover {
        background: var(--gray-100)
    }

    .detail-owner-avatar {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent), var(--gold));
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--white);
        font-weight: 600;
        overflow: hidden
    }

    .detail-owner-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover
    }

    .detail-owner-info {
        display: flex;
        align-items: center;
        gap: 8px
    }

    .detail-owner-info strong {
        color: var(--primary)
    }

    .detail-owner-info small {
        color: var(--gray-500);
        margin-left: 4px
    }

    .detail-features {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        margin-bottom: 24px
    }

    .detail-feature {
        padding: 16px;
        background: var(--gray-50);
        border-radius: var(--radius-md);
        text-align: center
    }

    .detail-feature i {
        font-size: 24px;
        color: var(--accent);
        margin-bottom: 8px;
        display: block
    }

    .detail-feature strong {
        display: block;
        font-size: 18px;
        color: var(--primary)
    }

    .detail-feature span {
        font-size: 12px;
        color: var(--gray-500)
    }

    .detail-description {
        margin-bottom: 24px;
        color: var(--gray-600);
        line-height: 1.8
    }

    .detail-actions {
        display: flex;
        gap: 12px;
        margin-bottom: 24px;
        flex-wrap: wrap
    }

    .detail-whatsapp {
        flex: 1;
        min-width: 200px;
        padding: 16px;
        background: #25D366;
        color: var(--white);
        border-radius: var(--radius-md);
        font-size: 16px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        transition: all .3s
    }

    .detail-whatsapp:hover {
        background: #128C7E
    }

    .detail-instagram {
        padding: 16px 24px;
        background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
        color: var(--white);
        border-radius: var(--radius-md);
        font-size: 16px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        transition: all .3s
    }

    .detail-instagram:hover {
        filter: brightness(1.1)
    }

    .detail-edit-btn {
        padding: 16px 24px;
        background: #3498db;
        color: var(--white);
        border-radius: var(--radius-md);
        font-size: 16px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        transition: all .3s
    }

    .detail-edit-btn:hover {
        background: #2980b9
    }

    .detail-share {
        padding: 16px 24px;
        background: var(--gray-200);
        color: var(--gray-700);
        border-radius: var(--radius-md);
        font-size: 16px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        transition: all .3s
    }

    .detail-share:hover {
        background: var(--primary);
        color: var(--white)
    }

    .comments-section {
        border-top: 1px solid var(--gray-200);
        padding-top: 24px;
        margin-top: 24px
    }

    .comments-section h3 {
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        gap: 8px
    }

    .comment-form {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 24px
    }

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

    .comment-form input {
        flex: 1;
        padding: 12px 16px;
        border: 2px solid var(--gray-200);
        border-radius: var(--radius-full);
        font-size: 14px
    }

    .comment-form input:focus {
        border-color: var(--accent);
        outline: none
    }

    .comment-form button {
        padding: 12px 24px;
        background: var(--accent);
        color: var(--white);
        border-radius: var(--radius-full);
        font-weight: 600;
        transition: all .3s;
        white-space: nowrap
    }

    .comment-form button:hover {
        background: var(--accent-hover)
    }

    .comment-form small {
        color: var(--gray-500);
        font-size: 12px;
        display: flex;
        align-items: center;
        gap: 6px
    }

    .comment-form small i {
        color: var(--gold)
    }

    .comment-item {
        display: flex;
        gap: 12px;
        padding: 16px 0;
        border-bottom: 1px solid var(--gray-100)
    }

    .comment-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--gray-200);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--gray-500);
        font-weight: 600;
        overflow: hidden;
        flex-shrink: 0
    }

    .comment-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover
    }

    .comment-content {
        flex: 1
    }

    .comment-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 4px;
        flex-wrap: wrap
    }

    .comment-author {
        font-weight: 600;
        color: var(--primary)
    }

    .comment-guest-badge {
        font-size: 10px;
        padding: 2px 8px;
        background: var(--gray-200);
        border-radius: var(--radius-full);
        color: var(--gray-600)
    }

    .comment-time {
        font-size: 12px;
        color: var(--gray-400)
    }

    .comment-text {
        color: var(--gray-600)
    }

    .comment-contact {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-top: 8px;
        padding: 8px 12px;
        background: rgba(37, 211, 102, .1);
        border-radius: var(--radius-md);
        font-size: 13px
    }

    .comment-contact i {
        color: #25D366
    }

    .comment-contact a {
        color: #25D366;
        font-weight: 600
    }

    .no-comments {
        text-align: center;
        padding: 30px;
        color: var(--gray-400)
    }

    .admin-panel {
        padding: 40px 0
    }

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

    .admin-tabs {
        display: flex;
        gap: 8px;
        margin-bottom: 24px;
        background: var(--white);
        padding: 8px;
        border-radius: var(--radius-lg);
        flex-wrap: wrap
    }

    .admin-tab {
        padding: 12px 24px;
        border-radius: var(--radius-md);
        font-weight: 500;
        background: none;
        color: var(--gray-600);
        transition: all .3s
    }

    .admin-tab.active {
        background: var(--primary);
        color: var(--white)
    }

    .admin-tab:hover:not(.active) {
        background: var(--gray-100)
    }

    .admin-content {
        background: var(--white);
        border-radius: var(--radius-xl);
        padding: 24px;
        box-shadow: var(--shadow-md)
    }

    .user-card {
        display: flex;
        align-items: center;
        gap: 20px;
        padding: 20px;
        background: var(--gray-50);
        border-radius: var(--radius-lg);
        margin-bottom: 16px;
        flex-wrap: wrap
    }

    .user-card-avatar {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: var(--gray-200);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        font-size: 24px;
        color: var(--gray-400);
        flex-shrink: 0
    }

    .user-card-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover
    }

    .user-card-info {
        flex: 1;
        min-width: 200px
    }

    .user-card-info h4 {
        margin-bottom: 4px
    }

    .user-card-info p {
        color: var(--gray-600);
        font-size: 14px
    }

    .user-card-info small {
        color: var(--gray-400);
        font-size: 12px
    }

    .user-card-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap
    }

    .btn-approve {
        padding: 10px 18px;
        background: rgba(46, 204, 113, .1);
        color: var(--success);
        border-radius: var(--radius-md);
        font-weight: 500;
        transition: all .3s
    }

    .btn-approve:hover {
        background: var(--success);
        color: var(--white)
    }

    .btn-reject {
        padding: 10px 18px;
        background: rgba(192, 71, 58, .1);
        color: var(--danger);
        border-radius: var(--radius-md);
        font-weight: 500;
        transition: all .3s
    }

    .btn-reject:hover {
        background: var(--danger);
        color: var(--white)
    }

    .btn-edit {
        padding: 10px 18px;
        background: rgba(52, 152, 219, .1);
        color: #3498db;
        border-radius: var(--radius-md);
        font-weight: 500;
        transition: all .3s
    }

    .btn-edit:hover {
        background: #3498db;
        color: var(--white)
    }

    .btn-feature-admin {
        padding: 10px 18px;
        background: rgba(241, 196, 15, .1);
        color: #f1c40f;
        border-radius: var(--radius-md);
        font-weight: 500;
        transition: all .3s;
        border: none;
        cursor: pointer
    }

    .btn-feature-admin:hover,
    .btn-feature-admin.active {
        background: linear-gradient(135deg, #f1c40f, #f39c12);
        color: var(--white)
    }

    .user-card.featured-admin {
        border: 2px solid #f1c40f;
        background: linear-gradient(to right, rgba(241, 196, 15, .05), var(--gray-50))
    }

    .empty-state {
        text-align: center;
        padding: 60px 20px;
        color: var(--gray-400)
    }

    .empty-state i {
        font-size: 48px;
        margin-bottom: 16px
    }

    .empty-state h3 {
        color: var(--gray-600);
        margin-bottom: 8px
    }

    .footer {
        background: var(--primary);
        color: var(--white);
        padding: 48px 0 24px;
        margin-top: 60px
    }

    .footer-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 24px;
        border-bottom: 1px solid rgba(255, 255, 255, .12)
    }

    .footer-logo {
        display: flex;
        align-items: center;
        gap: 11px;
        color: var(--white)
    }

    .footer-logo .footer-iso {
        height: 40px;
        width: auto
    }

    .footer-logo .footer-text {
        height: 19px;
        width: auto;
        margin-top: 4px
    }

    .footer-links {
        display: flex;
        gap: 24px
    }

    .footer-links a {
        color: rgba(255, 255, 255, .7);
        transition: color .3s;
        font-size: 20px
    }

    .footer-links a:hover {
        color: var(--gold)
    }

    .footer-bottom {
        text-align: center;
        padding-top: 24px;
        color: rgba(255, 255, 255, .5);
        font-size: 14px;
        letter-spacing: .02em
    }

    .loading {
        display: flex;
        justify-content: center;
        padding: 60px
    }

    .spinner {
        width: 40px;
        height: 40px;
        border: 3px solid var(--gray-200);
        border-top-color: var(--accent);
        border-radius: 50%;
        animation: spin .8s linear infinite
    }

    @keyframes spin {
        to {
            transform: rotate(360deg)
        }
    }

    .toast-container {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 10000;
        display: flex;
        flex-direction: column;
        gap: 10px
    }

    .toast {
        background: var(--white);
        padding: 16px 20px;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        display: flex;
        align-items: center;
        gap: 12px;
        animation: toastIn .3s ease;
        max-width: 350px
    }

    @keyframes toastIn {
        from {
            transform: translateX(100%);
            opacity: 0
        }

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

    .toast.hiding {
        animation: toastOut .3s ease forwards
    }

    @keyframes toastOut {
        from {
            transform: translateX(0);
            opacity: 1
        }

        to {
            transform: translateX(100%);
            opacity: 0
        }
    }

    .toast-icon {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(36, 52, 71, .1);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--accent);
        flex-shrink: 0
    }

    .toast-content {
        flex: 1
    }

    .toast-content strong {
        display: block;
        color: var(--primary);
        margin-bottom: 2px
    }

    .toast-content p {
        font-size: 13px;
        color: var(--gray-600);
        margin: 0
    }

    @media(max-width:968px) {
        .detail-features {
            grid-template-columns: repeat(2, 1fr)
        }

        .profile-header-content {
            flex-direction: column;
            text-align: center
        }

        .profile-stats {
            justify-content: center
        }

        .profile-share {
            justify-content: center
        }

        .profile-social-links {
            justify-content: center
        }

        .notification-dropdown {
            width: 340px;
            right: 0
        }

        .calendar-container {
            grid-template-columns: 1fr
        }

        .calendar-sidebar {
            border-left: none;
            border-top: 1px solid var(--gray-200);
            padding-left: 0;
            padding-top: 24px
        }

        .properties-grid {
            grid-template-columns: repeat(2, 1fr)
        }

        .card-actions {
            opacity: 1
        }
    }

    @media(max-width:768px) {
        /* ===== HEADER: una sola fila compacta, sin desbordes ===== */
        .header-content {
            flex-wrap: nowrap;
            gap: 8px;
            padding: 10px 0
        }

        .logo-img {
            height: 30px
        }

        .logo-text {
            height: 16px;
            margin-top: 3px
        }

        .nav {
            width: auto;
            justify-content: flex-end;
            gap: 6px;
            flex-wrap: nowrap;
            flex: 0 0 auto
        }

        /* En celular se navega por el menú lateral: ocultamos los enlaces de texto */
        #nav-guest a,
        #nav-user a {
            display: none
        }

        /* El botón de acceso solo lo ve el visitante (no logueado) */
        #nav-guest .agent-access {
            padding: 8px 13px;
            font-size: 12px
        }

        .nav a {
            padding: 8px 12px;
            font-size: 13px
        }

        .hero h1 {
            font-size: 26px;
            line-height: 1.2
        }

        .hero p {
            font-size: 15px;
            padding: 0 10px
        }

        .hero-btn {
            padding: 12px 20px;
            font-size: 15px;
            width: 100%;
            justify-content: center
        }

        .filters-row {
            grid-template-columns: 1fr;
            gap: 12px
        }

        .properties-grid {
            grid-template-columns: 1fr;
            gap: 16px
        }

        .property-card {
            max-width: 100%
        }

        .card-image {
            height: 220px
        }

        .card-badges {
            gap: 6px;
            flex-wrap: wrap
        }

        .badge {
            padding: 4px 10px;
            font-size: 10px
        }

        .card-content {
            padding: 16px
        }

        .card-price {
            font-size: 22px
        }

        .card-title {
            font-size: 15px
        }

        .card-features {
            gap: 8px;
            flex-wrap: wrap
        }

        .card-feature {
            font-size: 12px
        }

        .card-actions {
            opacity: 1;
            top: 8px;
            right: 8px;
            padding: 4px;
            gap: 4px
        }

        .card-action-btn,
        .btn-feature {
            width: 28px;
            height: 28px;
            font-size: 11px
        }

        .form-row,
        .form-row-3,
        .form-row-4 {
            grid-template-columns: 1fr
        }

        .section-header {
            flex-direction: column;
            align-items: stretch;
            gap: 12px
        }

        .section-header h2 {
            font-size: 20px;
            text-align: center
        }

        .btn-new-property {
            width: 100%;
            justify-content: center
        }

        .footer-content {
            flex-direction: column;
            gap: 20px;
            text-align: center
        }

        .user-info {
            gap: 6px;
            padding: 4px 8px 4px 4px;
            flex: 0 0 auto
        }

        .user-info span:not(.admin-badge) {
            display: none
        }

        .user-avatar {
            width: 32px;
            height: 32px
        }

        .admin-badge {
            font-size: 10px;
            padding: 3px 8px
        }

        .calendar-btn,
        .notification-bell {
            width: 38px;
            height: 38px;
            flex: 0 0 auto
        }

        .user-dropdown {
            right: 0;
            left: auto;
            transform: none;
            width: 200px;
            max-width: calc(100vw - 20px)
        }

        .header-left {
            gap: 12px
        }

        .logo {
            font-size: 20px
        }

        /* ===== HERO v2 en celular: foto como banda superior, stats en fila ===== */
        .mv-hero-grid {
            display: block
        }

        .mv-hero-copy {
            padding: 22px 0 20px;
            position: relative;
            z-index: 1
        }

        .mv-hero-copy h1 {
            font-size: 30px
        }

        .mv-hero-copy>p {
            font-size: 15px
        }

        .mv-hero-deco {
            display: none
        }

        .mv-hero-media {
            display: block;
            position: absolute;
            top: 0;
            right: 0;
            width: 50%;
            height: 215px;
            z-index: 0
        }

        .mv-hero-media::after {
            background: linear-gradient(90deg, var(--primary) 0%, rgba(36, 52, 71, .4) 40%, transparent 80%), linear-gradient(to bottom, transparent 52%, var(--primary) 100%)
        }

        .mv-hero-media img {
            -webkit-mask-image: linear-gradient(to right, transparent 0, #000 55%);
            mask-image: linear-gradient(to right, transparent 0, #000 55%)
        }

        /* Stats: 3 píldoras BAJAS en fila, ícono y texto en una línea cada una */
        .mv-hero-stats {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 8px;
            margin-top: 16px
        }

        .mv-stat {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: flex-start;
            gap: 8px;
            background: rgba(255, 255, 255, .06);
            border: 1px solid rgba(255, 255, 255, .14);
            border-radius: 12px;
            padding: 10px 8px;
            min-width: 0
        }

        .mv-stat>div {
            min-width: 0;
            text-align: left
        }

        .mv-stat-sep {
            display: none
        }

        .mv-stat-ic {
            width: 28px;
            height: 28px;
            font-size: 11px;
            flex: 0 0 auto
        }

        .mv-stat-num {
            font-size: 17px;
            line-height: 1
        }

        .mv-stat-lbl {
            font-size: 9px;
            line-height: 1.1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis
        }

        /* Buscador: campos apilados pegados, sin huecos, botón dorado ancho */
        .mv-search {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 12px;
            padding: 16px
        }

        .mv-search>.mv-field,
        .mv-search>.mv-field.grow {
            flex: 0 0 auto;
            width: 100%;
            margin: 0
        }

        .mv-search-btn {
            flex: 0 0 auto;
            width: 100%;
            justify-content: center;
            background: var(--gold);
            color: #fff;
            font-weight: 600;
            padding: 14px;
            font-size: 16px
        }

        .detail-modal .modal-content {
            width: 100%;
            max-width: 100%;
            margin: 0;
            border-radius: 0;
            max-height: 100vh
        }

        .detail-gallery {
            height: auto;
            min-height: 0;
        }

        .detail-header {
            flex-direction: column;
            gap: 12px
        }

        .detail-price {
            font-size: 28px
        }

        .detail-price-container {
            width: 100%
        }

        .detail-actions {
            flex-direction: column
        }

        .detail-features {
            grid-template-columns: repeat(2, 1fr);
            gap: 12px
        }

        .detail-feature {
            padding: 12px
        }

        .profile-avatar {
            width: 90px;
            height: 90px;
            font-size: 32px
        }

        .profile-name {
            font-size: 24px
        }

        .profile-stats {
            gap: 20px
        }

        .comment-form-row {
            flex-direction: column
        }

        /* (reglas viejas del panel de notificaciones eliminadas: ahora vive en styles v2 al final) */

        .event-type-selector {
            flex-direction: column;
            gap: 8px
        }

        .event-type-option {
            justify-content: center;
            padding: 10px
        }

        .calendar-grid {
            gap: 4px
        }

        .calendar-day {
            padding: 8px 4px;
            font-size: 13px
        }

        .modal-content {
            width: 95%;
            margin: 10px auto;
            max-height: 90vh
        }

        .modal-body {
            padding: 16px;
            max-height: calc(90vh - 120px)
        }

        .admin-tabs {
            flex-wrap: wrap;
            gap: 8px
        }

        .admin-tab {
            padding: 10px 16px;
            font-size: 13px;
            flex: 1 1 auto;
            text-align: center
        }
    }

    @media(max-width:480px) {
        .hero h1 {
            font-size: 22px
        }

        .hero p {
            font-size: 14px
        }

        .card-image {
            height: 200px
        }

        .card-price {
            font-size: 20px
        }

        .card-title {
            font-size: 14px
        }

        .card-footer {
            flex-direction: column;
            gap: 10px;
            align-items: stretch
        }

        .btn-whatsapp {
            width: 100%;
            justify-content: center
        }

        .detail-price {
            font-size: 24px
        }

        .detail-features {
            grid-template-columns: 1fr 1fr
        }

        .profile-stats {
            flex-direction: column;
            gap: 16px
        }

        .calendar-day-header {
            font-size: 11px
        }

        .visit-item {
            padding: 12px
        }

        .admin-table {
            font-size: 12px
        }

        .admin-table td,
        .admin-table th {
            padding: 8px 6px
        }

        .user-dropdown {
            width: 180px;
            right: 0
        }
    }

    .crm-panel {
        padding: 40px 0 60px
    }

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

    .crm-header h1 {
        font-size: 38px;
        margin-bottom: 4px
    }

    .crm-header p {
        color: var(--gray-500)
    }

    .crm-stats-row {
        display: flex;
        gap: 14px;
        flex-wrap: wrap;
        margin-bottom: 24px
    }

    .crm-stat {
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius-lg);
        padding: 18px 22px;
        min-width: 140px;
        box-shadow: var(--shadow-sm)
    }

    .crm-stat-num {
        font-family: 'Cormorant Garamond', serif;
        font-size: 34px;
        font-weight: 700;
        color: var(--primary);
        line-height: 1
    }

    .crm-stat-label {
        font-size: 13px;
        color: var(--gray-500);
        margin-top: 4px
    }

    .crm-toolbar {
        display: flex;
        gap: 12px;
        margin-bottom: 24px;
        flex-wrap: wrap;
        align-items: center
    }

    .crm-search {
        flex: 1;
        min-width: 220px;
        position: relative
    }

    .crm-search i {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--gray-400)
    }

    .crm-search input {
        width: 100%;
        padding: 12px 16px 12px 44px;
        border: 1px solid var(--gray-300);
        border-radius: var(--radius-full);
        font-family: 'Jost', sans-serif;
        font-size: 14px;
        background: var(--white);
        transition: all .2s
    }

    .crm-search input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(36, 52, 71, .08)
    }

    .crm-filter {
        padding: 12px 18px;
        border: 1px solid var(--gray-300);
        border-radius: var(--radius-full);
        font-family: 'Jost', sans-serif;
        font-size: 14px;
        background: var(--white);
        cursor: pointer;
        color: var(--gray-700)
    }

    .crm-filter:focus {
        outline: none;
        border-color: var(--primary)
    }

    .btn-new-client {
        background: var(--accent);
        color: var(--white);
        padding: 12px 22px;
        border-radius: var(--radius-full);
        font-weight: 500;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        transition: all .3s;
        font-size: 14px
    }

    .btn-new-client:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md)
    }

    .crm-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
        gap: 18px
    }

    .client-card {
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius-lg);
        padding: 22px;
        box-shadow: var(--shadow-sm);
        transition: all .3s;
        position: relative
    }

    .client-card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-3px);
        border-color: var(--gray-300)
    }

    .client-card-top {
        display: flex;
        align-items: center;
        gap: 14px;
        margin-bottom: 16px
    }

    .client-avatar {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--primary), var(--primary-light));
        color: var(--white);
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: 'Cormorant Garamond', serif;
        font-size: 24px;
        font-weight: 600;
        flex-shrink: 0
    }

    .client-card-name {
        flex: 1;
        min-width: 0
    }

    .client-card-name h3 {
        font-family: 'Jost', sans-serif;
        font-size: 17px;
        font-weight: 600;
        color: var(--primary);
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis
    }

    .client-card-name .client-owner {
        font-size: 12px;
        color: var(--gray-400);
        margin-top: 2px
    }

    .client-status {
        display: inline-block;
        padding: 5px 12px;
        border-radius: var(--radius-full);
        font-size: 11px;
        font-weight: 600;
        letter-spacing: .04em;
        text-transform: uppercase
    }

    .client-status.nuevo {
        background: rgba(58, 125, 92, .12);
        color: #3a7d5c
    }

    .client-status.contactado {
        background: rgba(36, 52, 71, .1);
        color: var(--primary)
    }

    .client-status.activo {
        background: rgba(201, 169, 97, .18);
        color: #9a7d2e
    }

    .client-status.cerrado {
        background: rgba(58, 125, 92, .18);
        color: #2c6347
    }

    .client-status.perdido {
        background: rgba(143, 139, 126, .15);
        color: var(--gray-600)
    }

    .client-status.seguimiento {
        background: rgba(59, 110, 165, .14);
        color: #3b6ea5
    }

    .client-status.visita {
        background: rgba(194, 114, 46, .16);
        color: #b4671f
    }

    .client-status.negociacion {
        background: rgba(201, 169, 97, .2);
        color: #8a6d22
    }

    .client-meta {
        display: flex;
        flex-direction: column;
        gap: 9px;
        margin-bottom: 16px
    }

    .client-meta-row {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 14px;
        color: var(--gray-700)
    }

    .client-meta-row i {
        width: 18px;
        text-align: center;
        color: var(--gray-400);
        font-size: 14px
    }

    .client-interest-tag {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: var(--gray-100);
        padding: 4px 12px;
        border-radius: var(--radius-full);
        font-size: 12px;
        color: var(--gray-600);
        margin-bottom: 14px
    }

    .client-notes-preview {
        font-size: 13px;
        color: var(--gray-500);
        background: var(--gray-50);
        border-left: 3px solid var(--gray-300);
        padding: 8px 12px;
        border-radius: var(--radius-sm);
        margin-bottom: 16px;
        line-height: 1.5;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden
    }

    .client-actions {
        display: flex;
        gap: 8px;
        border-top: 1px solid var(--gray-100);
        padding-top: 14px
    }

    .client-actions a,
    .client-actions button {
        flex: 1;
        padding: 9px;
        border-radius: var(--radius-sm);
        font-size: 13px;
        font-weight: 500;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        transition: all .2s;
        border: 1px solid var(--gray-200);
        background: var(--white);
        color: var(--gray-700);
        cursor: pointer
    }

    .client-actions .ca-wa:hover {
        background: #25D366;
        color: #fff;
        border-color: #25D366
    }

    .client-actions .ca-edit:hover {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary)
    }

    .client-actions .ca-del:hover {
        background: var(--danger);
        color: #fff;
        border-color: var(--danger)
    }

    .crm-empty {
        text-align: center;
        padding: 80px 20px;
        color: var(--gray-400)
    }

    .crm-empty i {
        font-size: 56px;
        margin-bottom: 20px;
        opacity: .4
    }

    .crm-empty h3 {
        font-family: 'Cormorant Garamond', serif;
        font-size: 24px;
        color: var(--gray-600);
        margin-bottom: 8px
    }

    .crm-badge {
        background: var(--primary);
        color: #fff;
        font-size: 10px;
        padding: 2px 7px;
        border-radius: var(--radius-full);
        margin-left: 6px;
        vertical-align: middle;
        letter-spacing: .05em
    }

    @media(max-width:768px) {
        .crm-header h1 {
            font-size: 28px
        }

        .crm-grid {
            grid-template-columns: 1fr
        }

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

        .btn-new-client {
            width: 100%;
            justify-content: center
        }

        .crm-stat {
            flex: 1;
            min-width: calc(50% - 7px)
        }

        .crm-panel.container,
        #crmPage .container,
        #clientProfilePage .container {
            padding-left: 18px;
            padding-right: 18px
        }

        .crm-panel {
            padding-top: 26px;
            padding-bottom: 50px
        }

        .crm-stats-row {
            gap: 12px
        }

        .crm-search {
            min-width: 0;
            width: 100%
        }

        .crm-filter {
            width: 100%
        }
    }

    @media(max-width:400px) {
        .crm-panel.container,
        #crmPage .container,
        #clientProfilePage .container {
            padding-left: 16px;
            padding-right: 16px
        }

        .crm-header h1 {
            font-size: 25px
        }

        .crm-stat {
            padding: 15px 16px;
            min-width: calc(50% - 6px)
        }

        .crm-stat-num {
            font-size: 30px
        }
    }


/* ---- Modales en el celular: el scroll queda ADENTRO del modal ----
   overscroll-behavior corta el "encadenamiento" hacia la página de fondo
   cuando el contenido del modal llega a su tope; el body además se fija por
   JS (position:fixed) mientras haya un modal o el lightbox abiertos. dvh
   evita que el borde inferior quede tapado por la barra de Safari en iPhone. */
.modal,
.lightbox {
    overscroll-behavior: contain;
}

.modal-content,
.modal-body {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    max-height: 90dvh;
}

@media (max-width: 768px) {
    .modal-body {
        max-height: calc(90dvh - 120px);
    }
}

/* Chips de filtro dentro del panel de notificaciones (Clientes / Propiedades) */
.notif-filtros {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100, #f1f5f9);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}
.notif-chip {
    border: 1px solid var(--gray-200, #e5e7eb);
    background: #fff;
    color: var(--gray-600, #555);
    border-radius: 999px;
    padding: 5px 12px;
    font-family: inherit;
    font-size: .76rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all .12s;
}
.notif-chip:hover { background: var(--gray-50, #f8fafc); }
.notif-chip.active {
    background: var(--primary, #16273f);
    color: #fff;
    border-color: var(--primary, #16273f);
}

/* ============ Contratos de alquiler (panel en el detalle) ============ */
.ctr-panel {
    margin-top: 16px;
    background: #f8fafc;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 14px;
    padding: 16px;
}
.ctr-panel.ctr-pending {
    background: #fffbeb;
    border-color: #fde68a;
}
.ctr-head {
    font-weight: 700;
    color: var(--primary, #16273f);
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.ctr-head i { color: var(--accent, #C9A227); }
.ctr-p { font-size: .85rem; color: var(--gray-600, #555); line-height: 1.45; margin: 0 0 12px; }
.ctr-row { font-size: .86rem; color: var(--gray-700, #374151); margin-bottom: 7px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctr-row i { color: var(--gray-400, #9ca3af); width: 15px; text-align: center; }
.ctr-link { color: var(--accent, #C9A227); font-size: .8rem; text-decoration: none; }
.ctr-chip { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.ctr-chip.ok { background: #dcfce7; color: #15803d; }
.ctr-chip.r90 { background: #fef3c7; color: #b45309; }
.ctr-chip.r30 { background: #fee2e2; color: #b91c1c; }
.ctr-chip.venc { background: #fee2e2; color: #991b1b; }
.ctr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ctr-btn {
    border: 1px solid var(--gray-200, #e5e7eb);
    background: #fff;
    color: var(--gray-700, #374151);
    border-radius: 9px;
    padding: 8px 13px;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .12s;
}
.ctr-btn:hover { background: var(--gray-50, #f8fafc); }
.ctr-btn.primary { background: var(--primary, #16273f); color: #fff; border-color: var(--primary, #16273f); }
.ctr-btn.ghost { background: transparent; border-color: transparent; color: var(--gray-500, #6b7280); }
.ctr-overlay {
    position: fixed; inset: 0; background: rgba(15, 25, 40, .55);
    z-index: 3200; display: flex; align-items: center; justify-content: center; padding: 16px;
}
.ctr-modal {
    background: #fff; border-radius: 16px; max-width: 420px; width: 100%;
    padding: 22px; box-shadow: 0 20px 60px rgba(10, 20, 35, .35);
    max-height: 88vh; overflow-y: auto;
}
.ctr-modal h3 { margin: 0 0 14px; font-size: 1.05rem; color: var(--primary, #16273f); }
.ctr-quick { display: flex; gap: 8px; margin: -4px 0 14px; }
.ctr-quick button {
    border: 1px solid var(--gray-200, #e5e7eb); background: #fff; border-radius: 8px;
    padding: 6px 14px; font-family: inherit; font-size: .8rem; font-weight: 600;
    cursor: pointer; color: var(--gray-600, #555);
}
.ctr-quick button:hover { background: var(--gray-50, #f8fafc); border-color: var(--accent, #C9A227); }
.ctr-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.ctr-hist { margin: 4px 0 14px; }
.ctr-hist-item { padding: 11px 0; border-bottom: 1px solid var(--gray-100, #f1f5f9); font-size: .86rem; }
.ctr-hist-item:last-child { border-bottom: none; }
.ctr-hist-sub { font-size: .78rem; color: var(--gray-500, #6b7280); margin-top: 4px; display: flex; align-items: center; gap: 6px; }


/* ================================================================
   PANEL DE NOTIFICACIONES — v2 (panel movido al <body>)
   Escritorio: tarjeta anclada arriba a la derecha.
   Celular: hoja deslizante desde abajo (bottom sheet), estable.
   ================================================================ */
.notification-overlay {
    display: block !important;
    position: fixed; inset: 0;
    background: rgba(12, 20, 34, .45);
    opacity: 0; pointer-events: none;
    transition: opacity .22s ease;
    z-index: 3000;
}
.notification-overlay.active { opacity: 1; pointer-events: auto; }

.notification-dropdown {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 66px; right: 20px;
    width: 430px;
    max-height: min(560px, calc(100vh - 90px));
    background: #fff;
    border: 1px solid #e8ebf0;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(10, 20, 35, .22);
    overflow: hidden;
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(-10px) scale(.99);
    transform-origin: top right;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    animation: none !important;
    z-index: 3001;
}
.notification-dropdown.active {
    opacity: 1; visibility: visible; pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Cabecera fija */
.notification-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 14px 16px; flex: none;
    border-bottom: 1px solid #f0f2f5;
}
.notification-header h3 {
    font-size: 1.02rem; display: flex; align-items: center; gap: 8px; margin: 0;
    color: var(--ink, #16273f);
}
.notification-header h3 i { color: var(--gold, #C9A227); font-size: .95rem; }
.notification-actions { display: flex; gap: 6px; }
.notification-actions button {
    border: none; background: transparent; cursor: pointer;
    font-family: inherit; font-size: .76rem; font-weight: 600;
    color: var(--gray-500, #6b7280); padding: 6px 9px; border-radius: 8px;
    display: inline-flex; align-items: center; gap: 5px;
}
.notification-actions button:hover { background: #f4f6f8; }
.notification-actions .btn-clear { color: var(--danger, #c0392b); }

/* Barra de filtros fija (scroll horizontal si no entran) */
.notif-filtros-bar {
    flex: none; background: #fff;
    border-bottom: 1px solid #f0f2f5;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.notif-filtros-bar::-webkit-scrollbar { display: none; }
.notif-filtros-bar .notif-filtros {
    display: flex; gap: 7px; padding: 10px 14px; margin: 0; border: none;
    flex-wrap: wrap; width: auto;   /* en PC envuelven: nada se corta */
}
.notif-chip {
    border: 1px solid #e3e7ec; background: #fff;
    border-radius: 999px; padding: 6px 13px;
    font-family: inherit; font-size: .78rem; font-weight: 600;
    color: var(--gray-500, #6b7280); cursor: pointer; white-space: nowrap;
    transition: all .15s;
}
.notif-chip:hover { border-color: var(--gold, #C9A227); }
.notif-chip.active {
    background: var(--ink, #16273f); color: #fff; border-color: var(--ink, #16273f);
}

/* Lista: única zona con scroll, contenida (no arrastra el fondo) */
.notification-list {
    flex: 1 1 auto; min-height: 0;
    max-height: none;
    overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.notification-list::-webkit-scrollbar { width: 5px; }
.notification-list::-webkit-scrollbar-thumb { background: #e0e4ea; border-radius: 99px; }

/* Tarjetas uniformes */
.notification-item {
    display: flex; gap: 11px; padding: 13px 16px;
    border-bottom: 1px solid #f3f5f7; cursor: pointer;
    transition: background .15s; position: relative;
}
.notification-item:hover { background: #f9fafb; }
.notification-item.unread { background: rgba(37, 99, 235, .04); }
.notification-item.unread::after {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: var(--accent, #2563eb);
}
.notification-avatar {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent, #2563eb), var(--gold, #C9A227));
    color: #fff; font-weight: 600; font-size: 15px; overflow: hidden;
}
.notification-avatar img { width: 100%; height: 100%; object-fit: cover; }
.notification-body { flex: 1; min-width: 0; }
.notification-body p { font-size: .85rem; margin: 0 0 2px; color: var(--ink, #16273f); }
.notification-body strong { font-weight: 700; }
.notification-message {
    font-size: .8rem; line-height: 1.45; color: var(--gray-500, #6b7280);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.notification-meta {
    font-size: .7rem; color: var(--gray-400, #9aa3ad); margin-top: 6px;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.notification-empty { padding: 48px 20px; text-align: center; color: #b4bcc6; }
.notification-empty i { font-size: 2.2rem; margin-bottom: 12px; display: block; }

/* ---------- Celular: PESTAÑA de pantalla completa (estilo app) ----------
   Las notificaciones dejan de ser un panel flotante: ocupan toda la
   pantalla, dejando visible la barra inferior para cambiar de pestaña.
   Nada flota, nada se recorta, nada arrastra el fondo. */
@media (max-width: 640px) {
    .notification-dropdown {
        top: 0; left: 0; right: 0;
        bottom: 0;  /* sin barra, ocupa hasta abajo: cero franjas muertas */
        width: 100%; max-width: none; max-height: none;
        border-radius: 0; border: none;
        box-shadow: none;
        transform: translateY(6px);
    }
    .notification-dropdown.active { transform: translateY(0); }
    /* Con la barra inferior presente, la pestaña le deja su lugar exacto */
    body.has-bottombar .notification-dropdown { bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
    /* En celular los chips scrollean con el dedo, en una sola línea */
    .notif-filtros-bar .notif-filtros { flex-wrap: nowrap; width: max-content; }
    .notification-header { padding: 16px 16px 12px; }
    .notification-header h3 { font-size: 1.15rem; }
    /* Sin overlay oscuro en celular: es una pestaña, no un popup */
    .notification-overlay { display: none !important; }
    /* Filas más aireadas, estilo feed */
    .notification-item { padding: 14px 16px; gap: 12px; }
    .notification-avatar { width: 44px; height: 44px; }
}


/* ================================================================
   BARRA INFERIOR MÓVIL (estilo app) — Inicio · Consultas · Perfil · Menú
   Solo visible en celular y para usuarios logueados.
   ================================================================ */
.mv-bottombar {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: rgba(22, 39, 63, .97);
    border-top: 1px solid rgba(255, 255, 255, .10);
    z-index: 3500;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* Vidrio esmerilado: la barra es translúcida y el contenido pasa desenfocado
   por debajo, tiñéndola sutilmente (efecto glass estilo iOS). Con respaldo
   sólido para navegadores sin backdrop-filter. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .mv-bottombar {
        background: rgba(22, 39, 63, .72);
        -webkit-backdrop-filter: blur(18px) saturate(1.5);
        backdrop-filter: blur(18px) saturate(1.5);
    }
}
@media (max-width: 640px) {
    .mv-bottombar:not(.hidden) { display: grid; grid-template-columns: repeat(5, 1fr); }
    body.has-bottombar { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
    /* En celular, la campanita y el chip de usuario del header sobran:
       viven en la barra de abajo (la foto es la pestaña Perfil). */
    body.has-bottombar .notification-bell { display: none !important; }
    body.has-bottombar .user-info { display: none !important; }
}
/* Avatar del agente en la pestaña Perfil (como Facebook) */
.bb-avatar {
    width: 24px; height: 24px; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: #0f1d31; color: #8fa0b8;
}
.bb-avatar i { font-size: .8rem; }
.bb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bb-item.active .bb-avatar { box-shadow: 0 0 0 2px var(--gold, #C9A227); }
.bb-item {
    position: relative;
    border: none; background: transparent; cursor: pointer;
    font-family: inherit;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 3px 13px;
    color: #8fa0b8; font-size: .61rem; font-weight: 600;
    line-height: 1.2; letter-spacing: .01em;
    -webkit-tap-highlight-color: transparent;
}
.bb-item i { font-size: 1.12rem; }
.bb-item.active { color: #fff; }
.bb-item.active i { color: var(--gold, #C9A227); }
/* Filete dorado arriba de la pestaña activa: el mismo trazo de los
   carteles premium del sitio, ahora como indicador de navegación. */
.bb-item.active::before {
    content: ''; position: absolute; top: 0; left: 24%; right: 24%;
    height: 2.5px; background: var(--gold, #C9A227);
    border-radius: 0 0 3px 3px;
}
.bb-badge {
    position: absolute; top: 5px; left: calc(50% + 6px);
    min-width: 17px; height: 17px; border-radius: 99px;
    background: #e11d48; color: #fff;
    font-size: .62rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; border: 2px solid var(--ink, #16273f);
}
.bb-badge.hidden { display: none; }


/* ================================================================
   BUSCADOR DE AGENTES (estilo Facebook) — pantalla completa móvil
   ================================================================ */
.agent-search {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: #fff; z-index: 3400;
    display: flex; flex-direction: column;
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.agent-search.active { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
@media (max-width: 640px) {
    body.has-bottombar .agent-search { bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
}
.as-head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; flex: none;
    border-bottom: 1px solid #f0f2f5;
}
.as-back {
    border: none; background: transparent; cursor: pointer;
    width: 38px; height: 38px; border-radius: 50%;
    color: var(--ink, #16273f); font-size: 1.05rem; flex: none;
}
.as-back:active { background: #f2f4f7; }
.as-input {
    flex: 1; display: flex; align-items: center; gap: 9px;
    background: #f2f4f7; border-radius: 999px; padding: 10px 15px;
}
.as-input i { color: #9aa3ad; font-size: .9rem; }
.as-input input {
    border: none; background: transparent; outline: none;
    font-family: inherit; font-size: .95rem; color: var(--ink, #16273f);
    width: 100%;
}
.as-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.as-sec { padding: 15px 16px 7px; font-size: .92rem; font-weight: 800; color: var(--ink, #16273f); }
.as-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.as-row:active { background: #f7f8fa; }
.as-av {
    width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none;
    background: #eef1f5;
}
.as-ini {
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 1.05rem;
    background: linear-gradient(135deg, var(--ink, #16273f), #2c4266);
}
.as-info { flex: 1; min-width: 0; }
.as-info b { display: block; font-size: .95rem; color: var(--ink, #16273f); }
.as-info small { color: #8a94a1; font-size: .76rem; }
.as-go { color: #c4ccd6; font-size: .8rem; }
.as-empty { padding: 56px 24px; text-align: center; color: #b4bcc6; }
.as-empty i { font-size: 2.1rem; margin-bottom: 12px; display: block; }


/* En celular, el menú lateral respeta la barra inferior: termina justo arriba
   de ella, así los últimos ítems (Tutorial, etc.) nunca quedan tapados. */
@media (max-width: 640px) {
    body.has-bottombar .mv-side {
        height: auto !important;
        top: 0 !important;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    }
}


/* La barra se esconde deslizándose hacia abajo al scrollear hacia abajo,
   y reaparece al primer gesto hacia arriba (o cerca del tope de la página). */
.mv-bottombar { transition: transform .28s cubic-bezier(.4, 0, .2, 1); will-change: transform; }
.mv-bottombar.bb-oculta { transform: translateY(110%); }


/* ===== Área segura SUPERIOR (isla dinámica / notch) =====
   Con viewport-fit=cover el contenido llega hasta el borde físico: estas
   reglas devuelven el respiro arriba en el header y en las vistas completas. */
.header { padding-top: env(safe-area-inset-top, 0px); }
@media (max-width: 640px) {
    .notification-dropdown .notification-header { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
    .agent-search .as-head { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
    .mv-side { padding-top: env(safe-area-inset-top, 0px); }
}


/* ===== Perfil compacto en celular =====
   Menos aire vertical y estadísticas en fila: se ve todo de un vistazo
   sin scrollear tres pantallas. */
@media (max-width: 640px) {
    .profile-header { padding: 20px 16px 22px; }
    .profile-avatar { width: 104px; height: 104px; }
    .profile-avatar-edit { width: 34px; height: 34px; font-size: .85rem; }
    .profile-header-content h1, .profile-header-content h2 { font-size: 1.6rem; margin: 8px 0 4px; }
    .profile-header-content p { font-size: .84rem; margin: 2px 0; }
    /* Estadísticas: de tres tarjetas apiladas a una fila de tres */
    .profile-stats {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px; margin-top: 16px;
    }
    .profile-stats > * {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
        padding: 12px 6px !important;
        gap: 6px !important;
    }
    .profile-stats .stat-icon, .profile-stats i { font-size: .95rem; }
    .profile-stats .stat-value, .profile-stats b, .profile-stats strong { font-size: 1.25rem; }
    .profile-stats small, .profile-stats span { font-size: .68rem; line-height: 1.25; }
}


/* ===== Buscador de agentes en ESCRITORIO =====
   Ícono junto a la campanita; el panel se ancla como dropdown en vez de
   ocupar la pantalla (eso queda para celular). */
.agent-search-btn {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--ink, #16273f);
    background: var(--gray-50, #f8fafc);
    border: 1px solid var(--gray-200, #e5e7eb);
    transition: all .15s;
}
.agent-search-btn:hover { border-color: var(--gold, #C9A227); color: var(--gold, #C9A227); }
.agent-search-btn.hidden { display: none; }
@media (max-width: 640px) {
    /* En celular la búsqueda vive en la barra inferior */
    .agent-search-btn { display: none !important; }
}
@media (min-width: 641px) {
    .agent-search {
        top: 66px; right: 20px; left: auto; bottom: auto;
        width: 400px; max-height: min(540px, calc(100vh - 90px));
        border: 1px solid #e8ebf0; border-radius: 18px;
        box-shadow: 0 20px 60px rgba(10, 20, 35, .22);
        overflow: hidden;
        transform: translateY(-10px) scale(.99);
        transform-origin: top right;
    }
    .agent-search.active { transform: translateY(0) scale(1); }
    .as-back { display: none; }   /* en PC se cierra con Esc o clic afuera */
}


/* ===== Modales como VENTANA COMPLETA en celular =====
   Antes eran tarjetas flotantes al 95% (se veía el fondo a los lados), su
   cabecera quedaba bajo la isla dinámica y la barra inferior los tapaba.
   Ahora ocupan la pantalla entera, respetan el recorte superior de cada
   teléfono y se muestran por encima de la barra (vista inmersiva: se cierra
   con la X). */
@media (max-width: 640px) {
    .modal {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
        z-index: 3600;              /* por encima de la barra inferior */
    }
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100dvh;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        animation: none;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .modal-content > .modal-header { flex: none; }
    .modal-content > .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .modal-content > .modal-footer { flex: none; }
    /* Controles flotantes del detalle: siempre bajo la isla, nunca encima */
    .detail-modal .modal-close { top: calc(14px + env(safe-area-inset-top, 0px)) !important; z-index: 30 !important; }
    .detail-modal .detail-badges, .detail-modal .property-badges { top: calc(14px + env(safe-area-inset-top, 0px)) !important; }
    /* Lightbox (galería ampliada) también full screen y por encima */
    .lightbox { z-index: 3700; }
    .lightbox .lightbox-content, .lightbox img { padding-top: env(safe-area-inset-top, 0px); }
}


/* ===== Galería del detalle en celular =====
   Alto fijo de 400px + object-fit:cover recortaba las fotos (se veían
   "cortadas"). En celular la foto se muestra ENTERA sobre fondo neutro,
   y la tira de miniaturas deja de quedar mordida por el borde. */
@media (max-width: 640px) {
    .detail-gallery { display: none; }
    /* La tira de miniaturas: clase real .detail-thumbnails (no .detail-thumbs).
       Sin flex-shrink las miniaturas se aplastaban y quedaban mordidas. */
    .detail-thumbnails {
        padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
        gap: 8px;
        align-items: center;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .detail-thumbnails::-webkit-scrollbar { display: none; }
    .detail-thumb {
        width: 64px !important;
        height: 64px !important;
        flex: 0 0 64px;
        align-self: center;
    }
    .detail-thumb img { width: 100%; height: 100%; object-fit: cover; }
}


/* ================================================================
   DETALLE DE PROPIEDAD — optimización integral para celular
   ================================================================ */
@media (max-width: 640px) {
    /* Miniaturas: la primera ya no queda mordida contra el borde y cada
       una se alinea sola al deslizar (scroll-snap). */
    .detail-thumbnails {
        scroll-padding-left: 12px;
        scroll-snap-type: x mandatory;
    }
    .detail-thumb { scroll-snap-align: start; }
    .detail-thumb:first-child { margin-left: 0; }

    /* Contenido: menos aire, más información por pantalla */
    .detail-content { padding: 16px 14px 22px; }
    .detail-header h2, .detail-header h1 { font-size: 1.42rem; line-height: 1.25; margin-bottom: 6px; }
    .detail-location { font-size: .88rem; margin-bottom: 12px; }
    .detail-price, .detail-price-row { font-size: 1.5rem; margin-bottom: 10px; }
    .detail-price-old { font-size: 1.05rem; }

    /* Tarjeta del agente compacta */
    .detail-agent { padding: 10px 12px; margin: 12px 0; gap: 10px; }
    .detail-agent img, .detail-agent .agent-photo { width: 42px; height: 42px; }
    .detail-agent b, .detail-agent strong { font-size: .95rem; }

    /* Ficha técnica: 3 columnas en vez de 2 (entra todo de un vistazo) */
    .detail-features {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .detail-features > * {
        padding: 12px 6px !important;
        border-radius: 12px;
        text-align: center;
    }
    .detail-features i { font-size: 1rem; margin-bottom: 4px; }
    .detail-features b, .detail-features .feat-value { font-size: 1.15rem; }
    .detail-features small, .detail-features span { font-size: .68rem; line-height: 1.2; }

    /* Descripción y secciones */
    .detail-description { font-size: .9rem; line-height: 1.6; }
    .detail-section, .detail-block { margin-top: 18px; }
    .detail-section h3, .detail-block h3 { font-size: 1.05rem; margin-bottom: 10px; }

    /* Botones de acción a lo ancho y cómodos para el pulgar */
    .detail-actions { display: grid; grid-template-columns: 1fr; gap: 9px; margin-top: 18px; }
    .detail-actions > * { width: 100%; justify-content: center; padding: 13px 16px; font-size: .92rem; }
}


/* ================================================================
   BLOQUEO REAL DE ZOOM Y DESPLAZAMIENTO EN CELULAR
   iOS Safari IGNORA user-scalable=no en el meta viewport, así que el
   bloqueo se hace acá (touch-action) + en JS (gestos). Además se corta
   el desborde horizontal, que era lo que dejaba "mover" la página.
   ================================================================ */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    touch-action: pan-x pan-y;      /* permite scrollear, no pellizcar */
    -webkit-text-size-adjust: 100%; /* Safari no reescala el texto solo */
}
@media (max-width: 640px) {
    /* Nada puede empujar el ancho de la pantalla */
    img, video, iframe, canvas, table, pre { max-width: 100%; }
    .modal, .modal-content, .detail-content, .detail-gallery { max-width: 100vw; overflow-x: hidden; }
    .detail-gallery img { width: 100%; }
    /* La galería sí se desliza en horizontal (es su gesto propio) */
    .detail-thumbnails { touch-action: pan-x; max-width: 100vw; }
}


/* ================================================================
   GALERÍA DEL DETALLE — versión móvil definitiva
   La foto manda: ancho completo, proporción original, completa y nítida.
   ================================================================ */
@media (max-width: 640px) {
    .detail-gallery {
        display: block !important;
        position: relative;
        width: 100%;
        height: auto !important;
        aspect-ratio: auto !important;
        max-height: none !important;
        background: #0b1119;
        line-height: 0;                 /* sin franja fantasma bajo la imagen */
        overflow: visible;
    }
    /* La imagen define la altura: se ve ENTERA, sin recortes ni deformación */
    .detail-gallery img {
        display: block;
        width: 100%;
        height: auto !important;
        max-height: 62dvh;
        object-fit: contain !important;
        object-position: center;
        margin: 0 auto;
    }

    /* --- Controles que no tapan la foto --- */
    .detail-nav {
        width: 38px; height: 38px;
        background: rgba(11, 17, 25, .42);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        border: none; color: #fff;
        opacity: .9;
    }
    .detail-nav i { font-size: .9rem; }
    .detail-nav.prev { left: 8px; }
    .detail-nav.next { right: 8px; }
    .detail-zoom-hint {
        bottom: 10px; right: 10px;
        padding: 6px 11px; font-size: .74rem;
        background: rgba(11, 17, 25, .55);
    }

    /* --- Etiquetas discretas: informan sin tapar --- */
    .detail-gallery .card-badges {
        top: calc(10px + env(safe-area-inset-top, 0px));
        left: 10px; right: 62px;
        gap: 5px; flex-wrap: wrap;
    }
    .detail-gallery .card-badges > * {
        font-size: .62rem !important;
        padding: 4px 9px !important;
        line-height: 1.15;
    }

    /* --- Miniaturas: uniformes, completas, deslizables --- */
    .detail-thumbnails {
        display: flex;
        gap: 7px;
        padding: 9px 12px calc(9px + env(safe-area-inset-bottom, 0px));
        background: #f4f6f8;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        scroll-padding-left: 12px;
        touch-action: pan-x;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        max-width: 100vw;
    }
    .detail-thumbnails::-webkit-scrollbar { display: none; }
    .detail-thumb {
        width: 58px !important;
        height: 58px !important;
        flex: 0 0 58px;
        border-radius: 9px;
        overflow: hidden;
        opacity: .55;
        border: 2px solid transparent;
        scroll-snap-align: start;
        transition: opacity .15s, border-color .15s;
    }
    .detail-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
    /* La seleccionada, bien clara: opaca y con filete dorado */
    .detail-thumb.active {
        opacity: 1;
        border-color: var(--gold, #C9A227);
        box-shadow: 0 2px 8px rgba(201, 162, 39, .35);
    }
}


/* ===== Lightbox (pantalla completa) con zoom en celular ===== */
@media (max-width: 640px) {
    .lightbox { background: #05080d; }
    .lightbox img, .lightbox-content img {
        width: 100%; height: auto;
        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 90px);
        object-fit: contain;
        /* Acá SÍ se puede pellizcar para acercar */
        touch-action: pinch-zoom;
    }
    .lightbox-close, .lightbox .modal-close {
        top: calc(12px + env(safe-area-inset-top, 0px)) !important;
        right: 12px !important;
    }
    .lightbox-nav { width: 40px; height: 40px; }
}


/* ================================================================
   FIX ESTRUCTURAL del detalle en celular
   El modal fullscreen usa flex-column, pero el detalle no tiene
   .modal-body: el flex COMPRIMÍA la galería y la foto desbordaba
   tapando precio y miniaturas. El detalle scrollea como página.
   ================================================================ */
@media (max-width: 640px) {
    .detail-modal .modal-content {
        display: block !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .detail-gallery { flex: none; overflow: hidden; }
    .detail-gallery img { position: relative; z-index: 1; }
    .detail-thumbnails { position: relative; z-index: 2; }
    .detail-content { position: relative; z-index: 2; background: #fff; }
}
