/* =========================================================
   AVALÚOS → PESTAÑA "PROPIEDADES CAPTADAS"
   ========================================================= */
.ad-modulo {
    --navy: #0b2440; --navy-2: #123a68; --gold: #cf9b3f; --gold-light: #e6bc72;
    --cream: #f8f6f1; --charcoal: #23262b; --grey: #6b7280; --borde: #e6e1d6; --rojo: #b8493c; --verde: #2c6e49;
    max-width: 1180px; margin: 0 auto; font-family: 'Montserrat', 'StonerExtraBold', sans-serif; color: var(--charcoal);
}
.ad-modulo *, .ad-modulo *::before, .ad-modulo *::after { box-sizing: border-box; }
.ad-modulo h1, .ad-modulo h2 { font-family: 'Playfair Display', serif; color: var(--navy); margin: 0; }
.ad-modulo [hidden] { display: none !important; }

/* Pestañas Avalúos / Propiedades */
.av-modulos { display: flex; gap: 8px; justify-content: center; margin: 0 auto 26px; max-width: 560px; background: #fff; border: 1px solid #e6e1d6; border-radius: 14px; padding: 6px; }
.av-modulos[hidden] { display: none; }
.av-modulos button { flex: 1; border: none; background: transparent; padding: 12px 10px; border-radius: 10px; font: inherit; font-weight: 700; font-size: .95rem; color: #4a5568; cursor: pointer; }
.av-modulos button.activo { background: #0b2440; color: #fff; }
.av-btn-crear-propiedad { width: 100%; margin-top: 8px; padding: 13px; background: #cf9b3f; color: #0b2440; border: none; border-radius: 8px; font-size: .9rem; font-weight: 800; cursor: pointer; }
@media print { .av-modulos, .av-btn-crear-propiedad { display: none !important; } }

/* ---------- Inicio de sesión (pantalla azul) ---------- */
/* ---------- Barra superior ---------- */
/* ---------- Botones ---------- */
.ad-btn { font: inherit; font-weight: 600; font-size: .85rem; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.ad-btn:disabled { opacity: .55; cursor: wait; }
.ad-btn-grande { padding: 12px 22px; font-size: .95rem; }
.ad-btn-azul { background: var(--navy); color: #fff; }
.ad-btn-azul:hover { background: var(--navy-2); }
.ad-btn-oro { background: var(--gold); color: var(--navy); }
.ad-btn-oro:hover { background: var(--gold-light); }
.ad-btn-linea { background: #fff; color: var(--navy); border-color: var(--navy); }
.ad-btn-rojo { background: var(--rojo); color: #fff; }
.ad-btn-rojo-linea { background: #fff; color: var(--rojo); border-color: var(--rojo); }
.ad-btn-chico { padding: 6px 10px; font-size: .78rem; }
/* ---------- Estructura ---------- */
.ad-main { max-width: 1240px; margin: 0 auto; padding: 26px 20px 120px; }
.ad-titulo-fila { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ad-titulo-fila h1 { font-size: 1.8rem; }
.ad-sub { color: var(--grey); margin: 4px 0 0; font-size: .9rem; }
.ad-volver { background: none; border: none; color: var(--navy); font: inherit; font-weight: 600; cursor: pointer; padding: 0; margin-bottom: 6px; }
/* ---------- Lista ---------- */
.ad-herramientas { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.ad-herramientas input { flex: 1; min-width: 220px; font: inherit; padding: 11px 14px; border: 1px solid #d8d2c4; border-radius: 8px; background: #fff; }
.ad-pestanas { display: flex; gap: 6px; flex-wrap: wrap; }
.ad-pestanas button { font: inherit; font-size: .82rem; padding: 8px 12px; border-radius: 18px; border: 1px solid #d8d2c4; background: #fff; cursor: pointer; }
.ad-pestanas button.activo { background: var(--navy); color: #fff; border-color: var(--navy); }
.ad-lista { display: flex; flex-direction: column; gap: 10px; }
.ad-item { display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: 10px; }
.ad-item-foto { width: 120px; height: 86px; border-radius: 8px; background: #e9e5dc center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--grey); font-size: .75rem; }
.ad-item h3 { margin: 0 0 4px; font-size: 1rem; }
.ad-item-meta { font-size: .8rem; color: var(--grey); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ad-item-acciones { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ad-estado { font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: .4px; }
.ad-estado-borrador { background: #eceff3; color: #4b5563; }
.ad-estado-publicada { background: #e7f4ea; color: var(--verde); }
.ad-estado-reservada { background: #fdf6ea; color: #8a5a20; }
.ad-estado-vendida { background: #fbeceb; color: #8a2f25; }
.ad-vacio { background: #fff; border: 1px dashed #d8d2c4; border-radius: 12px; padding: 36px; text-align: center; color: var(--grey); }
/* ---------- Formulario ---------- */
.ad-columnas { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
.ad-caja { background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: 18px 20px 20px; margin: 0 0 18px; min-width: 0; }
.ad-caja legend { font-weight: 700; color: var(--navy); padding: 0 6px; font-size: .95rem; }
.ad-caja-privada { border-color: #e8c9c4; background: #fffafa; }
.ad-fila { display: flex; gap: 12px; flex-wrap: wrap; }
.ad-fila > * { flex: 1; min-width: 150px; }
.ad-fila-4 > * { min-width: 110px; }
.ad-campo { display: flex; flex-direction: column; gap: 5px; font-size: .78rem; font-weight: 700; color: #4a5568; margin-bottom: 12px; }
.ad-campo input, .ad-campo select, .ad-campo textarea, .ad-caja > textarea, .ad-agregar input {
    font: inherit; font-weight: 400; font-size: .92rem; padding: 10px 12px; border: 1px solid #d8d2c4; border-radius: 8px; background: #fff; color: var(--charcoal); width: 100%;
}
.ad-campo input:focus, .ad-campo select:focus, textarea:focus, .ad-agregar input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(207,155,63,.15); }
.ad-caja > textarea { resize: vertical; line-height: 1.6; }
.ad-medio { max-width: 260px; }
.ad-check { display: flex; gap: 8px; align-items: center; font-size: .88rem; cursor: pointer; margin-top: 4px; }
.ad-nota { font-size: .78rem; color: var(--grey); margin: 4px 0 10px; }
.ad-nota-caja { background: var(--cream); border-radius: 8px; padding: 14px; font-size: .88rem; color: var(--grey); text-align: center; }
.ad-invalido { border-color: var(--rojo) !important; box-shadow: 0 0 0 3px rgba(184,73,60,.15) !important; }
.ad-opciones-precio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.ad-opciones-precio label { cursor: pointer; position: relative; }
.ad-opciones-precio input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.ad-opciones-precio span { display: block; border: 2px solid var(--borde); border-radius: 10px; padding: 10px; height: 100%; font-size: .85rem; }
.ad-opciones-precio small { display: block; color: var(--grey); font-size: .72rem; margin-top: 3px; }
.ad-opciones-precio input:checked + span { border-color: var(--navy); background: #eef3fb; }
.ad-opciones-precio input:focus-visible + span { outline: 2px solid var(--gold); }
.ad-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ad-chips label { cursor: pointer; position: relative; }
.ad-chips input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.ad-chips span { display: inline-block; font-size: .8rem; padding: 6px 11px; border-radius: 16px; border: 1px solid #d8d2c4; background: #fff; }
.ad-chips input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.ad-chips input:checked + span::before { content: "✓ "; }
.ad-agregar { align-items: center; }
.ad-agregar input { flex: 3; }
.ad-agregar button { flex: 0 0 auto; min-width: 0; }
/* Fotos */
.ad-subir { display: block; border: 2px dashed #c9c1b0; border-radius: 12px; padding: 20px; text-align: center; cursor: pointer; background: var(--cream); transition: background .2s, border-color .2s; }
.ad-subir:hover, .ad-subir.arrastrando { background: #f1ece1; border-color: var(--gold); }
.ad-subir input { display: none; }
.ad-subir small { color: var(--grey); }
.ad-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.ad-foto { position: relative; border-radius: 8px; overflow: hidden; background: #ddd; aspect-ratio: 4 / 3; }
.ad-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-foto-portada { position: absolute; left: 6px; top: 6px; background: var(--gold); color: var(--navy); font-size: .65rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.ad-foto-botones { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 4px; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.ad-foto-botones button { border: none; background: rgba(255,255,255,.92); border-radius: 5px; width: 28px; height: 26px; cursor: pointer; font-size: .85rem; }
.ad-foto-botones button.borrar { color: var(--rojo); font-weight: 700; }
.ad-foto.subiendo { display: flex; align-items: center; justify-content: center; font-size: .75rem; color: var(--grey); background: var(--cream); border: 1px dashed #c9c1b0; }
.ad-mapa { height: 260px; border-radius: 10px; overflow: hidden; margin-bottom: 10px; background: #eee; }
/* Coordenadas: pegar desde Google Maps, mensajes y aviso fuera de Ecuador */
.ad-coords-msg { font-size: .8rem; margin: -6px 0 8px; color: var(--grey); overflow-wrap: anywhere; }
.ad-coords-msg:empty { display: none; }
.ad-coords-msg.ok { color: var(--verde); font-weight: 600; }
.ad-coords-msg.error { color: var(--rojo); font-weight: 600; }
.ad-aviso-coords { background: #fdf6ea; border: 1px solid #ecd9b0; color: #6b4a17; border-radius: 8px; padding: 10px 12px; font-size: .82rem; line-height: 1.45; margin: -2px 0 12px; overflow-wrap: anywhere; }
.ad-aviso-coords .ad-btn { display: flex; width: fit-content; max-width: 100%; margin-top: 8px; white-space: normal; text-align: left; }
/* Barra para guardar */
.ad-guardar-barra { position: sticky; bottom: 0; z-index: 90; margin: 0 -4px; border-radius: 12px 12px 0 0; background: #fff; border-top: 1px solid var(--borde); box-shadow: 0 -6px 20px rgba(0,0,0,.06); padding: 12px 24px; display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.ad-estado-guardado { margin-right: auto; font-size: .85rem; color: var(--grey); }
.ad-estado-guardado.ok { color: var(--verde); font-weight: 600; }
.ad-estado-guardado.pendiente { color: #8a5a20; font-weight: 600; }

@media (max-width: 900px) {
    .ad-columnas { grid-template-columns: 1fr; }
    .ad-item { grid-template-columns: 90px 1fr; }
    .ad-item-foto { width: 90px; height: 70px; }
    .ad-item-acciones { grid-column: 1 / -1; justify-content: stretch; }
    .ad-item-acciones .ad-btn { flex: 1; }
    .ad-opciones-precio { grid-template-columns: 1fr; }
    
    .ad-guardar-barra { padding: 10px 12px; }
    .ad-estado-guardado { font-size: .75rem; }
}
