:root {
    --bg-color: #121626; /* Dark blue background */
    --card-bg-color: #1a223a; /* Slightly lighter blue for cards/panels */
    --header-color: #f0f0f0; /* Light text color */
    --highlight-color: #2e78c8; /* Blue highlight */
    --text-muted: #8a96b9; /* Faded text */
}

/* Basic Reset and Font */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* Or another clean font */
}

body {
    background-color: var(--bg-color);
    color: var(--header-color);
    padding: 20px;
}

/* --- Header Section --- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--card-bg-color); /* Subtle line */
}

.header-title {
    font-size: 1.5em;
    font-weight: 700;
}

.subtitle {
    font-size: 0.8em;
    font-weight: 300;
    color: var(--text-muted);
}

.header-meta {
    text-align: right;
    font-size: 0.9em;
}

/* --- Controls Section --- */
.dashboard-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.controls-left {
    display: flex;
}

.tab {
    padding: 8px 15px;
    margin-right: 10px;
    border: 1px solid var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--text-muted);
}

.tab.active {
    background-color: var(--highlight-color);
    border-color: var(--highlight-color);
    color: var(--header-color);
    font-weight: 500;
}

.day-btn {
    background: none;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 5px 10px;
    margin-left: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.day-btn.active {
    background-color: var(--highlight-color);
    border-color: var(--highlight-color);
    color: var(--header-color);
}

/* --- Main Content Layout --- */
.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- Top Stat Cards --- */
.stat-cards {
    display: grid;
    /* 6 equal columns */
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.stat-card {
    background-color: var(--card-bg-color);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    /* Added a subtle light border to match the image */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-icon {
    font-size: 2em;
    color: var(--highlight-color);
}

.card-title {
    font-size: 0.8em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 3px;
}

.card-value {
    font-size: 1.8em;
    font-weight: 700;
}

.card-trend {
    font-size: 0.7em;
    color: #4CAF50; /* Green for up */
}

/* --- Bottom Panels --- */
.bottom-panels {
    display: grid;
    /* Two main panels */
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.panel {
    background-color: var(--card-bg-color);
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    /*min-height: 600px;*/
    min-height: 400px; /* Give panels a decent height */
}

.panel-header {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 5px;
}

.panel-subheader {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-bottom: 15px;
}

/* Placeholder for the Charts (where a library would inject the actual visual) */
.chart-placeholder {
    /* For the line chart placeholder */
    display: flex;
    align-items: flex-end;
    height: 80%;
    position: relative;
    /* Basic visual for the line chart area */
    border-left: 1px solid var(--text-muted);
    border-bottom: 1px solid var(--text-muted);
}

.y-axis-label {
    position: absolute;
    left: -20px;
    bottom: 5px;
    font-size: 0.8em;
    line-height: 1.4;
    color: var(--text-muted);
    text-align: right;
}

.x-axis-label {
    position: absolute;
    bottom: -20px;
    right: 0;
    font-size: 0.8em;
    color: var(--text-muted);
}


/* Styling for the Donut Chart Panel */
.donut-chart {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 80%;
}

.donut-placeholder {
    /* Mock-up for the donut chart image */
    width: 150px;
    height: 150px;
    border-radius: 50%;
    /* This color combination is a simplified visual representation */
    background: conic-gradient(
        #c82e2e 0% 10%, /* Red (Birth) */
        #ff8c00 10% 20%, /* Orange (Death) */
        #e9d18c 20% 30%, /* Yellowish (Marriage) */
        #3c4043 30% 100% /* Dark Grey (Other) */
    );
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--card-bg-color);
    font-size: 0.7em;
    text-align: center;
}

.legend {
    list-style: none;
    padding: 0;
    margin-left: 20px;
}

.legend li {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 8px;
}

/* Status Colors (Simplified mapping) */
.status-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 8px;
}

.status-color.blue { background-color: blue; }
.status-color.green { background-color: green; }
.status-color.yellow { background-color: yellow; }
.status-color.red { background-color: red; }
.status-color.darkgray { background-color: darkgray; }
.status-color.white { background-color: white; }

/* Legend Colors (Simplified mapping) */
.legend-color.birth { background-color: #c82e2e; }
.legend-color.death { background-color: #ff8c00; }
.legend-color.marriage { background-color: #e9d18c; }
.legend-color.divorce { background-color: #3c4043; } /* Grey */
.legend-color.non-marital { background-color: #55585b; } /* Darker Grey */
.legend-color.adoption { background-color: #999999; } /* Lighter Grey */

/* --- Media Query for smaller screens (optional but good practice) --- */
@media (max-width: 1200px) {
    .stat-cards {
        grid-template-columns: repeat(3, 1fr); /* 3 cards per row */
    }
}

@media (max-width: 768px) {
    .stat-cards {
        grid-template-columns: repeat(2, 1fr); /* 2 cards per row */
    }
    .bottom-panels {
        grid-template-columns: 1fr; /* Stack panels vertically */
    }
    .dashboard-controls {
        flex-direction: column;
        gap: 10px;
    }
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
