:root {
    --primary-dark: #1a2332;
    --accent-teal: #00b4d8;
    --accent-light: #90e0ef;
    --success-green: #06a77d;
    --danger-red: #d62828;
    --warning-yellow: #f77f00;
    --neutral-gray: #f5f5f5;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.15);
}

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

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9f9f9;
    color: var(--text-dark);
}

body {
    display: flex;
    flex-direction: column;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent-teal) 100%);
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.login-card .subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* Layout */
.app-layout {
    display: flex;
    flex: 1;
}

.sidebar {
    width: 250px;
    background-color: var(--primary-dark);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

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

.sidebar-header h2 {
    font-size: 1.5rem;
    color: var(--accent-teal);
}

.sidebar-header .subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: block;
    padding: 0.75rem 2rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: rgba(0, 180, 216, 0.1);
    color: var(--accent-teal);
    border-left-color: var(--accent-teal);
    padding-left: calc(2rem - 3px);
}

.sidebar-footer {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    padding: 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
}

.sidebar-footer .user-info {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.sidebar-footer a {
    color: var(--accent-teal);
    text-decoration: none;
    font-size: 0.9rem;
}

.main-content {
    margin-left: 250px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    background-color: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.topbar-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.topbar-actions button {
    background-color: var(--accent-teal);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.topbar-actions button:hover {
    background-color: #0096b6;
}

.content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--accent-teal);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--text-light);
    margin: 0 0.5rem;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

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

/* Cards */
.card {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

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

.card-header h2 {
    font-size: 1.3rem;
    color: var(--primary-dark);
}

.card-header-actions {
    display: flex;
    gap: 0.5rem;
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--accent-teal);
}

.kpi-card.positive {
    border-top-color: var(--success-green);
}

.kpi-card.negative {
    border-top-color: var(--danger-red);
}

.kpi-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-dark);
}

.kpi-subtitle {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

thead {
    background-color: var(--primary-dark);
    color: white;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: var(--neutral-gray);
    cursor: pointer;
}

tbody tr.clickable:hover {
    background-color: #f0f8ff;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.confirmed {
    background-color: #d4edda;
    color: #155724;
}

.badge.cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.badge.pending {
    background-color: #fff3cd;
    color: #856404;
}

/* Variance colors */
.positive {
    color: var(--success-green);
    font-weight: 600;
}

.negative {
    color: var(--danger-red);
    font-weight: 600;
}

/* Forms */
form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-dark);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

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

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* Buttons */
button,
.btn,
a.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--accent-teal);
    color: white;
}

.btn-primary:hover {
    background-color: #0096b6;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: var(--danger-red);
    color: white;
}

.btn-danger:hover {
    background-color: #b81c21;
}

.btn-success {
    background-color: var(--success-green);
    color: white;
}

.btn-success:hover {
    background-color: #058266;
}

.btn-outline {
    background-color: transparent;
    color: var(--accent-teal);
    border: 2px solid var(--accent-teal);
}

.btn-outline:hover {
    background-color: var(--accent-teal);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Filters */
.filter-bar {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-row:last-child {
    margin-bottom: 0;
}

/* Charts */
.chart-container {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    position: relative;
    height: 400px;
}

.chart-container h3 {
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

/* Properties Grid */
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.property-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.property-card-header {
    background-color: var(--primary-dark);
    color: white;
    padding: 1rem;
}

.property-card-header h3 {
    margin: 0;
}

.property-card-body {
    padding: 1.5rem;
}

.property-card-stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.property-card-stat:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.property-card-stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.property-card-stat-value {
    font-weight: 600;
    color: var(--primary-dark);
}

.property-card-footer {
    padding: 1rem;
    background-color: var(--neutral-gray);
    display: flex;
    gap: 0.5rem;
}

.property-card-footer a {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    background-color: var(--accent-teal);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.property-card-footer a:hover {
    background-color: #0096b6;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--accent-teal);
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: var(--accent-teal);
    color: white;
}

.pagination .active {
    background-color: var(--accent-teal);
    color: white;
    border-color: var(--accent-teal);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    .content {
        padding: 1rem;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .property-grid {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    .topbar {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .sidebar {
        position: fixed;
        left: -250px;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .login-card {
        padding: 2rem 1rem;
    }
    
    .kpi-value {
        font-size: 1.5rem;
    }
}
