:root {
    --blanco: #ffffff;
    --plata-medio: #d0d5dd;
    --plata-oscuro: #6b7280;
    --negro-profundo: #1a1a2e;
    --rojo-principal: #bf2c3a;
    --rojo-10: rgba(191, 44, 58, 0.10);
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.05);
    --navbar-height: 70px;
}

.layout-principal {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* ============================================================
    FILTROS SIDEBAR (sin Bootstrap)
============================================================ */
.filtros-sidebar {
    background: var(--blanco);
    border: 1px solid var(--plata-medio);
    box-shadow: var(--shadow-sm);
    border-radius: 24px;
    padding: 2rem 1.5rem;
    position: sticky;
    top: calc(var(--navbar-height) + 1rem);
    max-height: calc(100vh - var(--navbar-height) - 2rem);
    overflow-y: auto;
}
.filtros-sidebar::-webkit-scrollbar {
    width: 4px;
}
.filtros-sidebar::-webkit-scrollbar-thumb {
    background: var(--rojo-principal);
    border-radius: 10px;
}
.filtros-sidebar .sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--negro-profundo);
    margin-bottom: 1.5rem;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
}
.filtros-sidebar .form-label {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--plata-oscuro);
    margin-bottom: 0.3rem;
}
.filtros-sidebar .form-control,
.filtros-sidebar .form-select {
    border-radius: 10px;
    border: 1px solid #d0d5dd;
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
    background: white;
    height: 42px;
    transition: border-color 0.2s;
    width: 100%;
}
.filtros-sidebar .form-control:focus,
.filtros-sidebar .form-select:focus {
    border-color: var(--rojo-principal);
    box-shadow: 0 0 0 3px rgba(191, 44, 58, 0.12);
}
.filtros-sidebar .btn-rojo {
    width: 100%;
    padding: 0.7rem;
    font-size: 0.95rem;
    border-radius: 10px;
    font-weight: 600;
    margin-top: 0.5rem;
    border: none;
    cursor: pointer;
    background: var(--rojo-principal);
    color: white;
    transition: background 0.2s;
}
.filtros-sidebar .btn-rojo:hover {
    background: #a8232f;
}
.filtros-sidebar .btn-limpiar {
    width: 100%;
    padding: 0.6rem;
    font-size: 0.85rem;
    border-radius: 10px;
    background: transparent;
    border: 1px solid #d0d5dd;
    color: var(--plata-oscuro);
    transition: all 0.2s;
    margin-top: 0.5rem;
    text-align: center;
    display: block;
    text-decoration: none;
}
.filtros-sidebar .btn-limpiar:hover {
    background: #d0d5dd;
    color: var(--negro-profundo);
}
.filtro-grupo {
    margin-bottom: 1.25rem;
}
.filtro-grupo:last-of-type {
    margin-bottom: 0.5rem;
}

/* ============================================================
    FILTROS - COLAPSABLE EN MÓVIL Y TABLET
============================================================ */
.filtros-toggle {
    display: none;
    width: 100%;
    background: var(--blanco);
    border: 1px solid var(--plata-medio);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--negro-profundo);
    cursor: pointer;
    transition: all 0.3s;
    justify-content: space-between;
    align-items: center;
    font-family: 'Inter', sans-serif;
}
.filtros-toggle:hover {
    background: var(--rojo-10);
    border-color: var(--rojo-principal);
}
.filtros-toggle i {
    transition: transform 0.3s;
}
.filtros-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* ============================================================
    GRID DE PROPIEDADES (CSS Grid, sin Bootstrap)
============================================================ */
.propiedades-grid {
    background: #F5F7FA;
    border-radius: 24px;
    padding: 1.5rem;
    min-height: 400px;
}
.grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.grid-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    margin: 0;
    color: var(--negro-profundo);
}
.grid-header span {
    font-size: 0.85rem;
    color: var(--plata-oscuro);
}

/* Contenedor de tarjetas (grid) */
.propiedades-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* ============================================================
    TARJETAS DE PROPIEDAD (versión compacta)
    - IMAGEN CON RELACIÓN DE ASPECTO 4:3 FIJA
