* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    color: #1f2d3d;
}

/* LOGIN */
.login-body {
    min-height: 100vh;
    background: #f2f2f2;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.10);
    padding: 35px;
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo img {
    width: 130px;
    max-width: 100%;
    height: auto;
}

.login-card h1 {
    text-align: center;
    font-size: 30px;
    color: #163f5f;
    margin-bottom: 8px;
}

.subtitulo {
    text-align: center;
    color: #7b7b7b;
    margin-bottom: 25px;
}

.alerta-error {
    background: #fbe3e4;
    color: #8a1f11;
    border: 1px solid #fbc2c4;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.campo {
    margin-bottom: 18px;
}

.campo label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: #163f5f;
}

.campo input {
    width: 100%;
    height: 44px;
    border: 1px solid #cfcfcf;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 15px;
}

.campo input:focus {
    outline: none;
    border-color: #163f5f;
}

.btn-principal {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 8px;
    background: #163f5f;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn-principal:hover {
    background: #0f314b;
}

/* PANEL */
.panel-body {
    min-height: 100vh;
    background: #f5f6f8;
}

.panel-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: #163f5f;
    color: white;
    padding: 30px 20px;
}

.sidebar-logo {
    text-align: center;
    margin-bottom: 20px;
}

.sidebar-logo img {
    width: 120px;
    background: #ffffff;
    border-radius: 12px;
    padding: 10px;
}

