/* =========================================================
   PANEL ADMINISTRATIVO
   Gustavo Behrens Propiedades
   IDENTIDAD: AZUL + DORADO
   ========================================================= */

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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f6f8;
    color: #222;
}


/* =========================================================
   ENCABEZADO
   ========================================================= */

.admin-header {
    background: #0d2b45;
    color: white;

    min-height: 82px;
    padding: 18px 45px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 3px solid #c9a227;

    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}


.admin-header h1 {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: 0.3px;
}


.admin-header span {
    display: block;

    margin-top: 4px;

    color: #d9dde2;

    font-size: 13px;
}


/* =========================================================
   BOTÓN VER SITIO
   ========================================================= */

.btn-volver {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 10px 17px;

    border: 1px solid #c9a227;
    border-radius: 6px;

    color: white;
    text-decoration: none;

    font-size: 14px;

    transition: all 0.2s ease;
}


.btn-volver:hover {
    background: #c9a227;
    color: #0d2b45;
}


/* =========================================================
   CONTENEDOR
   ========================================================= */

.admin-container {
    width: 100%;
    max-width: 1250px;

    margin: 40px auto;

    padding: 0 25px;
}


/* =========================================================
   TARJETAS
   ========================================================= */

.admin-card {
    background: white;

    border: 1px solid #e1e4e8;

    border-radius: 10px;

    padding: 30px;

    margin-bottom: 30px;

    box-shadow:
        0 3px 12px rgba(13, 43, 69, 0.07);
}


.admin-card h2 {
    color: #0d2b45;

    font-size: 22px;
    font-weight: 600;

    margin-bottom: 7px;
}


.subtitulo {
    color: #777;

    font-size: 14px;

    margin-bottom: 28px;
}


/* =========================================================
   FORMULARIO
   ========================================================= */

.form-grid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 22px 25px;
}


.form-group {
    display: flex;
    flex-direction: column;
}


.form-full {
    grid-column: 1 / -1;
}


.form-group label {
    color: #0d2b45;

    font-size: 14px;
    font-weight: 600;

    margin-bottom: 8px;
}


.form-group input,
.form-group select,
.form-group textarea {

    width: 100%;

    background: #fff;

    border: 1px solid #d1d6dc;

    border-radius: 6px;

    padding: 12px 13px;

    color: #222;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;

    transition:
        border 0.2s ease,
        box-shadow 0.2s ease;
}


.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #aaa;
}


.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {

    outline: none;

    border-color: #c9a227;

    box-shadow:
        0 0 0 3px rgba(201, 162, 39, 0.12);
}


.form-group textarea {

    resize: vertical;

    min-height: 120px;
}


.form-group small {

    color: #888;

    font-size: 12px;

    margin-top: 6px;
}


/* =========================================================
   BOTONES
   ========================================================= */

.form-actions {

    display: flex;
    align-items: center;

    gap: 12px;

    margin-top: 28px;

    padding-top: 22px;

    border-top: 1px solid #eeeeee;
}


.form-actions button {

    border: none;

    border-radius: 6px;

    padding: 12px 22px;

    font-family: inherit;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}


.btn-guardar {

    background: #0d2b45;

    color: white;

    border: 1px solid #0d2b45 !important;
}


.btn-guardar:hover {

    background: #c9a227;

    color: #0d2b45;

    border-color: #c9a227 !important;

    transform: translateY(-1px);
}


.btn-limpiar {

    background: white;

    color: #0d2b45;

    border: 1px solid #ccd2d8 !important;
}


.btn-limpiar:hover {

    background: #f1f3f5;

    border-color: #c9a227 !important;
}


/* =========================================================
   MENSAJES
   ========================================================= */

.mensaje {

    margin-top: 18px;

    padding: 12px 15px;

    border-radius: 6px;

    font-size: 14px;

    display: none;
}


.mensaje.exito {

    display: block;

    background: #edf7f1;

    border: 1px solid #c7e5d2;

    color: #23663a;
}


.mensaje.error {

    display: block;

    background: #fdf0f0;

    border: 1px solid #efcccc;

    color: #8c2828;
}


/* =========================================================
   CABECERA DE LISTADO
   ========================================================= */

.lista-header {

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;
}


.lista-header .subtitulo {
    margin-bottom: 0;
}


.btn-actualizar {

    border: 1px solid #c9a227;

    background: white;

    color: #0d2b45;

    padding: 10px 17px;

    border-radius: 6px;

    font-family: inherit;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}


.btn-actualizar:hover {

    background: #c9a227;

    color: #0d2b45;
}


/* =========================================================
   TABLA
   ========================================================= */

.tabla-container {

    width: 100%;

    overflow-x: auto;

    border: 1px solid #e1e4e8;

    border-radius: 7px;
}


table {

    width: 100%;

    border-collapse: collapse;

    min-width: 750px;
}


thead {

    background: #0d2b45;

    color: white;
}


th {

    padding: 14px 13px;

    color: white;

    font-size: 12px;

    font-weight: 700;

    text-align: left;

    text-transform: uppercase;

    letter-spacing: 0.4px;

    border-bottom: 3px solid #c9a227;
}


