﻿.app-page {
    display: grid;
    gap: 28px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
}

.page-kicker,
.panel-kicker {
    color: #8297ff;
    text-transform: uppercase;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.page-heading h1 {
    margin: 8px 0 7px;
    color: var(--bw-text);
    font-size: clamp( 2rem, 4vw, 2.8rem);
    line-height: 1;
    font-weight: 780;
    letter-spacing: -0.055em;
}

.page-heading p {
    max-width: 620px;
    margin: 0;
    color: var(--bw-text-muted);
    font-size: 0.86rem;
    line-height: 1.6;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.metric-card,
.app-panel,
.empty-dashboard,
.app-error-state {
    border: 1px solid var(--bw-border);
    background: var(--bw-surface-soft);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.07);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.metric-card {
    min-height: 135px;
    padding: 21px;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
}

.metric-label {
    color: var(--bw-text-muted);
    font-size: 0.7rem;
    font-weight: 680;
}

.metric-value {
    margin-top: 14px;
    color: var(--bw-text);
    font-size: 1.9rem;
    line-height: 1;
    letter-spacing: -0.05em;
}

.metric-footnote {
    margin-top: auto;
    padding-top: 11px;
    color: var(--bw-text-subtle);
    font-size: 0.62rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
    gap: 17px;
}

.app-panel {
    border-radius: 21px;
}

.bills-panel {
    overflow: hidden;
    padding: 24px;
}

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

    .panel-heading h2 {
        margin: 5px 0 0;
        color: var(--bw-text);
        font-size: 1.14rem;
        letter-spacing: -0.035em;
    }

.text-action {
    color: #8297ff;
    text-decoration: none;
    font-size: 0.69rem;
    font-weight: 700;
}

    .text-action:hover {
        color: #9dacf9;
    }

.bill-list {
    display: grid;
}

.bill-row {
    min-height: 70px;
    padding: 9px 3px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    border-top: 1px solid var(--bw-border);
    color: inherit;
    text-decoration: none;
    transition: background 150ms ease, transform 150ms ease;
}

    .bill-row:hover {
        background: rgba(100, 120, 170, 0.04);
    }

.bill-avatar {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(81, 106, 239, 0.11);
    color: #8498ff;
    font-size: 0.76rem;
    font-weight: 800;
}

.bill-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

    .bill-info strong {
        overflow: hidden;
        color: var(--bw-text-secondary);
        font-size: 0.78rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .bill-info span {
        margin-top: 3px;
        color: var(--bw-text-subtle);
        font-size: 0.63rem;
    }

.bill-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

    .bill-amount strong {
        color: var(--bw-text);
        font-size: 0.82rem;
    }

    .bill-amount span {
        margin-top: 3px;
        color: var(--bw-text-subtle);
        font-size: 0.61rem;
    }

    .bill-amount .amount-increase {
        color: #e06f67;
    }

    .bill-amount .amount-decrease {
        color: #48b77d;
    }

    .bill-amount .amount-steady {
        color: var(--bw-text-subtle);
    }

.insight-panel {
    min-height: 365px;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.insight-provider {
    margin-top: 28px;
    color: var(--bw-text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

.insight-change {
    margin-top: 6px;
    color: #ee766e;
    font-size: clamp( 2.5rem, 5vw, 3.5rem);
    font-weight: 790;
    letter-spacing: -0.065em;
    line-height: 1;
}

.insight-period {
    margin-top: 7px;
    color: var(--bw-text-muted);
    font-size: 0.67rem;
    line-height: 1.4;
}

.annual-impact {
    margin-top: 24px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 13px;
    background: rgba(221, 77, 69, 0.08);
}

    .annual-impact span {
        color: #a27d7b;
        font-size: 0.63rem;
    }

    .annual-impact strong {
        color: #e2736c;
        font-size: 1rem;
    }

.evidence-note {
    margin: 17px 0;
    color: var(--bw-text-muted);
    font-size: 0.7rem;
    line-height: 1.55;
}

.primary-action,
.secondary-action {
    min-height: 39px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 11px;
    font-size: 0.72rem;
    font-weight: 730;
    text-decoration: none;
    cursor: pointer;
}

.primary-action {
    margin-top: auto;
    border: 0;
    background: linear-gradient( 145deg, #294ff0, #5b74f5);
    color: white;
    box-shadow: 0 10px 26px rgba(43, 74, 230, 0.2);
}

    .primary-action:hover {
        color: white;
    }

.secondary-action {
    border: 1px solid var(--bw-border);
    background: var(--bw-surface);
    color: var(--bw-text-secondary);
}

.steady-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.steady-check {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 14px;
    background: rgba(60, 182, 119, 0.1);
    color: #48b77d;
    font-weight: 900;
}

.steady-state h2 {
    margin: 0 0 9px;
    color: var(--bw-text);
    font-size: 1.05rem;
}

.steady-state p {
    margin: 0;
    color: var(--bw-text-muted);
    font-size: 0.72rem;
    line-height: 1.6;
}

.empty-dashboard {
    min-height: 400px;
    padding: 50px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 23px;
    text-align: center;
}

.empty-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    border-radius: 18px;
    background: rgba(79, 104, 237, 0.1);
    color: #8397ff;
}

    .empty-icon svg {
        width: 25px;
        height: 25px;
    }

.empty-dashboard h2 {
    max-width: 470px;
    margin: 10px 0;
    color: var(--bw-text);
    font-size: 1.45rem;
    letter-spacing: -0.04em;
}

.empty-dashboard p {
    max-width: 510px;
    margin: 0;
    color: var(--bw-text-muted);
    font-size: 0.79rem;
    line-height: 1.65;
}

.app-error-state {
    min-height: 210px;
    padding: 30px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    border-radius: 20px;
}

.state-symbol {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(222, 74, 67, 0.1);
    color: #e16f67;
    font-weight: 850;
}

.app-error-state h2 {
    margin: 0 0 6px;
    color: var(--bw-text);
    font-size: 1rem;
}

.app-error-state p {
    margin: 0;
    color: var(--bw-text-muted);
    font-size: 0.73rem;
}

.dashboard-loading {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.skeleton-card,
.skeleton-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--bw-border);
    background: var(--bw-surface-soft);
}

.skeleton-card {
    height: 135px;
    border-radius: 18px;
}

.skeleton-panel {
    height: 380px;
    border-radius: 21px;
}

    .skeleton-card::after,
    .skeleton-panel::after {
        content: "";
        position: absolute;
        inset: 0;
        transform: translateX(-100%);
        background: linear-gradient( 90deg, transparent, rgba(130, 150, 200, 0.07), transparent);
        animation: billwatch-shimmer 1.5s infinite;
    }

@keyframes billwatch-shimmer {
    100% {
        transform: translateX(100%);
    }
}

@media (max-width: 1000px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .insight-panel {
        min-height: 300px;
    }
}

@media (max-width: 720px) {
    .metric-grid,
    .dashboard-loading {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 120px;
    }

    .app-error-state {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    .page-heading h1 {
        font-size: 2rem;
    }

    .bills-panel,
    .insight-panel {
        padding: 18px;
    }

    .bill-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .bill-amount {
        grid-column: 2;
        align-items: flex-start;
        margin-top: -6px;
    }
}
