:root {
    --bg-main: #f4efe7;
    --bg-panel: rgba(255, 255, 255, 0.84);
    --text-main: #1b1b1b;
    --text-soft: #5b5f65;
    --line: #d7d0c5;
    --income: #0d8f5b;
    --expense: #c02b2b;
    --neutral: #1d4f87;
    --accent: #ed6a3a;
    --radius: 18px;
    --shadow: 0 18px 36px rgba(37, 24, 12, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 10% 10%, #f8d8b6 0%, transparent 28%),
        radial-gradient(circle at 85% 20%, #ffc7b8 0%, transparent 24%),
        linear-gradient(130deg, #efe6d8 0%, #f8f4ee 55%, #ece7df 100%);
    overflow-x: hidden;
}

.bg-shape {
    position: fixed;
    z-index: -1;
    width: 360px;
    height: 360px;
    filter: blur(50px);
    opacity: 0.35;
}

.bg-one {
    top: -80px;
    right: -80px;
    background: #f0b261;
}

.bg-two {
    bottom: -140px;
    left: -60px;
    background: #6ec5d4;
}

.container {
    width: min(1200px, calc(100% - 2rem));
    margin: 2rem auto 3rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-soft);
    font-size: 0.75rem;
}

h1 {
    margin: 0.25rem 0 0;
    font-size: clamp(1.5rem, 3.3vw, 2.4rem);
}

.tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tabs a {
    text-decoration: none;
    padding: 0.62rem 0.95rem;
    border-radius: 999px;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--line);
    font-weight: 700;
    font-size: 0.92rem;
}

.tabs a.active {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
}

.panel,
.filter-bar,
.card {
    background: var(--bg-panel);
    backdrop-filter: blur(9px);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow);
}

.panel,
.filter-bar {
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.cards {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.card {
    padding: 0.95rem 1rem;
}

.card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.85rem;
}

.card h3 {
    margin: 0.5rem 0 0;
    font-size: 1.4rem;
}

.card.income {
    border-left: 6px solid var(--income);
}

.card.expense {
    border-left: 6px solid var(--expense);
}

.card.net.ok {
    border-left: 6px solid var(--income);
}

.card.net.bad {
    border-left: 6px solid var(--expense);
}

.card.neutral {
    border-left: 6px solid var(--neutral);
}

.split {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1.3fr 1fr;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

thead th {
    text-align: left;
    border-bottom: 1px solid var(--line);
    padding: 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-soft);
}

tbody td {
    border-bottom: 1px dashed #ddd4c8;
    padding: 0.54rem 0.5rem;
    vertical-align: top;
}

.positive {
    color: var(--income);
    font-weight: 700;
}

.negative {
    color: var(--expense);
    font-weight: 700;
}

.inline-form,
.upload-form,
.projection-form,
.filters-grid {
    display: grid;
    gap: 0.7rem;
}

.inline-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
}

.filters-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 1rem;
}

label {
    font-size: 0.82rem;
    color: var(--text-soft);
    display: grid;
    gap: 0.33rem;
}

input,
select,
button,
.ghost-btn {
    border-radius: 12px;
    border: 1px solid #d3c9bc;
    padding: 0.58rem 0.65rem;
    font: inherit;
}

button {
    border: none;
    background: linear-gradient(135deg, #f07f4e 0%, #de5b2f 100%);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.danger-btn {
    background: linear-gradient(135deg, #c93d3d 0%, #8e1f1f 100%);
}

.ghost-btn {
    text-decoration: none;
    color: var(--text-main);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: #fff;
}

.flash {
    border-radius: 13px;
    padding: 0.75rem 0.95rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.flash.success {
    background: #e6f8ee;
    color: #0b6e46;
}

.flash.error {
    background: #ffeceb;
    color: #91211f;
}

.meta-grid {
    margin-top: 1rem;
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-grid article {
    border: 1px dashed #cebfa8;
    border-radius: 12px;
    padding: 0.7rem;
}

.meta-grid h3 {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
}

.meta-grid p {
    margin: 0;
    color: var(--text-soft);
}

.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #dfd3c2;
    padding: 0.58rem 0;
}

.actions-inline {
    display: flex;
    gap: 0.5rem;
    align-items: end;
}

.reveal {
    animation: rise 520ms ease both;
}

.stagger-1 { animation-delay: 90ms; }
.stagger-2 { animation-delay: 170ms; }
.stagger-3 { animation-delay: 240ms; }

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .split,
    .filters-grid,
    .inline-form {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;

    .dashboard-actions {
        display: grid;
        gap: 1rem;
    }

    .reset-form {
        display: grid;
        gap: 0.7rem;
        max-width: 380px;
    }
    }
}
