/* ========================================================================= */
/* PROPIGESTION.CL - ESTILOS PROFESIONALES Y MODERNOS */
/* ========================================================================= */

:root {
    --primary: #3d4ded;
    --primary-dark: #2f3cc9;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #f9fafb;
    --card: #ffffff;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
img { max-width: 100%; height: auto; display: block; }

/* ========================================================================= */
/* HEADER PROFESIONAL */
/* ========================================================================= */
header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.85rem 1.5rem;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.brand-text span {
    color: var(--primary);
}

nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-light);
    padding: 0.5rem 0;
    position: relative;
}

nav a:hover, nav a.active {
    color: var(--primary);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

nav a:hover::after, nav a.active::after {
    width: 100%;
}

/* ========================================================================= */
/* CONTENIDO PRINCIPAL */
/* ========================================================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.dashboard-header {
    background: var(--card);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-stats {
    text-align: right;
    color: var(--text-light);
    font-size: 0.95rem;
}

.dashboard-stats strong {
    color: var(--primary);
}

/* ========================================================================= */
/* FILTROS Y FORMULARIOS */
/* ========================================================================= */
.filters-bar {
    background: var(--card);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.filters-bar input, .filters-bar select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--bg);
    transition: border-color 0.2s;
}

.filters-bar input:focus, .filters-bar select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card);
}

.filters-bar input { flex: 2; min-width: 200px; }
.filters-bar select { flex: 1; min-width: 150px; }