.sidebar h2 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 30px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-menu a {
    text-decoration: none;
    color: white;
    padding: 12px 14px;
    border-radius: 8px;
    transition: 0.2s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.activo {
    background: rgba(255, 255, 255, 0.14);
}

.contenido {
    flex: 1;
    padding: 30px;
}

.topbar {
    margin-bottom: 30px;
}

.topbar h1 {
    color: #163f5f;
    margin-bottom: 6px;
}

.topbar p {
    color: #666;
}

.cards-resumen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card,
.bloque {
    background: white;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    padding: 24px;
    overflow-x: auto;
}

.card h3,
.bloque h2 {
    color: #163f5f;
    margin-bottom: 10px;
}

.card p,
.bloque p {
    color: #555;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .panel-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}

.topbar-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-inline {
    display: inline-block;
    text-decoration: none;
    padding: 12px 18px;
    line-height: normal;
    text-align: center;
}

.btn-secundario {
    display: inline-block;
    background: #e9ecef;
    color: #163f5f;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: bold;
}


.tabla-responsive {
    width: 100%;
    overflow-x: auto !important;
    display: block;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    max-width: 100vw;
}


.tabla {
    min-width: 1100px;
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Unificado para tabla */
.tabla th,
.tabla td {
    padding: 12px 10px;
    border-bottom: 1px solid #e8e8e8;
    text-align: left;
    vertical-align: middle;
    word-break: break-word;
}

.tabla th {
    background: #f8f9fb;
    color: #163f5f;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-align: center;
    white-space: normal;
    padding: 10px 14px;
    line-height: 1.2;
}

.acciones {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-accion {
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
}

.btn-accion.editar {
    background: #dbeafe;
    color: #1d4ed8;
}

.btn-accion.eliminar {
    background: #fee2e2;
    color: #b91c1c;
}

/* Unificado para form-grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 18px;
}

.campo select,
.campo textarea {
    width: 100%;
    border: 1px solid #cfcfcf;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 15px;
    font-family: Arial, Helvetica, sans-serif;
}

.campo textarea:focus,
.campo select:focus {
    outline: none;
    border-color: #163f5f;
}

.campo-full {
    grid-column: 1 / -1;
}

.checkbox-linea {
    display: flex;
    align-items: center;
}

.checkbox-linea label {
    margin-bottom: 0;
    font-weight: normal;
    color: #333;
}

.acciones-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}



.topbar-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-inline {
    display: inline-block;
    text-decoration: none;
    padding: 12px 18px;
    line-height: normal;
    text-align: center;
}

.btn-secundario {
    display: inline-block;
    background: #e9ecef;
    color: #163f5f;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: bold;
}

.tabla-responsive {
    width: 100%;
    overflow-x: auto;
}

.tabla {
    width: 100%;
    border-collapse: collapse;
    min-width: 1100px;
}

.tabla th,
.tabla td {
    padding: 12px 10px;
    border-bottom: 1px solid #e8e8e8;
    text-align: left;
    vertical-align: middle;
}

.tabla th,
.tabla td {
    padding: 12px 14px;
    border-bottom: 1px solid #e8e8e8;
    vertical-align: middle;
    word-break: break-word;
}
    gap: 8px;
    flex-wrap: wrap;
}

.btn-accion {
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.2s, color 0.2s;
}

.btn-accion.editar {
    background: #dbeafe;
    color: #1d4ed8;
}

.btn-accion.eliminar {
    background: #fee2e2;
    color: #b91c1c;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 18px;
}

.campo select,
.campo textarea,
.campo input[type="file"] {
    width: 100%;
    border: 1px solid #cfcfcf;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 15px;
    font-family: Arial, Helvetica, sans-serif;
    background: #fff;
}

.campo textarea:focus,
.campo select:focus,
.campo input[type="file"]:focus {
    outline: none;
    border-color: #163f5f;
}

.campo-full {
    grid-column: 1 / -1;
}

.checkbox-linea {
    display: flex;
    align-items: center;
}

.checkbox-linea label {
    margin-bottom: 0;
    font-weight: normal;
    color: #333;
}

.acciones-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.texto-ayuda {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 13px;
}

.galeria-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.imagen-admin-card {
    border: 1px solid #e4e4e4;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.imagen-admin-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.imagen-admin-info {
    padding: 12px;
}

.imagen-admin-botones {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.badge-principal {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

.miniatura-tabla {
    width: 70px;
    height: 55px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.sin-foto {
    font-size: 13px;
    color: #777;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .tabla th, .tabla td {
        padding: 10px 6px;
        font-size: 13px;
    }
}

/* ===== WEB PUBLICA ===== */

.public-body {
    background: #f7f7f7;
    color: #1f2d3d;
}

.container {
    width: min(1200px, 92%);
    margin: 0 auto;
}

.public-header {
    background: #ffffff;
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.brand img {
    width: 62px;
    height: 62px;
    object-fit: contain;
}

.brand h1 {
    font-size: 24px;
    color: #163f5f;
    margin-bottom: 4px;
}

.brand p {
    color: #666;
    font-size: 14px;
}

.public-nav {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.public-nav a {
    text-decoration: none;
    color: #163f5f;
    font-weight: 600;
}

.public-nav a.nav-admin {
    background: #163f5f;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
}

.hero {
    background: linear-gradient(135deg, #163f5f 0%, #245b84 100%);
    color: #fff;
    padding: 70px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero h2 {
    font-size: 42px;
    margin-bottom: 18px;
    line-height: 1.1;
}

.hero p {
    font-size: 18px;
    line-height: 1.6;
    color: #eef3f7;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.hero-logo-box {
    background: rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
}

.hero-logo-box img {
    max-width: 260px;
    width: 100%;
    background: #fff;
    border-radius: 18px;
    padding: 18px;
}

.seccion-publica {
    padding: 50px 0;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.section-head h2,
.section-head h3 {
    color: #163f5f;
    margin-bottom: 6px;
}

.section-head p {
    color: #666;
}

.link-ver-mas {
    text-decoration: none;
    color: #163f5f;
    font-weight: bold;
}

.grid-propiedades {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 24px;
}

.card-propiedad {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.card-link-imagen {
    display: block;
    text-decoration: none;
}

.card-link-imagen img,
.sin-imagen-card {
    width: 100%;
    height: 230px;
    object-fit: cover;
    display: block;
}

.sin-imagen-card {
    background: #ececec;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.card-propiedad-body {
    padding: 18px;
}

.card-top {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.badge-public,
.badge-destacada {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

.badge-public {
    background: #e6eef5;
    color: #163f5f;
}

.badge-destacada {
    background: #f5ead3;
    color: #7a5b1b;
}

.card-propiedad h4 {
    font-size: 22px;
    color: #163f5f;
    margin-bottom: 10px;
}

.card-ubicacion {
    color: #666;
    margin-bottom: 10px;
}

.card-precio {
    font-size: 22px;
    font-weight: bold;
    color: #163f5f;
    margin-bottom: 14px;
}

.card-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: #555;
    margin-bottom: 16px;
    font-size: 14px;
}

.card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bloque-publico-vacio {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.filtros-publicos {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    margin-bottom: 28px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.acciones-filtro {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.detalle-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    align-items: start;
}

.slider-wrapper {
    position: relative;
    display: block;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(22, 63, 95, 0.75);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

.slider-btn:hover {
    background: rgba(22, 63, 95, 0.97);
}

.slider-prev { left: 14px; }
.slider-next { right: 14px; }

.detalle-imagen-principal {
    width: 100%;
}

.detalle-imagen-principal img {
    width: 100%;
    height: 480px;
    object-fit: cover;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    transition: opacity 0.2s ease;
    display: block;
}

.detalle-galeria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.detalle-galeria img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    opacity: 0.65;
    border: 2px solid transparent;
    transition: opacity 0.2s, border-color 0.2s;
}

.detalle-galeria img:hover {
    opacity: 0.9;
}

.detalle-galeria img.thumb-activa {
    opacity: 1;
    border-color: #163f5f;
}

.detalle-info {
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.detalle-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.detalle-info h2 {
    color: #163f5f;
    font-size: 34px;
    margin-bottom: 14px;
}

.detalle-precio {
    font-size: 28px;
    font-weight: bold;
    color: #163f5f;
    margin-bottom: 14px;
}

.detalle-ubicacion {
    color: #666;
    margin-bottom: 18px;
}

.detalle-caracteristicas {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.detalle-caracteristicas div {
    background: #f7f8fa;
    border-radius: 10px;
    padding: 12px;
}

.detalle-descripcion h3 {
    color: #163f5f;
    margin-bottom: 10px;
}

.detalle-descripcion p {
    color: #555;
    line-height: 1.7;
}

.detalle-acciones {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.sin-imagen-detalle {
    background: #ececec;
    border-radius: 18px;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-weight: bold;
}

.public-footer {
    background: #163f5f;
    color: #fff;
    text-align: center;
    padding: 22px 0;
    margin-top: 30px;
}

@media (max-width: 992px) {
    .hero-grid,
    .detalle-grid {
        grid-template-columns: 1fr;
    }

    .filtros-publicos {
        grid-template-columns: 1fr;
    }

    .detalle-imagen-principal img {
        height: 340px;
    }
}

@media (max-width: 768px) {
    .hero h2 {
        font-size: 32px;
    }

    .brand h1 {
        font-size: 20px;
    }

    .detalle-info h2 {
        font-size: 28px;
    }

    .detalle-caracteristicas {
        grid-template-columns: 1fr;
    }

    /* Selects y inputs de filtros en mobile */
    .filtros-publicos .campo select,
    .filtros-publicos .campo input[type="text"] {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-color: #f7f8fa;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23163f5f' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 20px;
        border: 1.5px solid #c5d3de;
        border-radius: 10px;
        padding: 14px 40px 14px 14px;
        font-size: 16px;
        font-family: Arial, Helvetica, sans-serif;
        color: #163f5f;
        font-weight: 600;
        width: 100%;
        min-height: 50px;
        cursor: pointer;
    }

    .filtros-publicos .campo input[type="text"] {
        background-image: none;
        padding-right: 14px;
        font-weight: normal;
        color: #333;
    }

    .filtros-publicos .campo label {
        font-size: 13px;
        color: #555;
        margin-bottom: 6px;
        display: block;
    }

    .filtros-publicos .btn-principal {
        width: 100%;
        font-size: 16px;
        padding: 14px;
    }

    .filtros-publicos .btn-secundario {
        width: 100%;
        text-align: center;
        font-size: 16px;
        padding: 14px;
    }
}

/* ===== WHATSAPP FLOTANTE ===== */
.whatsapp-flotante {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 62px;
    height: 62px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(37, 211, 102, 0.45);
    z-index: 1000;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.whatsapp-flotante:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.60);
}

.whatsapp-flotante svg {
    width: 34px;
    height: 34px;
    fill: #ffffff;
}

/* ===== FOOTER PUBLICO CON REDES ===== */
.footer-redes {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.footer-redes a {
    color: #a8c7df;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-redes a:hover {
    color: #ffffff;
}

/* ===== CARDS DASHBOARD CON NUMERO ===== */
.card-numero {
    font-size: 42px;
    font-weight: bold;
    color: #163f5f;
    margin-bottom: 6px;
    line-height: 1;
}

.card-etiqueta {
    color: #888;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}