td {

    padding: 15px 13px;

    color: #444;

    font-size: 14px;

    border-bottom: 1px solid #eeeeee;
}


tbody tr {

    transition: background 0.15s ease;
}


tbody tr:hover {

    background: #f8f9fb;
}


tbody tr:last-child td {

    border-bottom: none;
}


/* =========================================================
   BOTÓN VER
   ========================================================= */

.btn-ver {

    display: inline-block;

    background: #0d2b45;

    color: white;

    padding: 7px 13px;

    border-radius: 5px;

    text-decoration: none;

    font-size: 12px;

    font-weight: 600;

    transition: all 0.2s ease;
}


.btn-ver:hover {

    background: #c9a227;

    color: #0d2b45;
}


/* =========================================================
   ID
   ========================================================= */

td:first-child {

    color: #9b7b17;

    font-size: 13px;

    font-weight: 700;
}


/* =========================================================
   PRECIO
   ========================================================= */

td:nth-child(4) {

    color: #0d2b45;

    font-weight: 700;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 800px) {

    .admin-header {

        padding: 18px 22px;

        align-items: flex-start;

        gap: 15px;
    }


    .admin-header h1 {

        font-size: 18px;
    }


    .admin-container {

        margin-top: 25px;

        padding: 0 15px;
    }


    .admin-card {

        padding: 22px 18px;
    }


    .form-grid {

        grid-template-columns: 1fr;
    }


    .form-full {

        grid-column: auto;
    }


    .lista-header {

        align-items: flex-start;

        flex-direction: column;
    }


    .btn-actualizar {

        width: 100%;
    }
}


@media (max-width: 500px) {

    .admin-header {

        flex-direction: column;
    }


    .btn-volver {

        width: 100%;

        justify-content: center;
    }


    .form-actions {

        flex-direction: column;

        align-items: stretch;
    }


    .form-actions button {

        width: 100%;
    }
}

/* =========================================================
   LOGIN ADMINISTRATIVO
   ========================================================= */

.login-body {

    min-height: 100vh;

    background:
        linear-gradient(
            135deg,
            #0d2b45 0%,
            #163f60 100%
        );

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;
}


.login-container {

    width: 100%;

    max-width: 430px;
}


.login-card {

    background: white;

    padding: 40px;

    border-radius: 12px;

    border-top: 4px solid #c9a227;

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.25);

    text-align: center;
}


.login-logo {

    width: 62px;

    height: 62px;

    margin: 0 auto 20px;

    border-radius: 50%;

    background: #0d2b45;

    color: #c9a227;

    border: 2px solid #c9a227;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 22px;

    font-weight: bold;
}


.login-card h1 {

    color: #0d2b45;

    font-size: 24px;

    margin-bottom: 3px;
}


.login-card h2 {

    color: #c9a227;

    font-size: 15px;

    letter-spacing: 2px;

    text-transform: uppercase;

    margin-bottom: 15px;
}


.login-subtitulo {

    color: #777;

    font-size: 14px;

    margin-bottom: 28px;
}


.login-group {

    text-align: left;

    margin-bottom: 18px;
}


.login-group label {

    display: block;

    color: #0d2b45;

    font-size: 14px;

    font-weight: 600;

    margin-bottom: 7px;
}


.login-group input {

    width: 100%;

    padding: 12px;

    border: 1px solid #d1d6dc;

    border-radius: 6px;

    font-size: 15px;
}


.login-group input:focus {

    outline: none;

    border-color: #c9a227;

    box-shadow:
        0 0 0 3px rgba(201, 162, 39, 0.12);
}


.btn-login {

    width: 100%;

    margin-top: 8px;

    padding: 13px;

    border: none;

    border-radius: 6px;

    background: #0d2b45;

    color: white;

    font-size: 15px;

    font-weight: bold;

    cursor: pointer;

    transition: 0.2s;
}


.btn-login:hover {

    background: #c9a227;

    color: #0d2b45;
}


.login-error {

    background: #fdf0f0;

    border: 1px solid #efcccc;

    color: #8c2828;

    padding: 10px;

    border-radius: 6px;

    font-size: 13px;

    margin-bottom: 18px;
}


.login-volver {

    display: inline-block;

    margin-top: 25px;

    color: #0d2b45;

    font-size: 13px;

    text-decoration: none;
}



.login-volver:hover {

    color: #c9a227;
}
/* =========================================================
   LOGIN ADMINISTRATIVO
   Gustavo Behrens Propiedades
   ========================================================= */

.login-body {
    min-height: 100vh;

    background: linear-gradient(
        135deg,
        #0d2b45 0%,
        #163f60 100%
    );

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
}


.login-container {
    width: 100%;
    max-width: 430px;
}


.login-card {
    background: white;

    padding: 40px;

    border-radius: 12px;

    border-top: 4px solid #c9a227;

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.25);

    text-align: center;
}