============================================================ */
.property-card-grid {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.property-card-grid:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(191, 44, 58, 0.12);
    border-color: var(--rojo-principal);
}
.property-card-grid .property-image {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
    aspect-ratio: 4 / 3;
    width: 100%;
}
.property-card-grid .property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}
.property-card-grid:hover .property-image img {
    transform: scale(1.05);
}
.property-card-grid .property-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
    color: #bbb;
    font-size: 2rem;
}
.property-card-grid .property-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--rojo-principal);
    color: white;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.property-card-grid .property-body {
    padding: 0.9rem 1rem 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.property-card-grid .property-code {
    font-size: 0.65rem;
    color: #999;
    font-weight: 500;
    margin-bottom: 0.1rem;
}
.property-card-grid .property-title {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--negro-profundo);
    margin-bottom: 0.2rem;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.property-card-grid .property-location {
    font-size: 0.75rem;
    color: #777;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.property-card-grid .property-location i {
    margin-right: 3px;
    color: var(--rojo-principal);
}
.property-card-grid .property-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--rojo-principal);
    margin-bottom: 0.3rem;
}
.property-card-grid .property-features {
    display: flex;
    gap: 0.8rem;
    font-size: 0.7rem;
    color: #555;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.property-card-grid .property-features span {
    display: flex;
    align-items: center;
    gap: 3px;
}
.property-card-grid .property-features i {
    color: var(--rojo-principal);
    font-size: 0.7rem;
}
.btn-outline-rojo-small {
    background: transparent;
    color: var(--rojo-principal);
    border: 2px solid var(--rojo-principal);
    padding: 0.25rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.7rem;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    margin-top: auto;
    align-self: flex-start;
}
.btn-outline-rojo-small:hover {
    background: var(--rojo-principal);
    color: white;
}

/* ============================================================
    PAGINACIÓN ESTILO SUPERADMIN (CSS PURO)
============================================================ */
.paginacion-pura {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 2rem;
}
.paginacion-pura a,
.paginacion-pura span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.8rem;
    border-radius: 8px;
    border: 1px solid #d0d5dd;
    background: white;
    color: #1a1a2e;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}
.paginacion-pura a:hover {
    background: #f5f5f7;
    border-color: #bf2c3a;
    color: #bf2c3a;
    transform: translateY(-1px);
}
.paginacion-pura .active {
    background: #bf2c3a;
    border-color: #bf2c3a;
    color: white;
    box-shadow: 0 4px 12px rgba(191, 44, 58, 0.25);
    font-weight: 600;
}
.paginacion-pura .disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    background: #f5f5f7;
    border-color: #d0d5dd;
    color: #999;
}
.paginacion-info {
    text-align: center;
    color: #6c7a8a;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-family: 'Inter', sans-serif;
}

/* ============================================================
    EMPTY STATE
============================================================ */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--plata-oscuro);
}
.empty-state i {
    font-size: 4rem;
    opacity: 0.2;
    margin-bottom: 1.5rem;
}
.empty-state h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-family: 'Inter', sans-serif;
}
.empty-state p {
    font-size: 0.95rem;
    color: #999;
    margin-bottom: 1.5rem;
}

/* ============================================================
    RESPONSIVE
============================================================ */
@media (max-width: 991px) {
    .layout-principal {
        flex-direction: column;
    }
    .layout-principal > div {
        flex: 1 1 100% !important;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .filtros-sidebar {
        position: relative;
        top: 0;
        max-height: none;
        padding: 1rem 1.2rem;
        margin: 0;
        border-radius: 16px;
    }
    .filtros-toggle {
        display: flex;
        margin-bottom: 0.5rem;
    }
    .filtros-contenido {
        display: none;
    }
    .filtros-contenido.mostrar {
        display: block;
    }
    .filtros-contenido .sidebar-title {
        display: none;
    }
    .propiedades-grid {
        padding: 1.2rem;
        margin: 0;
        border-radius: 16px;
    }
    .grid-header {
        flex-direction: column;
        text-align: center;
    }
    .grid-header h2 {
        font-size: 1.2rem;
    }
    .propiedades-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .filtros-sidebar {
        padding: 1.2rem 1rem !important;
        border-radius: 16px;
    }
    .propiedades-grid {
        padding: 1.2rem 1rem !important;
        border-radius: 16px;
    }
    .filtros-toggle {
        padding: 0.8rem 1rem !important;
        border-radius: 12px;
    }
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    .propiedades-grid-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .paginacion-pura a,
    .paginacion-pura span {
        min-width: 34px;
        height: 34px;
        font-size: 0.8rem;
        padding: 0 0.6rem;
    }
}

@media (max-width: 480px) {
    .filtros-sidebar .form-control,
    .filtros-sidebar .form-select {
        font-size: 0.8rem;
        height: 38px;
        padding: 0.4rem 0.7rem;
    }
    .property-card-grid .property-body {
        padding: 0.7rem 0.8rem 1rem;
    }
    .property-card-grid .property-price {
        font-size: 1rem;
    }
    .propiedades-grid {
        padding: 0.8rem;
    }
    .filtros-sidebar {
        padding: 0.8rem 0.8rem;
    }
    .paginacion-pura a,
    .paginacion-pura span {
        min-width: 30px;
        height: 30px;
        font-size: 0.75rem;
        padding: 0 0.4rem;
    }
    .paginacion-pura {
        gap: 0.2rem;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .filtros-sidebar {
        padding: 1.5rem 1.5rem;
    }
    .propiedades-grid {
        padding: 1.5rem;
    }
}