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

:root {
    --color-primary: #233ED9;
    --color-primary-dark: #263DBF;
    --color-primary-light: #5F72D9;
    --color-light: #F2F2F2;
    --color-dark: #0D0D0D;
    --color-white: #FFFFFF;
    --color-bg-warm: #FAFAF8;
    --color-gray: #65768C;
    --color-admin-bg: #0E1420;
    --color-admin-bg-soft: #1A2538;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--color-dark-text);
    background: linear-gradient(160deg, var(--color-admin-bg) 0%, var(--color-admin-bg-soft) 100%);
    line-height: 1.6;
}

/* ==================== ESTILOS GENERALES ==================== */

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    color: var(--color-white);
    box-shadow: 0 4px 15px rgba(34, 61, 216, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 61, 216, 0.4);
}

.btn-secondary {
    background-color: var(--color-gray);
    color: var(--color-white);
}

.btn-secondary:hover {
    background-color: #525e73;
}

.btn-danger {
    background-color: #dc3545;
    color: var(--color-white);
}

.btn-danger:hover {
    background-color: #c82333;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.8rem;
    border: 2px solid var(--color-light);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-orange);
    box-shadow: 0 0 0 3px rgba(191, 91, 4, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.error-message {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.success-message {
    color: #28a745;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

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

#loginModal {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(145deg, #0A0F18 0%, #131D2C 55%, #1E2A3F 100%);
}

.login-form {
    width: 100%;
    max-width: 400px;
    padding: 3rem 2rem;
    background: var(--color-white);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-form h1 {
    text-align: center;
    color: var(--color-primary);
    margin-bottom: 2rem;
    font-size: 2rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form .btn {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.9rem;
}

.login-form .form-group input {
    padding: 1rem;
    font-size: 1.1rem;
}

/* ==================== MODAL ==================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-white);
    border-radius: 15px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.property-form {
    width: 90%;
    max-width: 700px;
    padding: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--color-light);
    padding-bottom: 1rem;
}

.modal-header h2 {
    color: var(--color-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--color-gray);
}

.close-btn:hover {
    color: var(--color-dark-blue);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

.form-actions .btn {
    flex: 1;
}

/* ==================== PANEL ADMIN ==================== */

.admin-panel {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(160deg, var(--color-admin-bg) 0%, var(--color-admin-bg-soft) 100%);
}

.admin-header {
    background: linear-gradient(145deg, #0A0F18 0%, #121B2A 100%);
    color: var(--color-white);
    padding: 1.5rem 2rem;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-content h1 {
    font-size: 1.8rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.user-email {
    font-size: 0.95rem;
    opacity: 0.9;
}

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

.admin-container {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    gap: 2rem;
    padding: 2rem;
}

/* ==================== SIDEBAR ==================== */

.sidebar {
    width: 250px;
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    height: fit-content;
    sticky: top;
    top: 2rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    padding: 1.2rem 1.5rem;
    border-left: 4px solid transparent;
    text-decoration: none;
    color: var(--color-primary);
    transition: all 0.3s ease;
    font-weight: 500;
    cursor: pointer;
    display: block;
}

.nav-item:hover {
    background-color: var(--color-light);
    border-left-color: var(--color-primary);
}

.nav-item.active {
    background-color: rgba(34, 61, 216, 0.1);
    border-left-color: var(--color-primary);
    color: var(--color-primary);
}

/* ==================== MAIN CONTENT ==================== */

.main-content {
    flex: 1;
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 2rem;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--color-light);
    padding-bottom: 1.5rem;
}

.section-header h2 {
    color: var(--color-primary);
    font-size: 1.8rem;
}

/* ==================== TABLA DE PROPIEDADES ==================== */

.properties-table {
    display: grid;
    gap: 1.5rem;
}

.property-item {
    background: var(--color-light);
    border-radius: 10px;
    padding: 1.5rem;
    border-left: 4px solid var(--color-primary);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: start;
}

.property-info {
    display: grid;
    gap: 0.8rem;
}

.property-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
}

.property-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--color-gray);
}

.property-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.property-description {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-top: 0.5rem;
}

.property-status {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.property-status.available {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.property-status.unavailable {
    background-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.property-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.property-actions .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

/* ==================== LISTA DE MENSAJES ==================== */

.messages-list {
    display: grid;
    gap: 1.5rem;
}

.message-item {
    background: var(--color-light);
    border-radius: 10px;
    padding: 1.5rem;
    border-left: 4px solid var(--color-gray);
}

.message-item.unread {
    border-left-color: var(--color-primary);
    background-color: rgba(34, 61, 216, 0.05);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 1rem;
}

.message-from {
    font-weight: 700;
    color: var(--color-primary);
}

.message-subject {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0.3rem;
    color: var(--color-primary);
}

.message-date {
    font-size: 0.85rem;
    color: var(--color-gray);
}

.message-body {
    color: #555;
    line-height: 1.6;
    margin: 1rem 0;
}

.message-contact {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
}

.message-contact strong {
    color: var(--color-primary);
}

/* ==================== CONFIGURACIÓN ==================== */

.config-content {
    max-width: 500px;
}

.config-content p {
    margin-bottom: 2rem;
    color: #555;
}

.config-content .form-group {
    margin-bottom: 1.5rem;
}

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

@media (max-width: 1024px) {
    .admin-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        display: flex;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .nav-item {
        flex: 1;
        text-align: center;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .property-item {
        grid-template-columns: 1fr;
    }

    .property-actions {
        flex-direction: row;
    }
}

@media (max-width: 768px) {
    .admin-header {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .header-content h1 {
        font-size: 1.4rem;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .main-content {
        padding: 1rem;
    }

    .property-form {
        width: 95%;
        padding: 1.5rem;
    }

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

    .property-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}
