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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 24px;
    color: var(--primary-color);
    font-weight: 700;
}

.nav-menu {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-menu a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.btn-cadastro {
    background: var(--primary-color);
    color: white !important;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.3s;
}

.btn-cadastro:hover {
    background: var(--primary-dark);
}

.btn-logout {
    color: var(--danger-color) !important;
}

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero h2 {
    font-size: 48px;
    margin-bottom: 16px;
    font-weight: 700;
}

.hero p {
    font-size: 20px;
    margin-bottom: 40px;
    opacity: 0.9;
}

.search-box {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 1000px;
    margin: 0 auto;
}

.search-box input,
.search-box select {
    flex: 1;
    min-width: 150px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.search-box button {
    padding: 12px 32px;
}

.properties-section {
    padding: 60px 0;
}

.properties-section h3 {
    font-size: 32px;
    margin-bottom: 32px;
    color: var(--text-dark);
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.property-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.property-card.featured {
    border: 2px solid var(--warning-color);
}

.featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--warning-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

.property-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-light);
}

.property-info {
    padding: 20px;
}

.property-type {
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.property-info h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.property-location {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 12px;
}

.property-features {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-light);
}

.property-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.property-actions {
    display: flex;
    gap: 8px;
}

.btn-primary,
.btn-secondary,
.btn-edit,
.btn-view,
.btn-delete {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-secondary:hover {
    background: var(--text-dark);
}

.btn-edit {
    background: var(--secondary-color);
    color: white;
    flex: 1;
}

.btn-edit:hover {
    background: #059669;
}

.btn-view {
    background: var(--primary-color);
    color: white;
    flex: 1;
}

.btn-view:hover {
    background: var(--primary-dark);
}

.btn-delete {
    background: var(--danger-color);
    color: white;
    flex: 1;
}

.btn-delete:hover {
    background: #dc2626;
}

.btn-block {
    width: 100%;
}

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-back {
    background: var(--bg-light);
    color: var(--text-dark);
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 14px;
}

.btn-back:hover {
    background: var(--border-color);
}

.auth-section {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 450px;
    width: 100%;
}

.auth-box h2 {
    margin-bottom: 24px;
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

.error-message {
    background: #fee;
    color: var(--danger-color);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.success-message {
    background: #efe;
    color: var(--secondary-color);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.footer {
    background: var(--text-dark);
    color: white;
    text-align: center;
    padding: 24px 0;
    margin-top: 60px;
}

.dashboard-section {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

.dashboard-section h2 {
    font-size: 32px;
    margin-bottom: 32px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card h3 {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-card p {
    color: var(--text-light);
    font-size: 14px;
}

.dashboard-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.property-status,
.contact-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-disponivel {
    background: #d1fae5;
    color: #065f46;
}

.status-vendido,
.status-alugado {
    background: #fee;
    color: #991b1b;
}

.status-novo {
    background: #dbeafe;
    color: #1e40af;
}

.status-em_contato {
    background: #fef3c7;
    color: #92400e;
}

.status-concluido {
    background: #d1fae5;
    color: #065f46;
}

.contacts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.contact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.contact-header h4 {
    font-size: 18px;
    color: var(--text-dark);
}

.contact-property {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 8px;
}

.contact-info {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 12px;
}

.contact-message {
    color: var(--text-dark);
    padding: 12px;
    background: var(--bg-light);
    border-radius: 6px;
    margin-bottom: 12px;
}

.contact-date {
    color: var(--text-light);
    font-size: 12px;
    margin-bottom: 12px;
}

.status-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.form-section {
    padding: 40px 0;
}

.form-section h2 {
    font-size: 32px;
    margin-bottom: 32px;
}

.property-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-card {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.form-card h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-dark);
}

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

.form-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    margin-top: 24px;
}

.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.image-preview-item {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-item label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.image-preview-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.property-details-section {
    padding: 40px 0;
}

.property-gallery {
    margin-bottom: 32px;
}

.gallery-main {
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
}

.gallery-main img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    cursor: pointer;
}

.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.gallery-thumbs img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
}

.gallery-thumbs img:hover {
    transform: scale(1.05);
}

.more-images {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 8px;
    color: var(--text-dark);
    font-weight: 600;
}

.no-image-large {
    width: 100%;
    height: 400px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    border-radius: 12px;
}

.property-content {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.property-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 24px;
    flex-wrap: wrap;
}

.property-header h1 {
    font-size: 32px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.property-price-large {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.property-badges {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    background: var(--bg-light);
    color: var(--text-dark);
}

.property-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--bg-light);
    border-radius: 12px;
}

.feature-item {
    display: flex;
    gap: 12px;
    align-items: center;
}

.feature-icon {
    font-size: 32px;
}

.feature-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.feature-label {
    font-size: 14px;
    color: var(--text-light);
}

.property-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.property-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.property-section h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.property-description {
    color: var(--text-dark);
    line-height: 1.8;
    white-space: pre-wrap;
}

.property-map {
    border-radius: 12px;
    overflow: hidden;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 32px;
    border-radius: 12px;
    max-width: 600px;
    position: relative;
    animation: modalSlideIn 0.3s;
}

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

.close {
    color: var(--text-light);
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

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

.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
}

.image-modal .close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 48px;
    z-index: 1001;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: none;
    padding: 16px 20px;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.3s;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.5);
}

.modal-nav.prev {
    left: 20px;
}

.modal-nav.next {
    right: 20px;
}

@media (max-width: 768px) {
    .hero h2 {
        font-size: 32px;
    }

    .hero p {
        font-size: 16px;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box input,
    .search-box select {
        width: 100%;
        min-width: auto;
    }

    .nav-menu {
        flex-wrap: wrap;
        gap: 12px;
    }

    .properties-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .property-header {
        flex-direction: column;
    }

    .property-price-large {
        font-size: 28px;
    }

    .gallery-main img {
        height: 300px;
    }

    .gallery-thumbs {
        grid-template-columns: repeat(3, 1fr);
    }

    .modal-content {
        margin: 10% 20px;
        padding: 24px;
    }

    .form-card {
        padding: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .property-features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
}
