/* ============================================================
   WEBMASTER PANEL – estilos/webmaster.css
   ============================================================ */

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

body {
    font-family: 'Montserrat', sans-serif;
    background: #f4f5f7;
    color: #333;
    min-height: 100vh;
}

/* ── TOP BAR ── */
.wm-topbar {
    background: #000;
    color: #fff;
    padding: 0 30px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .4);
}

.wm-topbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.wm-topbar-brand img {
    height: 40px;
    width: auto;
}

.wm-topbar-brand .wm-badge {
    background: #ff1616;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.wm-topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.wm-btn-outline {
    border: 1.5px solid rgba(255, 255, 255, .35);
    background: transparent;
    color: #fff;
    border-radius: 8px;
    padding: 7px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
}

.wm-btn-outline:hover {
    border-color: #ff1616;
    color: #ff1616;
}

.wm-btn-red {
    background: #ff1616;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
    font-family: 'Montserrat', sans-serif;
}

.wm-btn-red:hover {
    background: #cc0000;
    transform: translateY(-1px);
}

/* ── MAIN WRAPPER ── */
.wm-main {
    max-width: 1300px;
    margin: 0 auto;
    padding: 36px 24px 60px;
}

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

.wm-page-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: #000;
}

.wm-page-title span {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    color: #888;
    font-weight: 400;
    display: block;
    margin-top: 2px;
}

/* ── STAT CARDS ── */
.wm-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}

.wm-stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform .2s;
}

.wm-stat-card:hover {
    transform: translateY(-3px);
}

.wm-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.wm-stat-icon.red {
    background: #fff0f0;
    color: #ff1616;
}

.wm-stat-icon.green {
    background: #f0fff4;
    color: #28a745;
}

.wm-stat-icon.blue {
    background: #f0f5ff;
    color: #3b82f6;
}

.wm-stat-icon.gold {
    background: #fffbf0;
    color: #f59e0b;
}

.wm-stat-body h3 {
    font-size: 1.7rem;
    font-weight: 700;
    color: #000;
    line-height: 1;
}

.wm-stat-body p {
    font-size: 0.78rem;
    color: #888;
    margin-top: 3px;
}

/* ── TABLE CARD ── */
.wm-table-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .07);
    overflow: hidden;
}

.wm-table-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.wm-table-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #000;
}

.wm-search {
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    padding: 8px 14px 8px 36px;
    font-size: 0.88rem;
    font-family: 'Montserrat', sans-serif;
    width: 240px;
    background: #f8f8f8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 12px center;
    transition: .2s;
}

.wm-search:focus {
    outline: none;
    border-color: #ff1616;
    background-color: #fff;
}

.wm-table-wrapper {
    overflow-x: auto;
}

table.wm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.wm-table thead th {
    background: #fafafa;
    padding: 13px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #666;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.wm-table tbody tr {
    border-bottom: 1px solid #f5f5f5;
    transition: background .15s;
}

.wm-table tbody tr:last-child {
    border-bottom: none;
}

.wm-table tbody tr:hover {
    background: #fafafa;
}

.wm-table td {
    padding: 14px 16px;
    vertical-align: middle;
    color: #333;
}

.wm-table td .prop-ref {
    font-size: 0.75rem;
    color: #999;
    font-weight: 600;
}

.wm-table td .prop-title {
    font-weight: 600;
    color: #000;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wm-table td .prop-thumb {
    width: 52px;
    height: 38px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 10px;
    vertical-align: middle;
}

/* Status badges */
.wm-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: .3px;
    white-space: nowrap;
}

.wm-status.disponible {
    background: #f0fff4;
    color: #28a745;
}

.wm-status.vendido {
    background: #f8d7da;
    color: #721c24;
}

.wm-status.reservado {
    background: #fff3cd;
    color: #856404;
}

.wm-status.novedad {
    background: #e8f4fd;
    color: #1a78c2;
}

.wm-status.exclusivo {
    background: #f3e8ff;
    color: #7c3aed;
}

.wm-status.oportunidad {
    background: #fff0e5;
    color: #c2501a;
}

.wm-status.borrador {
    background: #fff3cd;
    color: #856404;
    letter-spacing: .3px;
}

/* Action buttons */
.wm-action-btn {
    border: none;
    border-radius: 7px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: .15s;
    font-family: 'Montserrat', sans-serif;
    margin-right: 5px;
}

.wm-action-btn.edit {
    background: #f0f4ff;
    color: #3b82f6;
}

.wm-action-btn.edit:hover {
    background: #3b82f6;
    color: #fff;
}

.wm-action-btn.delete {
    background: #fff0f0;
    color: #ff1616;
}

.wm-action-btn.delete:hover {
    background: #ff1616;
    color: #fff;
}

.wm-action-btn.view {
    background: #f0f0f0;
    color: #333;
}

