@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
    --ruby: #7A1F3D;
    --ruby-dark: #5A1730;
    --gold: #C89B3C;
    --cream: #FBF6EE;
    --rose: #F3E1E6;
    --charcoal: #2B2320;
    --green: #4B7355;
    --rust: #B5533C;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--cream);
    color: var(--charcoal);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.page {
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 20px 80px;
}

a {
    color: var(--ruby);
}

.flash {
    background: var(--rose);
    border: 1px solid var(--gold);
    color: var(--ruby-dark);
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}
.flash p { margin: 0; }

/* --- Auth screens --- */
.auth-screen {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-card {
    background: white;
    border: 1px solid #EADFCF;
    border-radius: 12px;
    padding: 40px 36px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 32px rgba(122, 31, 61, 0.08);
}
.auth-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.9rem;
    margin: 4px 0 8px;
    color: var(--ruby-dark);
}
.auth-sub {
    color: #746A5F;
    font-size: 0.92rem;
    margin-bottom: 24px;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-form input {
    padding: 12px 14px;
    border: 1px solid #E2D6C3;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--cream);
}
.auth-form button {
    padding: 12px 14px;
    border: none;
    border-radius: 8px;
    background: var(--ruby);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.auth-form button:hover { background: var(--ruby-dark); }
.auth-link {
    display: inline-block;
    margin-top: 18px;
    font-size: 0.85rem;
    color: #8C7B60;
    text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

/* --- Eyebrow / labels --- */
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    color: var(--gold);
    font-weight: 600;
    margin: 0 0 4px;
}

/* --- Top bar --- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 10px;
}
.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    margin: 0;
    color: var(--ruby-dark);
}
.topnav a {
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--ruby);
    margin-left: 16px;
}
.topnav a:hover { text-decoration: underline; }

/* --- Balance hero --- */
.balance-hero {
    position: relative;
    background: linear-gradient(160deg, var(--ruby) 0%, var(--ruby-dark) 100%);
    border-radius: 16px;
    padding: 40px 24px;
    text-align: center;
    overflow: hidden;
    color: var(--cream);
}
.balance-watermark {
    position: absolute;
    right: -10px;
    top: -30px;
    font-family: 'Playfair Display', serif;
    font-size: 8.5rem;
    font-weight: 700;
    color: rgba(255,255,255,0.07);
    line-height: 1;
    pointer-events: none;
}
.balance-label {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    color: var(--gold);
    margin: 0 0 10px;
    position: relative;
}
.balance-figure {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 2.6rem;
    font-weight: 600;
    margin: 0;
    position: relative;
}

/* --- Divider --- */
.divider {
    text-align: center;
    color: var(--gold);
    margin: 28px 0;
    font-size: 0.9rem;
    position: relative;
}
.divider::before, .divider::after {
    content: "";
    display: inline-block;
    width: 38%;
    height: 1px;
    background: #E2D6C3;
    vertical-align: middle;
    margin: 0 12px;
}

/* --- Ledger --- */
.ledger-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: var(--ruby-dark);
    margin: 0 0 14px;
}
.ledger-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #EADFCF;
}
.ledger-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 4px;
    border-bottom: 1px solid #EADFCF;
}
.ledger-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.ledger-desc {
    font-weight: 500;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}
.ledger-date {
    font-size: 0.78rem;
    color: #A0937E;
    margin-top: 2px;
}
.ledger-amount {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}
.ledger-amount.positive { color: var(--green); }
.ledger-amount.negative { color: var(--rust); }
.empty {
    color: #A0937E;
    font-style: italic;
    padding: 12px 4px;
}

/* --- Admin form --- */
.admin-form-card {
    background: white;
    border: 1px solid #EADFCF;
    border-radius: 12px;
    padding: 24px;
    margin-top: 28px;
}
.post-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #746A5F;
}
.field input {
    padding: 10px 12px;
    border: 1px solid #E2D6C3;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--cream);
}
.field-row {
    display: flex;
    gap: 14px;
}
.soort-toggle {
    display: flex;
    gap: 18px;
}
.radio {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    color: var(--charcoal);
}
.post-form button {
    align-self: flex-start;
    padding: 11px 20px;
    border: none;
    border-radius: 8px;
    background: var(--ruby);
    color: white;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
}
.post-form button:hover { background: var(--ruby-dark); }

.delete-form { margin: 0; }
.delete-btn {
    border: none;
    background: transparent;
    color: #C6A9A9;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 6px;
    border-radius: 6px;
}
.delete-btn:hover { color: var(--rust); background: var(--rose); }

@media (max-width: 480px) {
    .balance-figure { font-size: 2.1rem; }
    .balance-watermark { font-size: 6rem; }
}
