:root {
    --bg: #f3efe6;
    --paper: #fffdf8;
    --ink: #17212b;
    --muted: #66707a;
    --line: #d8d0c1;
    --accent: #0f766e;
    --accent-soft: #d4f2ef;
    --danger: #b42318;
    --success: #166534;
    --income: #166534;
    --expense: #b42318;
    --shadow: 0 22px 60px rgba(23, 33, 43, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 35%),
        radial-gradient(circle at top right, rgba(180, 35, 24, 0.08), transparent 30%),
        linear-gradient(180deg, #f7f2e8 0%, #efe7d9 100%);
    min-height: 100vh;
}

a {
    color: inherit;
}

.shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

.card,
.hero,
.auth-box {
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid rgba(216, 208, 193, 0.88);
    border-radius: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.hero {
    padding: 26px;
    display: grid;
    gap: 14px;
}

.hero-top,
.toolbar,
.summary-grid,
.grid,
.split,
.topbar {
    display: grid;
    gap: 16px;
}

.hero-top {
    grid-template-columns: 1.3fr 0.7fr;
    align-items: start;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1;
}

.muted {
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 12px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

.toolbar,
.topbar {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: center;
}

.summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.summary-card {
    padding: 18px;
    border-radius: 18px;
    background: var(--paper);
    border: 1px solid var(--line);
}

.summary-card .label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
}

.summary-card .amount {
    font-size: 28px;
    font-weight: 700;
}

.delta {
    font-size: 13px;
    margin-top: 6px;
}

.income {
    color: var(--income);
}

.expense {
    color: var(--expense);
}

.grid {
    grid-template-columns: 1.05fr 0.95fr;
    margin-top: 20px;
}

.split {
    grid-template-columns: 1fr 1fr;
}

.card {
    padding: 22px;
}

.card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

form {
    display: grid;
    gap: 12px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.field-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

label {
    display: grid;
    gap: 6px;
    font-size: 14px;
    color: var(--muted);
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
    color: var(--ink);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

button {
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    cursor: pointer;
    background: var(--ink);
    color: #fff;
    font-weight: 700;
}

.button-soft {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
}

.button-accent {
    background: var(--accent);
}

.button-danger {
    background: var(--danger);
}

.stack {
    display: grid;
    gap: 12px;
}

.list {
    display: grid;
    gap: 12px;
}

.list-item {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    display: grid;
    gap: 6px;
    background: rgba(255, 255, 255, 0.82);
}

.item-top,
.item-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.notice,
.error,
.success {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-size: 14px;
}

.notice {
    background: #eef6ff;
    color: #12426b;
}

.error {
    background: #fef3f2;
    color: #912018;
}

.success {
    background: #ecfdf3;
    color: #166534;
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
}

.auth-box {
    width: min(460px, 100%);
    padding: 28px;
}

.code {
    font-family: "IBM Plex Mono", monospace;
    background: #f7f2e8;
    border-radius: 10px;
    padding: 2px 6px;
}

pre {
    background: #17212b;
    color: #f7f7f4;
    border-radius: 18px;
    padding: 16px;
    overflow: auto;
    font-family: "IBM Plex Mono", monospace;
    font-size: 13px;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .hero-top,
    .grid,
    .split,
    .field-grid,
    .field-grid-3 {
        grid-template-columns: 1fr;
    }
}
