:root {
    --bg-dark: #FFFFFF;
    --bg-card: #F8F9FA;
    --bg-light: #FAFAFA;
    --bg-cream: #FAF8F3;
    --gold: #D4AF37;
    --gold-light: #E8C858;
    --gold-dark: #B8941F;
    --gold-glow: rgba(212, 175, 55, 0.3);
    --text-light: #1A1A1A;
    --text-muted: #6C757D;
    --text-secondary: #999999;
    --border-color: rgba(212, 175, 55, 0.3);
    --border-light: #E9ECEF;
    --white: #FFFFFF;
    --black: #000000;
    --danger: #DC3545;
    --success: #28A745;
    --warning: #FFC107;
    --info: #17A2B8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-light);
    color: var(--text-light);
    font-family: 'Inter', 'Montserrat', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============ NAVBAR ADMIN ============ */
.navbar {
    background: var(--white) !important;
    border-bottom: 2px solid var(--gold) !important;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.1);
    padding: 1rem 0;
}

.navbar-dark {
    background: var(--white) !important;
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold) !important;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-family: 'Playfair Display', serif;
}

.navbar-brand img {
    height: 45px;
    margin-right: 10px;
}

.nav-link {
    color: var(--text-light) !important;
    font-weight: 500;
    transition: color 0.3s;
    margin: 0 0.5rem;
    font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--gold) !important;
}