.login-logo {
    width: 62px;
    height: 62px;

    margin: 0 auto 20px;

    border-radius: 50%;

    background: #0d2b45;

    color: #c9a227;

    border: 2px solid #c9a227;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;
    font-weight: bold;
}


.login-card h1 {
    color: #0d2b45;

    font-size: 24px;

    margin-bottom: 3px;
}


.login-card h2 {
    color: #c9a227;

    font-size: 15px;

    letter-spacing: 2px;

    text-transform: uppercase;

    margin-bottom: 15px;
}


.login-subtitulo {
    color: #777;

    font-size: 14px;

    margin-bottom: 28px;
}


.login-group {
    text-align: left;

    margin-bottom: 18px;
}


.login-group label {
    display: block;

    color: #0d2b45;

    font-size: 14px;

    font-weight: 600;

    margin-bottom: 7px;
}


.login-group input {
    width: 100%;

    padding: 12px;

    border: 1px solid #d1d6dc;

    border-radius: 6px;

    font-size: 15px;
}


.login-group input:focus {
    outline: none;

    border-color: #c9a227;

    box-shadow:
        0 0 0 3px rgba(201, 162, 39, 0.12);
}


.btn-login {
    width: 100%;

    margin-top: 8px;

    padding: 13px;

    border: none;

    border-radius: 6px;

    background: #0d2b45;

    color: white;

    font-size: 15px;

    font-weight: bold;

    cursor: pointer;

    transition: 0.2s;
}


.btn-login:hover {
    background: #c9a227;

    color: #0d2b45;
}


.login-error {
    background: #fdf0f0;

    border: 1px solid #efcccc;

    color: #8c2828;

    padding: 10px;

    border-radius: 6px;

    font-size: 13px;

    margin-bottom: 18px;
}


.login-volver {
    display: inline-block;

    margin-top: 25px;

    color: #0d2b45;

    font-size: 13px;

    text-decoration: none;
}


.login-volver:hover {
    color: #c9a227;
}


/* =========================================================
   LOGIN RESPONSIVE
   ========================================================= */

@media (max-width: 500px) {

    .login-card {
        padding: 30px 22px;
    }

    .login-card h1 {
        font-size: 21px;
    }

}
/* =========================================================
   VISTA PREVIA DE FOTOS DE PROPIEDADES
   Miniaturas uniformes antes de guardar
   ========================================================= */

#vista-previa-fotos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 16px;
    width: 100%;
}

#vista-previa-fotos .foto-previa {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 2px solid #e1e4e8;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}

#vista-previa-fotos .foto-previa img {
    display: block;
    width: 100%;
    height: 120px;
    object-fit: cover;
    object-position: center;
    border-radius: 5px;
}

#vista-previa-fotos .foto-previa.foto-principal {
    border-color: #c9a227;
    box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.15);
}

@media (max-width: 500px) {
    #vista-previa-fotos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    #vista-previa-fotos .foto-previa img {
        height: 100px;
    }
}


/* =========================================================
   ACCIONES DEL ENCABEZADO
   ========================================================= */

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

.logout-form {
    margin: 0;
}

.logout-form .btn-volver {
    border: none;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}


/* =========================================================
   FOTOS ACTUALES DE LA PROPIEDAD (EDICIÓN)
   ========================================================= */

#fotos-actuales[hidden] {
    display: none;
}

.lista-fotos-actuales {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 16px;
    width: 100%;
}

.foto-actual {
    border: 2px solid #e1e4e8;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
    overflow: hidden;
}

.foto-actual.foto-principal {
    border-color: #c9a227;
    box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.15);
}

.foto-actual img {
    display: block;
    width: 100%;
    height: 120px;
    object-fit: cover;
    object-position: center;
    border-radius: 5px;
}

.foto-actual-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.foto-actual-acciones button {
    flex: 1 1 auto;
    border: none;
    border-radius: 5px;
    padding: 6px 8px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.foto-actual-acciones button:hover {
    opacity: 0.85;
}

.btn-principal {
    background: #0d2b45;
    color: #fff;
}

.btn-eliminar-foto {
    background: #fdf0f0;
    color: #8c2828;
    border: 1px solid #efcccc !important;
}

.etiqueta-principal {
    flex: 1 1 auto;
    text-align: center;
    padding: 6px 8px;
    border-radius: 5px;
    background: #c9a227;
    color: #0d2b45;
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 500px) {
    .lista-fotos-actuales {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .foto-actual img {
        height: 100px;
    }
}


/* =========================================================
   ACCIONES DE LA TABLA
   ========================================================= */

td.acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    vertical-align: middle;
}

td.acciones button {
    border: none;
    border-radius: 5px;
    padding: 7px 11px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-editar {
    background: #e8eef4;
    color: #0d2b45;
}

.btn-editar:hover {
    background: #0d2b45;
    color: #fff;
}

.btn-estado {
    background: #fbf6e6;
    color: #7a6112;
}

.btn-estado:hover {
    background: #c9a227;
    color: #0d2b45;
}

.btn-eliminar {
    background: #fdf0f0;
    color: #8c2828;
}

.btn-eliminar:hover {
    background: #b83a3a;
    color: #fff;
}
