:root {
    --primary: #0A3B5C;
    --primary-light: #1A5580;
    --accent: #D4A574;
    --accent-hover: #C29560;
    --bg-main: #F8F9FA;
    --bg-card: #FFFFFF;
    --text-primary: #1A2332;
    --text-secondary: #5F6B7A;
    --border: #E5E8EB;
    --success: #2D7A3E;
    --warning: #C17A2F;
    --danger: #B83C3C;
    --shadow-sm: 0 1px 3px rgba(10, 59, 92, 0.08);
    --shadow-md: 0 4px 12px rgba(10, 59, 92, 0.12);
    --shadow-lg: 0 8px 24px rgba(10, 59, 92, 0.16);
}

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

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--primary);
    color: white;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.logo-subtitle {
    font-size: 0.875rem;
    opacity: 0.7;
    letter-spacing: 0.5px;
}

.nav-menu {
    padding: 1.5rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 0.75rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: var(--accent);
    color: white;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: white;
}

.nav-icon {
    margin-right: 0.875rem;
    font-size: 1.125rem;
    width: 1.25rem;
    text-align: center;
}

/* Sidebar icon colors */
.nav-icon .bi-speedometer2      { color: #5B9BD5; }  /* Dashboard - blue */
.nav-icon .bi-graph-up          { color: #6BCB77; }  /* Reports - green */
.nav-icon .bi-buildings          { color: #A8A8A8; }  /* Properties - silver */
.nav-icon .bi-people             { color: #F5C542; }  /* Tenants - gold */
.nav-icon .bi-file-earmark-ruled { color: #81C784; }  /* Leases - green */
.nav-icon .bi-file-earmark-text  { color: #FFB74D; }  /* Applications - orange */
.nav-icon .bi-hourglass-split    { color: #CE93D8; }  /* Waiting Lists - purple */
.nav-icon .bi-cash-stack         { color: #66BB6A; }  /* Rent Collection - green */
.nav-icon .bi-wrench-adjustable  { color: #90A4AE; }  /* Maintenance - steel */
.nav-icon .bi-tree               { color: #66BB6A; }  /* Grounds - green */
.nav-icon .bi-bug                { color: #EF5350; }  /* Pest Control - red */
.nav-icon .bi-p-square           { color: #42A5F5; }  /* Parking - blue */
.nav-icon .bi-calendar-check     { color: #5B9BD5; }  /* Make Ready - blue */
.nav-icon .bi-bullseye           { color: #EF5350; }  /* Tasks - red */
.nav-icon .bi-clock-history      { color: #FFB74D; }  /* Timekeeping - orange */

/* Keep active nav icons white for contrast against accent background */
.nav-item.active .nav-icon [class^="bi-"] {
    color: #FFFFFF;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.top-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

.search-bar {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 59, 92, 0.1);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notification-btn, .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-btn {
    background: var(--bg-main);
    border: none;
    font-size: 1.25rem;
    position: relative;
}

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

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.user-avatar {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Dashboard Content */
.dashboard {
    padding: 2rem;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    animation: slideUp 0.5s ease;
    animation-fill-mode: both;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary { background: rgba(10, 59, 92, 0.1); color: var(--primary); }
.stat-icon.accent { background: rgba(212, 165, 116, 0.1); color: var(--accent); }
.stat-icon.success { background: rgba(45, 122, 62, 0.1); color: var(--success); }
.stat-icon.warning { background: rgba(193, 122, 47, 0.1); color: var(--warning); }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

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

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-action {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.card-action:hover {
    color: var(--accent-hover);
}

.card-body {
    padding: 1.5rem;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.table tr:last-child td {
    border-bottom: none;
}

.property-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.property-address {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge.occupied { background: rgba(45, 122, 62, 0.1); color: var(--success); }
.badge.vacant { background: rgba(193, 122, 47, 0.1); color: var(--warning); }
.badge.maintenance { background: rgba(184, 60, 60, 0.1); color: var(--danger); }
.badge.pending { background: rgba(212, 165, 116, 0.1); color: var(--accent); }

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.maintenance { background: rgba(193, 122, 47, 0.1); color: var(--warning); }
.activity-icon.payment { background: rgba(45, 122, 62, 0.1); color: var(--success); }
.activity-icon.application { background: rgba(212, 165, 116, 0.1); color: var(--accent); }
.activity-icon.alert { background: rgba(184, 60, 60, 0.1); color: var(--danger); }

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.activity-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.action-btn:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.action-btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.action-btn-text {
    font-weight: 600;
    font-size: 0.9375rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .search-bar {
        display: none;
    }

    .dashboard {
        padding: 1.5rem 1rem;
    }

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

    .page-title {
        font-size: 1.5rem;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-overlay.active {
    display: block;
}
