:root {
    --bg: #f5f3ef;
    --surface: #fffdf9;
    --ink: #24211d;
    --muted: #706a61;
    --line: #ded8cf;
    --accent: #2f6f5e;
    --accent-dark: #224d42;
    --danger: #a6423b;
    --gold: #b0833f;
    --blue: #3c5f8a;
    --shadow: 0 18px 42px rgba(48, 43, 36, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

.topbar {
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 28px clamp(18px, 4vw, 56px);
}

.top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.eyebrow {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 4px;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.05;
    margin-bottom: 0;
}

.shell {
    margin: 0 auto;
    max-width: 1240px;
    padding: 28px clamp(16px, 3vw, 32px) 56px;
}

.shell.narrow {
    max-width: 780px;
}

.button {
    align-items: center;
    background: #ebe5da;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.button:hover {
    background: #e0d7ca;
    transform: translateY(-1px);
}

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

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

.button.ghost {
    background: transparent;
    border-color: var(--line);
}

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

.button.small {
    font-size: 0.9rem;
    min-height: 36px;
    padding: 8px 12px;
}

.notice {
    background: #e8f2ec;
    border: 1px solid #b9d7c6;
    border-radius: 8px;
    color: #1e5c3d;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.notice.error {
    background: #f8e8e5;
    border-color: #e2b5ad;
    color: var(--danger);
}

.budget-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin-bottom: 22px;
}

.budget-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 18px;
}

.budget-panel span {
    color: var(--muted);
    display: block;
    font-size: 0.9rem;
}

.budget-panel strong {
    display: block;
    font-size: 1.45rem;
    margin-top: 4px;
}

.budget-panel.compact strong {
    font-size: 1.1rem;
}

.budget-panel small {
    color: var(--muted);
    display: block;
    margin-top: 4px;
}

.priority-card.essential {
    border-left: 5px solid var(--danger);
}

.priority-card.later {
    border-left: 5px solid var(--blue);
}

.filters,
.form-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.filter-drawer {
    margin-bottom: 24px;
}

.filter-toggle {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    font-weight: 800;
    gap: 12px;
    justify-content: space-between;
    list-style: none;
    min-height: 48px;
    padding: 12px 16px;
}

.filter-toggle::-webkit-details-marker {
    display: none;
}

.filter-toggle::after {
    color: var(--accent);
    content: "+";
    font-size: 1.35rem;
    line-height: 1;
}

.filter-drawer[open] .filter-toggle {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.filter-drawer[open] .filter-toggle::after {
    content: "-";
}

.filter-toggle strong {
    background: #e9f3ee;
    border-radius: 999px;
    color: #1d684d;
    font-size: 0.78rem;
    padding: 4px 9px;
}

.filters {
    align-items: end;
    border-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    padding: 16px;
}

label {
    color: var(--muted);
    display: grid;
    font-size: 0.9rem;
    font-weight: 700;
    gap: 7px;
}

input,
select,
textarea {
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    min-height: 42px;
    padding: 10px 12px;
    width: 100%;
}

textarea {
    resize: vertical;
}

.product-list {
    display: grid;
    gap: 10px;
}

.list-head,
.product-row {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 92px minmax(220px, 1.6fr) 110px 120px 90px 120px 120px 110px minmax(150px, 0.9fr);
}

.list-head {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    padding: 0 14px;
    text-transform: uppercase;
}

.product-row {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-height: 112px;
    padding: 12px 14px;
}

.image-wrap {
    background: #e8e1d7;
    border-radius: 8px;
    height: 86px;
    overflow: hidden;
    width: 92px;
}

.image-wrap img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.image-placeholder {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-weight: 700;
    height: 100%;
    justify-content: center;
}

.status,
.priority {
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 4px 9px;
    white-space: nowrap;
}

.status.wishlist {
    background: #e9f3ee;
    color: #1d684d;
}

.status.gekocht {
    background: #eef0f7;
    color: #33426e;
}

.status.afgewezen {
    background: #f7e5e0;
    color: var(--danger);
}

.status.misschien {
    background: #fbf1dc;
    color: #845d1d;
}

.priority.essentieel {
    background: #f7e5e0;
    color: var(--danger);
}

.priority.belangrijk {
    background: #fbf1dc;
    color: #845d1d;
}

.priority.later {
    background: #e8eef5;
    color: var(--blue);
}

.priority.twijfel {
    background: #ece7f1;
    color: #66507a;
}

.product-main h2 {
    font-size: 1.05rem;
    line-height: 1.3;
    margin-bottom: 5px;
}

.product-main p {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.price {
    color: var(--gold);
    font-size: 1rem;
    font-weight: 850;
    margin: 0;
}

.list-cell small {
    color: var(--muted);
    display: block;
    font-size: 0.78rem;
    margin-top: 2px;
}

.row-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.row-actions form {
    margin: 0;
}

.form-panel {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.manage-panel {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-top: 18px;
    padding: 18px 22px;
}

.manage-panel h2 {
    font-size: 1.05rem;
    margin-bottom: 0;
}

.manage-panel form {
    margin: 0;
}

.two-columns {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.empty-state {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 40px 22px;
    text-align: center;
}

@media (max-width: 700px) {
    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .top-actions {
        justify-content: stretch;
    }

    .top-actions .button {
        flex: 1 1 150px;
    }

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

    .manage-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .list-head {
        display: none;
    }

    .product-row {
        align-items: start;
        grid-template-columns: 86px 1fr;
    }

    .image-wrap {
        height: 86px;
        width: 86px;
    }

    .product-main {
        align-self: center;
    }

    .list-cell,
    .row-actions {
        grid-column: 1 / -1;
    }

    .list-cell {
        align-items: center;
        border-top: 1px solid var(--line);
        display: flex;
        justify-content: space-between;
        padding-top: 9px;
    }

    .list-cell::before {
        color: var(--muted);
        content: attr(data-label);
        font-weight: 800;
    }

    .row-actions {
        justify-content: stretch;
    }

    .row-actions .button,
    .row-actions form {
        width: 100%;
    }
}