/* ========================================================================= */
/* BOTONES */
/* ========================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ========================================================================= */
/* TARJETAS DE PROPIEDAD */
/* ========================================================================= */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.property-card {
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.property-image {
    height: 180px;
    background: linear-gradient(135deg, #e0e7ff 0%, #f3f4f6 100%);
    position: relative;
    overflow: hidden;
}

.property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-venta { background: #10b981; }
.badge-arriendo { background: #3b82f6; }
.badge-temporal { background: #f59e0b; color: #1f2937; }

.card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.property-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.property-location {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.property-price {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.property-features {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-light);
}

.property-features span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
    color: var(--text);
}

.property-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ========================================================================= */
/* ALERTAS Y ESTADO VACÍO */
/* ========================================================================= */
.alert-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #f59e0b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #22c55e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--card);
    border-radius: 12px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    display: block;
}

/* ========================================================================= */
/* MODO OSCURO */
/* ========================================================================= */
body.dark-mode {
    --primary: #5a67f0;
    --primary-dark: #4c51bf;
    --text: #f7fafc;
    --text-light: #a0aec0;
    --bg: #1a202c;
    --card: #2d3748;
    --border: #4a5568;
}

body.dark-mode header {
    background: var(--card);
    border-bottom-color: var(--border);
}

body.dark-mode .property-card,
body.dark-mode .dashboard-header,
body.dark-mode .filters-bar,
body.dark-mode .form-container {
    background: var(--card);
    border-color: var(--border);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
    background: var(--card);
    border-color: var(--primary);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    color: var(--text-light);
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--bg);
    color: var(--primary);
}

/* ========================================================================= */
/* ESTADÍSTICAS */
/* ========================================================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: var(--card);
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .subtext {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* ========================================================================= */
/* RESPONSIVE */
/* ========================================================================= */
@media (max-width: 768px) {
    header { padding: 0.75rem 1rem; }
    .brand-text { display: none; }
    .container { padding: 1rem; }
    .dashboard-header { flex-direction: column; align-items: flex-start; }
    .dashboard-stats { text-align: left; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .filters-bar input, .filters-bar select, .filters-bar button { width: 100%; }
    .properties-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .property-actions { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .property-image { height: 200px; }
    .property-price { font-size: 1.25rem; }
    .btn { padding: 0.625rem 1rem; font-size: 0.875rem; }
}

/* ... (Mantén todo el CSS anterior intacto) ... */

/* Ajustes para el Header con Bienvenida */
.user-greeting {
    font-size: 0.9rem;
    color: var(--text-light);
    display: none; /* Oculto en móviles */
}
.user-greeting strong {
    color: var(--text);
}

@media (min-width: 768px) {
    .user-greeting {
        display: block; /* Visible en escritorio */
    }
}

/* ========================================================================= */
/* ESTILOS LOGIN MODERNO (Estilo Banca) */
/* ========================================================================= */

.login-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Panel Izquierdo (Formulario) */
.login-left {
    flex: 1;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    position: relative;
}

.login-form-container {
    width: 100%;
    max-width: 420px;
}

.login-header {
    margin-bottom: 2.5rem;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Inputs estilo moderno */
.modern-input-group {
    margin-bottom: 1.5rem;
}

.modern-input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.modern-input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    background: var(--bg); /* Fondo gris suave */
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
    font-family: inherit;
}

.modern-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: var(--focus-ring);
}

/* Botón Full Width */
.btn-full {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    margin-top: 1rem;
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

/* Panel Derecho (Imagen) */
.login-right {
    flex: 1.2; /* Un poco más ancho que el form */
    background-image: url('https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end; /* Card abajo */
    padding: 3rem;
}

/* Overlay oscuro suave sobre la imagen */
.login-right::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.1) 100%);
}

/* Tarjeta flotante */
.feature-card {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px); /* Efecto vidrio */
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
    color: white;
    max-width: 400px;
    margin-bottom: 2rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.feature-card p {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* Responsive Mobile */
@media (max-width: 900px) {
    .login-right { display: none; } /* Ocultar imagen en móvil */
    .login-left { padding: 1.5rem; }
}

/* Galería Completa */
.gallery-container { margin-bottom: 1.5rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; }
.gallery-item { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 4/3; background: var(--bg); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); opacity: 0; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 10px; }
.gallery-item:hover .gallery-overlay { opacity: 1; }
.btn-icon { background: white; border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text); }
.btn-icon.primary-toggle { color: #f59e0b; }
.btn-icon.primary-toggle:hover { background: #fef3c7; }
.btn-icon.delete-toggle { color: #ef4444; }
.btn-icon.delete-toggle:hover { background: #fee2e2; }
.primary-badge { position: absolute; top: 8px; left: 8px; background: #10b981; color: white; font-size: 0.7rem; padding: 4px 8px; border-radius: 20px; font-weight: 600; }
.empty-gallery { text-align: center; padding: 2rem; color: var(--text-light); background: var(--bg); border-radius: 10px; border: 2px dashed var(--border); }

/* Área de Subida */
.upload-area { margin-top: 1rem; }
.upload-label { display: flex; flex-direction: column; align-items: center; padding: 1.5rem; border: 2px dashed var(--border); border-radius: 10px; cursor: pointer; transition: 0.2s; color: var(--text-light); }
.upload-label:hover { border-color: var(--primary); background: rgba(61,77,237,0.05); color: var(--primary); }
.upload-label i { font-size: 2rem; margin-bottom: 0.5rem; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.5rem; margin-top: 1rem; }
.preview-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-item span { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.6); color: white; font-size: 0.7rem; padding: 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Checkboxes Grid */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; }
.checkbox-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; background: var(--bg); border-radius: 8px; cursor: pointer; transition: 0.2s; }
.checkbox-item:hover { background: #eef2ff; }
.checkbox-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

/* ========================================================================= */
/* FORMULARIOS DE PROPIEDADES */
/* ========================================================================= */

.form-container {
    max-width: 900px;
    margin: 2rem auto;
    background: var(--card);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.form-container h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(61, 77, 237, 0.1);
}

.form-group .help-text {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.375rem;
}

/* Selector de Estado */
.estado-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.estado-option {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card);
}

.estado-option:hover {
    border-color: var(--primary);
    background: rgba(61, 77, 237, 0.05);
}

.estado-option.active {
    border-color: var(--primary);
    background: rgba(61, 77, 237, 0.1);
}

.estado-option input {
    display: none;
}

.estado-option label {
    cursor: pointer;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.estado-option small {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 400;
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-item:hover {
    background: rgba(61, 77, 237, 0.1);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-item span {
    font-weight: 500;
}

/* Acciones del Formulario */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* Responsive Formularios */
@media (max-width: 768px) {
    .form-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .estado-selector {
        flex-direction: column;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* ========================================================================= */
/* FORMULARIOS DE PROPIEDADES - ESTILO DASHBOARD */
/* ========================================================================= */

.form-container {
    max-width: 900px;
    margin: 2rem auto;
    background: var(--card);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.form-container h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(61, 77, 237, 0.1);
}

.form-group .help-text {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.375rem;
}

/* Selector de Estado - Estilo Dashboard */
.estado-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.estado-option {
    padding: 1.25rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card);
}

.estado-option:hover {
    border-color: var(--primary);
    background: rgba(61, 77, 237, 0.05);
}

.estado-option.active {
    border-color: var(--primary);
    background: rgba(61, 77, 237, 0.1);
}

.estado-option input {
    display: none;
}

.estado-option label {
    cursor: pointer;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--text);
}

.estado-option small {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 400;
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-item:hover {
    background: rgba(61, 77, 237, 0.1);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-item span {
    font-weight: 500;
}

/* Acciones del Formulario */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* Galería de Imágenes */
.gallery-container {
    margin-bottom: 1.5rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--bg);
    border: 2px solid transparent;
    transition: all 0.2s;
}

.gallery-item.primary {
    border-color: var(--primary);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.btn-icon {
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: all 0.2s;
}

.btn-icon.primary-toggle {
    color: #f59e0b;
}

.btn-icon.primary-toggle:hover {
    background: #fef3c7;
}

.btn-icon.delete-toggle {
    color: #ef4444;
}

.btn-icon.delete-toggle:hover {
    background: #fee2e2;
}

.primary-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.empty-gallery {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    background: var(--bg);
    border-radius: 10px;
    border: 2px dashed var(--border);
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg);
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(61, 77, 237, 0.05);
}

.upload-area i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    display: block;
}

.upload-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-label small {
    color: var(--text-light);
    font-size: 0.85rem;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive Formularios */
@media (max-width: 768px) {
    .form-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .estado-selector {
        grid-template-columns: 1fr;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* ========================================================================= */
/* CORRECCIÓN HEADER: NOMBRE DE USUARIO NEGRO */
/* ========================================================================= */
.header-user-info {
    font-size: 0.9rem;
    color: var(--text-light); /* "Bienvenido" en gris */
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Fuerza el nombre a ser negro/negrita */
.header-user-info strong, 
.header-user-info .user-name {
    color: var(--text); 
    font-weight: 700;
}

/* ========================================================================= */
/* PÁGINA PÚBLICA - ESTILOS */
/* ========================================================================= */

/* Header público */
.header-public {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Hero section */
.hero-public {
    background: linear-gradient(135deg, var(--primary) 0%, #4352df 100%);
    color: white;
    padding: 4rem 1.5rem 3rem;
    text-align: center;
}

.hero-public h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.search-bar-hero {
    display: flex;
    gap: 0.75rem;
    max-width: 700px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.search-bar-hero input,
.search-bar-hero select {
    flex: 1;
    min-width: 150px;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
}

.search-bar-hero .btn {
    padding: 0.875rem 1.5rem;
}

/* Filtros card */
.filters-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.filters-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
}

/* Property card link */
.property-card-link {
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
}

.property-card-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Footer público */
.footer-public {
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem;
    margin-top: 3rem;
}

.footer-public a:hover {
    color: var(--primary) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-public h1 {
        font-size: 1.5rem;
    }
    
    .search-bar-hero {
        flex-direction: column;
    }
    
    .filters-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .filters-row .filter-group:last-child,
    .filters-row .filter-group:nth-last-child(2) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .filters-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================================================= */
/* PRE-FOOTER SEO */
/* ========================================================================= */

.seo-section {
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.seo-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    color: var(--text);
}

.seo-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
}

.seo-section ul li a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
    display: inline-block;
}

.seo-section ul li a:hover {
    color: var(--primary);
    padding-left: 4px;
}

/* ========================================================================= */
/* FOOTER PÚBLICO MEJORADO */
/* ========================================================================= */

.footer-public {
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 0;
    margin-top: 3rem;
}

.footer-public h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text);
    font-weight: 600;
}

.footer-public a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.9rem;
}

.footer-public a:hover {
    color: var(--primary);
}

.footer-public .brand {
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-public .brand img {
    height: 32px;
    width: auto;
}

.footer-public .social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.footer-public .social-links a {
    color: var(--text-light);
    font-size: 1.2rem;
    transition: color 0.2s, transform 0.2s;
    display: inline-flex;
}

.footer-public .social-links a:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-bottom p {
    color: var(--text-light);
    font-size: 0.85rem;
    margin: 0;
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
}

.footer-bottom-links a {
    color: var(--text-light);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-bottom-links a:hover {
    color: var(--primary);
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-public .container > div:first-child {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-bottom-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .footer-public .container > div:first-child {
        grid-template-columns: 1fr;
    }
    
    .seo-section .container > div {
        grid-template-columns: 1fr !important;
    }
}

/* Efecto Hover suave para los inputs del buscador */
.smart-search-bar div:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Ajuste para la tarjeta de filtros que se superpone */
.filters-card {
    margin-top: -3rem; /* Hace que suba y se monte sobre el hero */
    position: relative;
    z-index: 10;
}

/* Mobile: El buscador debe apilarse verticalmente */
@media (max-width: 768px) {
    .hero-public {
        padding: 3rem 1rem 5rem;
    }
    .hero-public h1 {
        font-size: 1.8rem;
    }
    .smart-search-bar {
        flex-direction: column;
        padding: 1rem;
    }
    .smart-search-bar button {
        width: 100%;
        padding: 1rem;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .hero-public {
        padding: 2rem 1rem 3rem !important;
    }
    .hero-public h1 {
        font-size: 1.6rem !important;
    }
    .smart-search-bar {
        padding: 0.5rem !important;
        flex-direction: column !important;
    }
    .smart-search-bar > div,
    .smart-search-bar button {
        width: 100% !important;
    }
}

/* ========================================================================= */
/* SECCIÓN DE SERVICIOS - PÚBLICO */
/* ========================================================================= */

.services-section {
    background: var(--bg);
    padding: 4rem 1.5rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.services-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.services-section > .container > p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.service-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.service-card.featured {
    border: 2px solid var(--primary);
    position: relative;
}

.service-card.featured::before {
    content: "Más Popular";
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.service-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.service-icon i {
    font-size: 1.5rem;
}

.service-icon.blue { background: rgba(61, 77, 237, 0.1); color: var(--primary); }
.service-icon.green { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.service-icon.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

.service-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.service-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.service-card .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
}

.services-trust {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .services-section {
        padding: 3rem 1rem;
    }
    .services-section h2 {
        font-size: 1.4rem;
    }
}

@media (max-width: 768px) {
    .hero-public { padding: 2rem 1rem 2.5rem !important; }
    .hero-public h1 { font-size: 1.5rem !important; }
    .smart-search-bar { flex-direction: column !important; padding: 0.5rem !important; }
    .smart-search-bar > div, .smart-search-bar button { width: 100% !important; }
}