:root {
    --pico-font-size: 16px;
    --accent: #3b82f6;
    --positive: #22c55e;
    --negative: #ef4444;
}

body {
    padding-top: 1rem;
    padding-bottom: 2rem;
}

header h1 {
    text-align: center;
    margin-bottom: 2rem;
}

section {
    margin-bottom: 2rem;
}

section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
    padding-bottom: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.stats-grid article {
    margin: 0;
    padding: 1rem;
    text-align: center;
}

.stats-grid article header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pico-muted-color);
    padding: 0;
    margin-bottom: 0.5rem;
    background: none;
    border: none;
}

.stats-grid article p {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

#records-table {
    font-size: 0.9rem;
}

#records-table th,
#records-table td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
}

#records-table .actions {
    white-space: nowrap;
}

#records-table .actions button {
    padding: 0.25rem 0.5rem;
    margin: 0 0.125rem;
    font-size: 0.75rem;
}

.change-positive {
    color: var(--negative);
}

.change-negative {
    color: var(--positive);
}

.hidden {
    display: none !important;
}

.grid button.secondary {
    margin-left: 0.5rem;
}

#add-form .grid {
    margin-bottom: 0;
}

#add-form button[type="submit"],
#add-form button[type="button"] {
    margin-top: 1rem;
}

#confirm-dialog article {
    max-width: 400px;
}

#confirm-dialog footer {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

#confirm-dialog footer button {
    width: auto;
    margin: 0;
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid article p {
        font-size: 1.25rem;
    }

    #records-table {
        font-size: 0.8rem;
    }

    #records-table th,
    #records-table td {
        padding: 0.5rem 0.25rem;
    }
}
