:root {
    --primary-brown: #8b3c1c;
    --primary-red: #b22222;
    --dark-brown: #5c2610;
    --light-brown: #d4a373;
    --bg-light: #fef8f0;
    --text-dark: #2c1810;
    --text-light: #fff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR STYLES (Fixed) ========== */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, var(--primary-brown) 0%, var(--dark-brown) 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 5px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.logo {
    font-size: 20px;
    font-weight: bold;
}

.logo i {
    margin-right: 10px;
}

.sidebar-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: none;
}

.user-profile {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.user-avatar {
    width: 60px;
    height: 60px;
    background: var(--primary-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto 10px;
    border: 3px solid rgba(255,255,255,0.3);
}

.user-fullname {
    font-weight: 600;
    margin-bottom: 5px;
}

.user-role {
    font-size: 12px;
    opacity: 0.8;
}

.user-role i {
    margin-right: 5px;
}

.sidebar-menu {
    padding: 20px 0;
    flex: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: var(--transition);
    gap: 12px;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
    padding-left: 25px;
}

.menu-item.active {
    background: var(--primary-red);
    border-left: 4px solid white;
}

.menu-icon {
    font-size: 18px;
    width: 28px;
}

.menu-text {
    font-size: 14px;
    font-weight: 500;
}

.menu-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 15px 20px;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    margin-left: 280px;
    width: calc(100% - 280px);
    min-height: 100vh;
    background: var(--bg-light);
}

/* Top Navbar */
.top-navbar {
    background: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 99;
}

.menu-toggle {
    background: var(--primary-brown);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 8px;
    display: none;
}

.navbar-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-brown);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    padding: 8px 15px;
    border-radius: 25px;
}

.user-dropdown i {
    font-size: 20px;
    color: var(--primary-brown);
}

.user-name {
    font-weight: 500;
    color: var(--text-dark);
}

.user-role-badge {
    background: var(--primary-red);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    color: white;
}

/* Page Content */
.page-content {
    padding: 25px;
    min-height: calc(100vh - 70px);
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .page-content {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .navbar-title {
        font-size: 16px;
    }
    
    .user-name {
        display: none;
    }
}

@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0);
        position: fixed;
    }
    
    .menu-toggle {
        display: none;
    }
    
    .sidebar-close {
        display: none;
    }
}

/* Overlay for mobile */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* ========== STATS CARDS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-red);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.stat-title {
    font-size: 13px;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.stat-title i {
    margin-right: 8px;
    color: var(--primary-red);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-brown);
    margin-bottom: 10px;
}

.stat-change {
    font-size: 12px;
    color: #4caf50;
}

.stat-change i {
    margin-right: 3px;
}

/* ========== CARDS ========== */
.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-brown);
}

.card-title i {
    margin-right: 10px;
    color: var(--primary-red);
}

/* ========== TABLES ========== */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--primary-brown);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 500;
}

.data-table th i {
    margin-right: 8px;
    font-size: 14px;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.data-table tr:hover {
    background: #f9f9f9;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-label.required:after {
    content: " *";
    color: var(--primary-red);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(178,34,34,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-hint {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-brown);
    color: white;
}

.btn-primary:hover {
    background: var(--dark-brown);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--primary-red);
    color: white;
}

.btn-danger:hover {
    background: #8b0000;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* ========== ALERTS ========== */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========== STATUS BADGES ========== */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.status-available {
    background: #28a745;
    color: white;
}

.status-sold {
    background: #dc3545;
    color: white;
}

.status-rented {
    background: #ffc107;
    color: #856404;
}

.status-reserved {
    background: #fd7e14;
    color: white;
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 8px 15px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: var(--primary-brown);
    transition: all 0.3s;
}

.pagination a:hover {
    background: var(--primary-brown);
    color: white;
}

.pagination .active {
    background: var(--primary-brown);
    color: white;
}

/* ========== LOADING SPINNER ========== */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-red);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 0;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    background: var(--primary-brown);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 25px;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* ========== SITE VISIT CARDS ========== */
.visit-card {
    background: white;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.visit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.visit-header {
    background: var(--primary-brown);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.visit-body {
    padding: 20px;
}

.outcome-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.outcome-liked {
    background: #28a745;
    color: white;
}

.outcome-partial {
    background: #ffc107;
    color: #856404;
}

.outcome-disliked {
    background: #dc3545;
    color: white;
}

.outcome-pending {
    background: #fd7e14;
    color: white;
}

/* ========== PROPERTY GRID ========== */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.property-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.property-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.property-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    position: relative;
}

.property-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 48px;
}

.property-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
}

.property-body {
    padding: 20px;
    flex: 1;
}

.property-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-brown);
    margin-bottom: 10px;
}

.property-location {
    color: #666;
    font-size: 13px;
    margin-bottom: 10px;
}

.property-price {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-red);
    margin: 10px 0;
}

.property-type {
    display: inline-block;
    padding: 3px 10px;
    background: #f0f0f0;
    border-radius: 15px;
    font-size: 11px;
    margin-bottom: 10px;
}

.property-description {
    color: #666;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 15px;
    max-height: 60px;
    overflow: hidden;
}

/* ========== FILTER BARS ========== */
.filter-bar, .filter-tabs, .filter-buttons {
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    padding: 15px;
}

.filter-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 20px;
    background: #f0f0f0;
    border-radius: 25px;
    text-decoration: none;
    color: #666;
    transition: all 0.3s;
}

.filter-tab.active {
    background: var(--primary-brown);
    color: white;
}

.filter-tab:hover {
    background: var(--light-brown);
    color: white;
}

.filter-chip {
    padding: 8px 15px;
    background: #f0f0f0;
    border-radius: 25px;
    text-decoration: none;
    color: #666;
    font-size: 13px;
    transition: all 0.3s;
}

.filter-chip.active {
    background: var(--primary-brown);
    color: white;
}

.filter-chip:hover {
    background: var(--light-brown);
    color: white;
}