:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --gray: #95a5a6;
    --border: #bdc3c7;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Auth Pages */
.auth-page {
    background: linear-gradient(135deg, var(--primary) 0%, #34495e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--gray);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--primary);
    color: white;
    position: fixed;
    height: 100vh;
    padding: 2rem 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    margin-bottom: 0.5rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    padding: 0.8rem 1.5rem;
    display: block;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.1);
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
    background: #f8f9fa;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
}

.form-control:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

small {
    color: var(--gray);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    font-size: 0.9rem;
    text-align: center;
}

.btn-primary {
    background: var(--secondary);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border-left: 4px solid transparent;
}

.alert-error {
    background: #fee;
    border-color: var(--danger);
    color: #c53030;
}

.alert-success {
    background: #f0fff4;
    border-color: var(--success);
    color: #276749;
}

.alert-warning {
    background: #fffaf0;
    border-color: var(--warning);
    color: #744210;
}

/* Tables */
.data-table {
    width: 100%;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #c6f6d5;
    color: #276749;
}

.status-suspended {
    background: #fed7d7;
    color: #c53030;
}

.status-pending {
    background: #feebcb;
    color: #744210;
}

.status-sold {
    background: #bee3f8;
    color: #2c5282;
}

/* Role Badges */
.role-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin {
    background: #e9d8fd;
    color: #6b46c1;
}

.role-agent {
    background: #c6f6d5;
    color: #276749;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--secondary);
    display: block;
    line-height: 1;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Page Header */
.page-header {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    justify-content: between;
    align-items: center;
}

.page-header h1 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--gray);
    margin: 0;
}

/* Property Forms */
.property-form {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Property Thumbnails */
.property-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 1rem;
}

.property-info-cell {
    display: flex;
    align-items: center;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-link {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.3s;
}

.pagination-link:hover,
.pagination-link.active {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-state h3 {
    color: var(--gray);
    margin-bottom: 1rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.dashboard-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Activity List */
.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.activity-details {
    flex: 1;
}

.activity-description {
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.activity-time {
    color: var(--gray);
    font-size: 0.875rem;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: var(--light);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--dark);
    transition: all 0.3s;
    text-align: center;
}

.quick-action:hover {
    background: var(--secondary);
    color: white;
    transform: translateY(-2px);
}

.action-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-container {
        flex-direction: column;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .auth-container {
        padding: 1rem;
    }
}

/* Utility Classes */
.text-muted {
    color: var(--gray);
}

.badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background: var(--secondary);
    color: white;
}

.no-data {
    text-align: center;
    color: var(--gray);
    padding: 2rem;
    font-style: italic;
}

/* File Upload Styles */
.file-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: border-color 0.3s;
}

.file-upload:hover {
    border-color: var(--secondary);
}

.file-upload.dragover {
    border-color: var(--secondary);
    background: #f0f8ff;
}