/* =====================================================
   SISTEMA DE GESTÃO DE IMÓVEIS
   Visual: Clean, Verde Escuro e Branco
   ===================================================== */

:root {
    --verde-escuro: #1a4d2e;
    --verde-medio: #2d6a4f;
    --verde-claro: #40916c;
    --verde-hover: #143d24;
    --branco: #ffffff;
    --cinza-claro: #f8f9fa;
    --cinza-medio: #e9ecef;
    --cinza-texto: #6c757d;
    --cinza-escuro: #343a40;
    --vermelho: #dc3545;
    --amarelo: #ffc107;
    --azul: #0d6efd;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--cinza-claro);
    color: var(--cinza-escuro);
    line-height: 1.6;
}

/* LOGIN PAGE */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--verde-escuro) 0%, var(--verde-medio) 100%);
}

.login-box {
    background: var(--branco);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    color: var(--verde-escuro);
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.login-box .subtitle {
    color: var(--cinza-texto);
    text-align: center;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

/* LAYOUT */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: var(--verde-escuro);
    color: var(--branco);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar-header span {
    font-size: 0.8rem;
    opacity: 0.8;
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--branco);
    border-left-color: var(--branco);
}

.sidebar-menu a i {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 24px;
}

.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 20px;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 20px;
    min-height: 100vh;
}

/* HEADER */
.top-header {
    background: var(--branco);
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.page-title {
    color: var(--verde-escuro);
    font-size: 1.5rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: var(--cinza-texto);
}

/* CARDS */
.card {
    background: var(--branco);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--cinza-medio);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    color: var(--verde-escuro);
    font-size: 1.2rem;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* DASHBOARD CARDS */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.dash-card {
    background: var(--branco);
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 20px;
}

.dash-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.dash-card .icon.green {
    background: rgba(26, 77, 46, 0.1);
    color: var(--verde-escuro);
}

.dash-card .icon.orange {
    background: rgba(255, 193, 7, 0.15);
    color: #e6a800;
}

.dash-card .icon.red {
    background: rgba(220, 53, 69, 0.1);
    color: var(--vermelho);
}

.dash-card .icon.blue {
    background: rgba(13, 110, 253, 0.1);
    color: var(--azul);
}

.dash-card .info h3 {
    font-size: 1.8rem;
    color: var(--cinza-escuro);
    margin-bottom: 5px;
}

.dash-card .info p {
    color: var(--cinza-texto);
    font-size: 0.9rem;
}

/* ALERTAS DE VENCIMENTO */
.alert-box {
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.alert-box.warning {
    background: rgba(255, 193, 7, 0.15);
    border-left: 4px solid var(--amarelo);
}

.alert-box.danger {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--vermelho);
}

.alert-box i {
    font-size: 1.3rem;
}

.alert-box.warning i {
    color: #e6a800;
}

.alert-box.danger i {
    color: var(--vermelho);
}

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

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

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--cinza-medio);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--verde-medio);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

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

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: var(--verde-escuro);
    color: var(--branco);
}

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

.btn-secondary {
    background: var(--cinza-medio);
    color: var(--cinza-escuro);
}

.btn-secondary:hover {
    background: #dde0e3;
}

.btn-danger {
    background: var(--vermelho);
    color: var(--branco);
}

.btn-danger:hover {
    background: #bb2d3b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-group {
    display: flex;
    gap: 10px;
}

/* TABLES */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--cinza-medio);
}

table th {
    background: var(--cinza-claro);
    color: var(--verde-escuro);
    font-weight: 600;
    white-space: nowrap;
}

table tbody tr:hover {
    background: rgba(26, 77, 46, 0.03);
}

table td .actions {
    display: flex;
    gap: 8px;
}

/* BADGES */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(26, 77, 46, 0.1);
    color: var(--verde-escuro);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
}

.badge-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--vermelho);
}

.badge-secondary {
    background: var(--cinza-medio);
    color: var(--cinza-texto);
}

.badge-primary {
    background: rgba(13, 110, 253, 0.1);
    color: var(--azul);
}

.badge-info {
    background: rgba(13, 202, 240, 0.15);
    color: #0aa2c0;
}

/* ALERTS */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(26, 77, 46, 0.1);
    color: var(--verde-escuro);
    border: 1px solid rgba(26, 77, 46, 0.2);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--vermelho);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.15);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--branco);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--cinza-medio);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--verde-escuro);
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--cinza-texto);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--cinza-medio);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* FILE UPLOAD */
.file-upload {
    border: 2px dashed var(--cinza-medio);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
}

.file-upload:hover {
    border-color: var(--verde-medio);
}

.file-upload input {
    display: none;
}

.file-upload i {
    font-size: 2rem;
    color: var(--cinza-texto);
    margin-bottom: 10px;
}

.file-upload p {
    color: var(--cinza-texto);
}

.file-list {
    margin-top: 15px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: var(--cinza-claro);
    border-radius: 6px;
    margin-bottom: 8px;
}

/* SEARCH & FILTERS */
.filters-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--cinza-medio);
    border-radius: 8px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cinza-texto);
}

.filter-select {
    min-width: 150px;
}

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid var(--cinza-medio);
    border-radius: 6px;
    text-decoration: none;
    color: var(--cinza-escuro);
}

.pagination a:hover {
    background: var(--cinza-claro);
}

.pagination .active {
    background: var(--verde-escuro);
    color: var(--branco);
    border-color: var(--verde-escuro);
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 4rem;
    color: var(--cinza-medio);
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--cinza-texto);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--cinza-texto);
    margin-bottom: 20px;
}

/* DETAILS VIEW */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-item {
    padding: 15px;
    background: var(--cinza-claro);
    border-radius: 8px;
}

.detail-item label {
    display: block;
    font-size: 0.85rem;
    color: var(--cinza-texto);
    margin-bottom: 5px;
}

.detail-item span {
    font-size: 1rem;
    color: var(--cinza-escuro);
    font-weight: 500;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }
    
    .sidebar.active {
        width: 260px;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .filters-bar {
        flex-direction: column;
    }
    
    .top-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* TOGGLE MENU MOBILE */
.menu-toggle {
    display: none;
    background: var(--verde-escuro);
    color: var(--branco);
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
}

/* LOADING */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--cinza-medio);
    border-top-color: var(--verde-escuro);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* TOOLTIP */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--cinza-escuro);
    color: var(--branco);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* PRINT STYLES */
@media print {
    .sidebar,
    .top-header,
    .btn,
    .actions {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
