:root {
    --text-main: #1F2937;
    --text-sub: #64748B;
    --bg-main: #f8f9fa;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --card-income: #4ade80;
    --card-savings: #facc15;
    --card-expenses: #f87171;
    --card-leftover: #fb923c;
    --card-bar-min-height: 4px; /* minsta höjd för synlighet */
}

/* Hela sidan */
.budget-page {
    padding: 16px;
    background-color: var(--bg-main);
}

/* År-headers */
.year-header {
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

/* Grid för månader (horisontellt med wrap) */
.budget-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Kort per månad */
.budget-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    padding: 6px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-width: 110px;
}

    .budget-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 14px rgba(0,0,0,0.1);
    }

/* Månadens namn */
.month-header {
    display: flex;
    align-items: center; /* staplar och text vertikalt centrerade */
    gap: 6px; /* mellanrum mellan namn och staplar */
    cursor: pointer;
}

.month-name {
    font-weight: 600;
    color: var(--text-main);
    min-width: 50px;
}

.month-bars {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 2px;
    opacity: 0.6;
    height: 30px; /* maxhöjd på staplar */
}


.bar {
    width: 6px; /* lite bredare */
    border-radius: 3px 3px 0 0;
    background-color: gray;
    transition: height 0.3s ease;
    min-height: 8px; /* alltid synlig höjd */
}


    .bar.income {
        background-color: var(--card-income);
    }

    .bar.savings {
        background-color: var(--card-savings);
    }

    .bar.expenses {
        background-color: var(--card-expenses);
    }

    .bar.leftover {
        background-color: var(--card-leftover);
    }

/* Detaljer */
.item-list {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    min-width: 180px;
}

.item-label {
    font-weight: 500;
    color: var(--text-main);
}

.amount {
    font-weight: 600;
}

/* Toggle */
.details-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 8px 0;
}

    .details-toggle input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }


