:root {
    --background: #f3f5f8;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #dfe4ea;
    --text: #202936;
    --muted: #687483;
    --ok: #198754;
    --warning: #fd7e14;
    --alert: #dc3545;
    --info: #0d6efd;
    --shadow: 0 4px 14px rgba(31, 41, 55, 0.07);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

.page {
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    padding: 22px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 22px;
}

.title {
    margin: 0;
    font-size: 30px;
}

.subtitle {
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
}

.navigation {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.navigation a {
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    color: var(--info);
    text-decoration: none;
    font-size: 13px;
}

.navigation a:hover {
    background: var(--surface-soft);
}

.toolbar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
}

.field label {
    color: var(--muted);
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.field select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
}

.summary {
    margin-left: auto;
    color: var(--muted);
    font-size: 13px;
}

.summary strong {
    color: var(--text);
}

.chart-card {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.chart-title {
    margin: 0;
    font-size: 19px;
}

.chart-description {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.chart-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.chart-stat {
    min-width: 90px;
}

.chart-stat-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.chart-stat-value {
    margin-top: 4px;
    font-size: 17px;
    font-weight: bold;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 430px;
    overflow: hidden;
}

#metrics-chart {
    display: block;
    width: 100%;
    height: 100%;
}

.empty {
    display: none;
    padding: 50px 20px;
    color: var(--muted);
    text-align: center;
}

.tooltip {
    position: fixed;
    z-index: 1000;
    display: none;
    pointer-events: none;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(32, 41, 54, 0.95);
    color: #ffffff;
    font-size: 12px;
    white-space: nowrap;
}

.application-footer {
    margin-top: 26px;
    padding: 16px 10px 4px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

@media (max-width: 700px) {
    .page {
        padding: 12px;
    }

    .header {
        flex-direction: column;
    }

    .field {
        width: 100%;
    }

    .summary {
        width: 100%;
        margin-left: 0;
    }

    .chart-container {
        height: 340px;
    }
}