.navbar-toggler {
    border: 1px solid var(--gold);
    padding: 0.4rem 0.8rem;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(212, 175, 55, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ============ HERO SECTION ============ */
.hero-section {
    min-height: 85vh;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-section h1 {
    color: var(--text-light);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.hero-section p {
    color: var(--text-muted);
}

/* ============ GLASS FORM ============ */
.glass-form {
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.1);
}

/* ============ BOTÕES ============ */
.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--white);
    font-weight: 700;
    border: none;
    transition: all 0.3s ease;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-outline-light {
    border-color: var(--gold);
    color: var(--gold);
    background: transparent;
}

.btn-outline-light:hover {
    background: var(--gold);
    color: var(--white);
}

.btn-outline-danger {
    border-color: var(--danger);
    color: var(--danger);
    background: transparent;
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: var(--white);
}

.btn-outline-warning {
    border-color: var(--warning);
    color: var(--warning);
    background: transparent;
}

.btn-outline-warning:hover {
    background: var(--warning);
    color: var(--black);
}

.btn-outline-success {
    border-color: var(--success);
    color: var(--success);
    background: transparent;
}

.btn-outline-success:hover {
    background: var(--success);
    color: var(--white);
}

/* ============ CARDS DE IMÓVEIS ============ */
.property-card {
    background-color: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
}

.property-card img {
    height: 220px;
    object-fit: cover;
    width: 100%;
}

.property-card h5 {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.property-card .text-muted {
    color: var(--text-muted) !important;
}

.property-price {
    color: var(--gold);
    font-size: 1.25rem;
    font-weight: 700;
}

.badge-gold {
    background-color: var(--gold);
    color: var(--white);
    font-weight: 600;
    padding: 0.5rem 1rem;
}

/* ============ SEÇÕES ============ */
section {
    padding: 4rem 0;
}

section h2 {
    color: var(--text-light);
    font-weight: 700;
    margin-bottom: 2rem;
}

section h3 {
    color: var(--gold);
    font-weight: 600;
}

section p {
    color: var(--text-muted);
}

/* ============ FORMULÁRIOS ============ */
.form-control, .form-select {
    background-color: var(--white);
    border: 2px solid var(--border-light);
    color: var(--text-light);
    padding: 0.75rem;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.form-control:focus, .form-select:focus {
    background-color: var(--white);
    border-color: var(--gold);
    color: var(--text-light);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 1;
}

.form-label {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-check-input:checked {
    background-color: var(--gold);
    border-color: var(--gold);
}

/* ============ RODAPÉ ============ */
footer {
    background-color: var(--bg-light);
    border-top: 2px solid var(--gold);
    padding: 2rem 0;
}

footer p {
    color: var(--text-muted);
}

footer a {
    color: var(--gold);
    transition: color 0.3s;
}

footer a:hover {
    color: var(--gold-dark);
}

/* ============ TEXTOS ============ */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-light);
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

/* ============ CARDS ADMIN ============ */
.card-link {
    text-decoration: none;
    transition: all 0.3s;
    display: block;
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    height: 100%;
    padding: 1.5rem;
}

.card-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
}

.card-link h3 {
    color: var(--gold);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-link p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.card-link i {
    color: var(--gold);
}

/* ============ TABELAS ADMIN ============ */
.table-dark {
    --bs-table-bg: var(--white);
    --bs-table-color: var(--text-light);
    border-color: var(--border-light);
}

.table-dark th {
    color: var(--gold);
    font-weight: 700;
    border-bottom: 2px solid var(--gold);
    font-size: 0.85rem;
    white-space: nowrap;
    background: var(--bg-card);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-dark td {
    color: var(--text-light);
    border-color: var(--border-light);
    vertical-align: middle;
    font-size: 0.9rem;
    background: var(--white);
}

.table-hover tbody tr:hover {
    background-color: rgba(212, 175, 55, 0.05);
}

.table-responsive {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* ============ ALERTAS ============ */
.alert-danger {
    background-color: #FEE;
    border-color: var(--danger);
    color: #C33;
    border-radius: 8px;
}

.alert-success {
    background-color: #E8F5E9;
    border-color: var(--success);
    color: #2E7D32;
    border-radius: 8px;
}

.alert-warning {
    background-color: #FFF8E1;
    border-color: var(--warning);
    color: #F57F17;
    border-radius: 8px;
}

.alert-info {
    background-color: #E0F7FA;
    border-color: var(--info);
    color: #006064;
    border-radius: 8px;
}

/* ============ UTILITÁRIOS ============ */
.border-secondary {
    border-color: var(--border-light) !important;
}

.bg-dark {
    background-color: var(--bg-card) !important;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

/* ============ ANIMAÇÕES ============ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.property-card, .card-link, section .rounded {
    animation: fadeIn 0.5s ease;
}

/* ========================================
   RESPONSIVIDADE COMPLETA - MOBILE
   ======================================== */

/* Tablets e telas médias */
@media (max-width: 992px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-brand img {
        height: 40px;
    }
    
    section {
        padding: 3rem 0;
    }
}

/* Celulares grandes e tablets pequenos */
@media (max-width: 768px) {
    /* Garantir fundo branco em tudo */
    body {
        background-color: var(--bg-light);
    }
    
    .navbar {
        background: var(--white) !important;
    }
    
    .hero-section {
        min-height: auto;
        padding: 6rem 0 3rem;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .glass-form {
        padding: 1.2rem;
    }
    
    section {
        padding: 2rem 0;
    }
    
    section h2 {
        font-size: 1.6rem;
    }
    
    /* Cards Dashboard - 2 colunas no mobile */
    .card-link {
        padding: 1rem 0.5rem !important;
    }
    
    .card-link h3 {
        font-size: 1.3rem;
    }
    
    .card-link .fa-2x {
        font-size: 1.5rem !important;
    }
    
    /* Tabelas Admin - scroll horizontal */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        overflow-x: auto;
    }
    
    .table-responsive::-webkit-scrollbar {
        height: 6px;
    }
    
    /* Botões de ação em tabela */
    .table td .btn {
        margin: 2px;
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Formulários Admin */
    .form-label {
        font-size: 0.85rem;
    }
    
    .form-control, .form-select {
        font-size: 0.9rem;
        padding: 0.6rem;
    }
    
    /* Navbar mobile */
    .navbar .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar .btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .btn {
        font-size: 0.9rem;
    }
}

/* Celulares pequenos */
@media (max-width: 576px) {
    /* Container com menos padding */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* Hero */
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .glass-form {
        padding: 1rem;
    }
    
    /* Dashboard - 2 colunas */
    .col-lg-2.col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    /* Cards menores */
    .card-link {
        padding: 0.8rem 0.3rem !important;
    }
    
    .card-link h3 {
        font-size: 1.1rem;
    }
    
    .card-link p {
        font-size: 0.75rem;
    }
    
    .card-link .fa-2x {
        font-size: 1.2rem !important;
        margin-bottom: 5px !important;
    }
    
    /* Ações rápidas - botões em coluna */
    .d-flex.flex-wrap.gap-2 .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Formulário de cadastro - campos 100% */
    .row.g-3 > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Exceção: manter 2 colunas em contadores pequenos */
    .counter-group .col-md-3,
    .edicula-section .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    /* Botões de ação do formulário */
    .d-flex.gap-2 {
        flex-direction: column;
    }
    
    .d-flex.gap-2 .btn {
        width: 100%;
    }
    
    /* Tabela - esconder colunas menos importantes */
    .table-dark th:nth-child(1),
    .table-dark td:nth-child(1) {
        font-size: 0.75rem;
    }
    
    /* Imagens de preview menores */
    .preview-img {
        width: 80px !important;
        height: 60px !important;
    }
    
    /* Laudo - itens empilhados */
    .item-row {
        padding: 10px !important;
    }
    
    .item-row .row.g-3 > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Upload de foto - empilhar */
    .upload-options {
        flex-direction: column;
    }
    
    .upload-options .file-input-wrapper,
    .upload-options .btn {
        width: 100%;
    }
    
    /* WhatsApp flutuante menor */
    .position-fixed.bottom-0.end-0.m-4 {
        width: 50px !important;
        height: 50px !important;
        margin: 1rem !important;
    }
    
    .position-fixed.bottom-0.end-0.m-4 .fa-2x {
        font-size: 1.5rem !important;
    }
    
    /* Garantir que tudo seja branco/cinza claro no mobile */
    .bg-card, .bg-light, .bg-dark {
        background-color: var(--bg-card) !important;
    }
    
    /* Texto sempre escuro */
    .text-light, .text-muted, .text-secondary {
        color: var(--text-muted) !important;
    }
}

/* Celulares muito pequenos */
@media (max-width: 380px) {
    .hero-section h1 {
        font-size: 1.3rem;
    }
    
    .navbar-brand {
        font-size: 0.9rem;
    }
    
    .navbar-brand img {
        height: 35px;
    }
    
    .card-link h3 {
        font-size: 1rem;
    }
}

/* Telas grandes */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* ============ MODO DE IMPRESSÃO ============ */
@media print {
    .navbar, footer, .btn, .position-fixed {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .property-card, .card-link {
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}

/* ============ ESTILOS ESPECÍFICOS DO LAUDO ============ */
.section-title {
    color: var(--gold);
    border-bottom: 2px solid var(--gold);
    padding-bottom: 10px;
    margin: 30px 0 20px;
    font-weight: 700;
}

.item-row {
    background: var(--white);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid var(--gold);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.camera-btn {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--white);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.camera-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
    color: var(--white);
}

.upload-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.preview-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--gold);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-photo {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
}

.edicula-section {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--gold);
}

.counter-group {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.counter-group h6 {
    color: var(--gold);
    margin-bottom: 10px;
    font-weight: 700;
}

/* Página de login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: var(--white);
    border: 2px solid var(--gold);
    border-radius: 15px;
    padding: 2rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(212, 175, 55, 0.2);
}

.login-box h3 {
    color: var(--gold);
    text-align: center;
    margin-bottom: 2rem;
}

@media (max-width: 576px) {
    .login-box {
        padding: 1.5rem;
    }
    
    .login-box h3 {
        font-size: 1.5rem;
    }
}

/* ============ BADGES ============ */
.badge {
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
}

.badge.bg-success {
    background-color: var(--success) !important;
}

.badge.bg-danger {
    background-color: var(--danger) !important;
}

.badge.bg-warning {
    background-color: var(--warning) !important;
    color: var(--black) !important;
}

.badge.bg-info {
    background-color: var(--info) !important;
}

.badge.bg-secondary {
    background-color: var(--text-muted) !important;
}

/* ============ CARDS DE ESTATÍSTICAS ============ */
.stat-card {
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
}

.stat-card:hover {
    border-color: var(--gold);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.15);
}

.stat-card i {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 10px;
}

.stat-card h3 {
    color: var(--gold);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* ============ MODAL ============ */
.modal-content {
    background: var(--white);
    border: 2px solid var(--gold);
    border-radius: 12px;
}

.modal-header {
    border-bottom: 2px solid var(--gold);
    background: var(--bg-card);
}

.modal-title {
    color: var(--gold);
    font-weight: 700;
}

.modal-footer {
    border-top: 1px solid var(--border-light);
}

/* ============ PAGINAÇÃO ============ */
.pagination .page-link {
    color: var(--gold);
    border-color: var(--border-light);
}

.pagination .page-item.active .page-link {
    background-color: var(--gold);
    border-color: var(--gold);
    color: var(--white);
}

.pagination .page-link:hover {
    background-color: var(--bg-card);
    color: var(--gold);
}

/* ============ SEÇÕES ESPECIAIS ============ */
.page-header {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    padding: 40px 0;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.page-header h1 {
    color: var(--white);
    font-weight: 700;
    margin-bottom: 10px;
}

.page-header p {
    color: rgba(255,255,255,0.9);
    margin-bottom: 0;
}

.quick-actions {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    border: 2px solid var(--border-light);
}

.quick-actions h3 {
    color: var(--gold);
    font-family: 'Playfair Display', serif;
    margin-bottom: 25px;
    font-weight: 700;
}

.btn-action {
    background: var(--white);
    border: 2px solid var(--gold);
    color: var(--gold);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 5px;
}

.btn-action:hover {
    background: var(--gold);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.recent-activity {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    border: 2px solid var(--border-light);
    margin-top: 30px;
}

.recent-activity h3 {
    color: var(--gold);
    font-family: 'Playfair Display', serif;
    margin-bottom: 20px;
    font-weight: 700;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.module-card {
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: var(--text-light);
    transition: all 0.3s;
}

.module-card:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
}

.module-card i {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 10px;
}

.module-card h5 {
    font-weight: 700;
    margin-bottom: 5px;
}

.module-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* Ajustes mobile para módulos */
@media (max-width: 768px) {
    .module-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        padding: 30px 0;
    }
}