:root {
    --bg: #f7f3eb;
    --panel: rgba(255, 252, 246, 0.94);
    --panel-strong: #fffdf8;
    --ink: #2f241f;
    --muted: #77675e;
    --line: rgba(108, 86, 73, 0.18);
    --accent: #bf5a36;
    --accent-dark: #8f3c21;
    --blue-soft: #d9e7f2;
    --rose-soft: #f1dde3;
    --shadow: 0 24px 60px rgba(73, 43, 28, 0.12);
    --radius: 22px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(191, 90, 54, 0.16), transparent 30%),
        radial-gradient(circle at bottom right, rgba(121, 154, 181, 0.18), transparent 28%),
        var(--bg);
    color: var(--ink);
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

#auth-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-box,
#modal,
header,
.week-row,
.week-header {
    backdrop-filter: blur(12px);
}

.auth-box {
    background: var(--panel);
    padding: 2.4rem;
    border-radius: 28px;
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 420px;
    width: min(100%, 420px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.auth-box h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    margin-bottom: 0.7rem;
}

.auth-box p {
    margin-bottom: 1rem;
    color: var(--muted);
}

.auth-box input,
#modal input,
#modal textarea,
#modal select {
    width: 100%;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    font-size: 0.95rem;
    margin-top: 0.35rem;
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink);
}

.auth-box button,
.header-button,
.btn-primary,
.btn-danger,
.btn-secondary {
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.auth-box button,
.btn-primary,
.header-button {
    background: var(--accent);
    color: #fff8f4;
}

.auth-box button:hover,
.btn-primary:hover,
.header-button:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.auth-box button {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
}

.error {
    color: #b3332f;
    margin-top: 0.6rem;
    font-size: 0.92rem;
}

header {
    max-width: 1260px;
    margin: 1.2rem auto 0;
    padding: 1.2rem 1.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: var(--panel);
    border-radius: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

header h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    line-height: 1;
}

.subtitle {
    margin-top: 0.3rem;
    color: var(--muted);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.header-button {
    padding: 0.9rem 1.35rem;
    font-size: 0.95rem;
    white-space: nowrap;
}

#calendar-grid {
    max-width: 1260px;
    margin: 1rem auto 2rem;
    padding: 0 0.35rem 1.4rem;
}

.week-row,
.week-header {
    display: grid;
    grid-template-columns: 170px repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.week-header {
    padding: 0 0.35rem;
}

.week-header span {
    text-align: center;
    font-size: 0.78rem;
    color: var(--muted);
    padding: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.week-label {
    padding: 0.95rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
    box-shadow: var(--shadow);
}

.week-range {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--muted);
}

.week-papa {
    background: linear-gradient(180deg, rgba(217, 231, 242, 0.95), rgba(217, 231, 242, 0.72));
    border-left: 5px solid #5a88b5;
}

.week-mama {
    background: linear-gradient(180deg, rgba(241, 221, 227, 0.95), rgba(241, 221, 227, 0.72));
    border-left: 5px solid #bb6c88;
}

.week-label .parent-tag {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.8;
}

.day-cell {
    background: var(--panel-strong);
    border: 1px solid rgba(123, 99, 84, 0.12);
    min-height: 132px;
    padding: 0.45rem;
    cursor: pointer;
    border-radius: 18px;
    position: relative;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    box-shadow: 0 14px 28px rgba(73, 43, 28, 0.04);
}

.day-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(73, 43, 28, 0.08);
    background: #ffffff;
}

.day-cell.weekend {
    background: rgba(251, 246, 240, 0.98);
}

.day-number {
    font-size: 0.76rem;
    color: var(--muted);
    padding: 0.1rem 0.2rem 0.45rem;
    font-weight: 700;
}

.activity-block {
    width: 100%;
    text-align: left;
    font-size: 0.76rem;
    padding: 0.45rem 0.55rem;
    border-radius: 12px;
    margin: 0.2rem 0;
    border: none;
    border-left: 6px solid transparent;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
}

.activity-block.status-gepland {
    opacity: 0.82;
}

.activity-block.status-geboekt {
    opacity: 0.92;
}

.activity-block.status-betaald {
    opacity: 1;
}

#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(53, 35, 26, 0.42);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 1rem;
}

#modal {
    background: var(--panel);
    border-radius: 28px;
    padding: 1.6rem;
    width: min(100%, 560px);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 28px 80px rgba(40, 24, 17, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.64);
}

#modal h2 {
    margin-bottom: 1rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.55rem;
}

#modal label {
    display: block;
    margin-bottom: 0.95rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
}

.date-range-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.color-field {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 0.35rem;
}

.color-field input[type="color"] {
    width: 64px;
    min-width: 64px;
    height: 44px;
    padding: 0.2rem;
    border-radius: 12px;
    cursor: pointer;
}

#color-value {
    color: var(--muted);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#selected-days-display {
    margin: 1rem 0;
    font-size: 0.9rem;
    padding: 0.95rem 1rem;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 16px;
    border: 1px solid rgba(123, 99, 84, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 0.6rem;
    margin-top: 1.2rem;
    flex-wrap: wrap;
}

.btn-primary,
.btn-danger,
.btn-secondary {
    padding: 0.75rem 1.25rem;
    font-size: 0.94rem;
}

.btn-danger {
    background: #a93f35;
    color: #fff7f2;
}

.btn-danger:hover {
    background: #872e27;
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(117, 100, 89, 0.14);
    color: var(--ink);
}

.btn-secondary:hover {
    background: rgba(117, 100, 89, 0.22);
    transform: translateY(-1px);
}

@media (max-width: 900px) {
    header {
        margin: 0.75rem;
    }

    #calendar-grid {
        margin: 0.9rem 0.4rem 1.5rem;
        overflow-x: auto;
    }

    .week-row,
    .week-header {
        min-width: 820px;
    }
}

@media (max-width: 640px) {
    #auth-screen {
        padding: 1rem;
    }

    header {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }

    .header-button {
        width: 100%;
    }

    .date-range-fields {
        grid-template-columns: 1fr;
    }

    .modal-buttons > * {
        flex: 1 1 100%;
    }
}
