:root {
    --ink: #131126;
    --secondary: #484459;
    --muted: #59566b;
    --line: rgb(15 15 20 / 7%);
    --surface: #fff;
    --card-edge: #e8e4dd;
    --card-shadow: 0 4px 16px -6px rgb(70 55 35 / 14%);
    --card-background: linear-gradient(160deg, rgb(255 255 255 / 85%), rgb(255 255 255 / 55%));
    --glass: rgb(255 255 255 / 62%);
    --dialog-glass: rgb(252 250 254 / 92%);
    --neutral-fill: #f1eef3;
    --surface-hover: rgb(60 35 81 / 4%);
    --accent: #4b2e73;
    --accent-fill: #f1ecfa;
    --accent-hover: #e8dff6;
    --accent-soft: #f6f1fb;
    --accent-border: #d9ccef;
    --income: #236043;
    --expense: #902f43;
    --expense-fill: #f8e6e9;
    --shadow-color: rgb(34 38 48 / 16%);
    --backdrop: rgb(34 38 48 / 40%);
    color: var(--ink);
    background:
        radial-gradient(ellipse 600px 500px at 10% 15%, rgb(60 35 81 / 5%), transparent 70%),
        radial-gradient(ellipse 500px 400px at 85% 10%, rgb(90 50 120 / 3.5%), transparent 65%),
        #fbfaf8;
    min-height: 100%;
    font: 16px/1.5 system-ui, sans-serif;
}

body {
    margin: 0;
    padding: clamp(8px, 2vw, 32px);
}

main {
    max-width: 640px;
    margin: 0 auto;
    padding: clamp(12px, 2vw, 24px);
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--glass);
}

.dashboard-card {
    border: 1px solid var(--card-edge);
    border-radius: 18px;
    background: var(--card-background);
    box-shadow: var(--card-shadow);
}

h1 {
    margin: 0;
    font-size: clamp(24px, 2.5vw, 28px);
    font-weight: 400;
    line-height: 1.2;
}

button {
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--accent);
    color: var(--surface);
    font: inherit;
    cursor: pointer;
}

button:disabled {
    opacity: .6;
    cursor: default;
}

#operation-delete-dialog {
    box-sizing: border-box;
    width: min(390px, calc(100% - 24px));
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: inherit;
    box-shadow: 0 16px 48px var(--shadow-color);
}

#operation-delete-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

#operation-delete-detail {
    margin: 8px 0 16px;
    color: var(--muted);
}

.operation-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

#operation-delete-dialog .operation-confirm-cancel {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--secondary);
}

#operation-delete-dialog .operation-confirm-delete {
    background: var(--expense-fill);
    color: var(--expense);
}

#operation-delete-dialog .operation-confirm-delete:hover {
    background: #f3d9df;
}

#operation-delete-dialog .operation-confirm-cancel:hover {
    background: var(--neutral-fill);
}

dialog {
    background: var(--dialog-glass);
}

dialog::backdrop {
    background: var(--backdrop);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button svg {
    display: block;
    flex: none;
}

table,
.totals,
.categories,
.bar-values,
.debt-badge {
    font-variant-numeric: tabular-nums;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--card-edge);
    background: rgb(255 255 255 / 80%);
    color: var(--muted);
    transition: background-color 140ms ease, color 140ms ease;
}

.icon-button:not(:disabled):hover {
    background: var(--neutral-fill);
    color: var(--ink);
}

.icon-button--operation {
    border-color: var(--accent-border);
    background: var(--accent-fill);
    color: var(--accent);
}

.icon-button--operation:not(:disabled):hover {
    background: var(--accent-hover);
    color: var(--accent);
}

.icon-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
    .icon-button {
        transition: none;
    }
}

.amount-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    white-space: nowrap;
}

.amount-badge--income {
    background: #dcefe5;
    color: var(--income);
}

.amount-badge--expense {
    background: var(--expense-fill);
    color: var(--expense);
}