.wm-action-btn.view:hover {
    background: #333;
    color: #fff;
}

/* Empty state */
.wm-empty {
    text-align: center;
    padding: 50px 20px;
    color: #aaa;
}

.wm-empty i {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
}

/* ── MODAL ── */
.wm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}

.wm-modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.wm-modal {
    background: #fff;
    border-radius: 20px;
    padding: 36px 40px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform .25s;
    box-shadow: 0 30px 60px rgba(0, 0, 0, .25);
}

.wm-modal-overlay.open .wm-modal {
    transform: translateY(0);
}

.wm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.wm-modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #000;
}

.wm-modal-close {
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: .15s;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wm-modal-close:hover {
    background: #ff1616;
    color: #fff;
}

/* Form inside modal */
.wm-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

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

.wm-form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.82rem;
    color: #555;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.wm-form-group input,
.wm-form-group select,
.wm-form-group textarea {
    width: 100%;
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: 'Montserrat', sans-serif;
    color: #333;
    transition: .2s;
    background: #fafafa;
}

.wm-form-group input:focus,
.wm-form-group select:focus,
.wm-form-group textarea:focus {
    outline: none;
    border-color: #ff1616;
    background: #fff;
}

.wm-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.wm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.wm-btn-cancel {
    background: #f0f0f0;
    color: #555;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: .15s;
    font-family: 'Montserrat', sans-serif;
}

.wm-btn-cancel:hover {
    background: #ddd;
}

/* ── TOAST ── */
.wm-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #000;
    color: #fff;
    border-radius: 10px;
    padding: 14px 22px;
    font-size: 0.88rem;
    font-weight: 600;
    z-index: 2000;
    transform: translateY(80px);
    opacity: 0;
    transition: .3s;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 340px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

.wm-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.wm-toast.success {
    border-left: 4px solid #28a745;
}

.wm-toast.error {
    border-left: 4px solid #ff1616;
}

/* ── ADMIN FLOATING BUTTONS (public pages) ── */
.admin-fab-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.admin-fab {
    background: #ff1616;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px 22px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 22, 22, .4);
    transition: .2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
}

.admin-fab:hover {
    background: #cc0000;
    transform: translateY(-2px);
    color: #fff;
}

.admin-fab.secondary {
    background: #000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
}

.admin-fab.secondary:hover {
    background: #333;
}

/* Per-card edit button */
.admin-card-edit {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(0, 0, 0, .75);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: .15s;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Montserrat', sans-serif;
    text-decoration: none;
    backdrop-filter: blur(4px);
}

.admin-card-edit:hover {
    background: #ff1616;
    color: #fff;
}

/* Edit button on casa.html detail page */
.admin-detail-edit {
    position: fixed;
    top: 90px;
    right: 24px;
    z-index: 200;
    background: #ff1616;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 20px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(255, 22, 22, .35);
    transition: .2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
}

.admin-detail-edit:hover {
    background: #cc0000;
    transform: translateY(-2px);
    color: #fff;
}

/* Responsive */
@media (max-width: 640px) {
    .wm-main {
        padding: 20px 14px 40px;
    }

    .wm-modal {
        padding: 24px 18px;
    }

    .wm-form-grid {
        grid-template-columns: 1fr;
    }

    .wm-topbar {
        padding: 10px 16px;
        height: auto;
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .wm-topbar-actions {
        gap: 8px;
        flex-wrap: wrap;
    }

    .wm-search {
        width: 150px;
    }
}

@media (max-width: 480px) {
    .wm-btn-outline,
    .wm-btn-red {
        padding: 7px 12px;
        font-size: 0.78rem;
    }

    .wm-search {
        width: 100%;
    }

    .wm-table-header {
        flex-direction: column;
        align-items: stretch;
    }
}

/* iOS: respetar la barra de gestos en los elementos flotantes */
.admin-fab-container {
    bottom: max(28px, env(safe-area-inset-bottom));
}

.wm-toast {
    bottom: max(30px, env(safe-area-inset-bottom));
}

/* UI v2 — Badges de estado de propiedad */
.badge-borrador    { background: #6c757d; color: #fff; }
.badge-novedad     { background: #0d6efd; color: #fff; }
.badge-vendido     { background: #198754; color: #fff; }
.badge-oportunidad { background: #fd7e14; color: #fff; }
.badge-exclusivo   { background: #6f42c1; color: #fff; }
[class^="badge-"]  { border-radius: 4px; padding: 3px 8px; font-size: 0.75rem; font-weight: 600; display: inline-block; }

/* UI v2 — Tabla responsive en móvil */
@media (max-width: 768px) {
    .wm-table-wrapper {
        overflow-x: auto;
    }
}

/* UI v2 — Hover en filas de tabla */
.wm-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.03);
    transition: background-color 0.15s ease;
}