* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: #f4f6f8;
    color: #263238;
    font-family: Arial, sans-serif;
}

h1, h2, h3 { margin-top: 0; }

h2 {
    margin-bottom: 1em;
}

.wrap {
    max-width: 80%;
}

header {
    margin-bottom: 2em;
}

.container {
    margin: auto;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22vw;
    gap: 1em;
    align-items: start;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    transition: none;
}

.card:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.month-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.month-navigation h1 {
    margin: 0;
    font-size: 1.6rem;
}

.button, button {
    display: inline-block;
    border: 0;
    border-radius: 6px;
    padding: 10px 14px;
    background: #1976d2;
    color: white;
    cursor: pointer;
    text-decoration: none;
    font-size: .95rem;
}

.button:hover, button:hover { background: #125ca1; }

.button.secondary { background: #607d8b; }

button.danger {
    background: #c62828;
    padding: 6px 9px;
    font-size: .8rem;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 1px solid #ddd;
    border-left: 1px solid #ddd;
}

.weekday, .day {
    min-width: 0;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.weekday {
    padding: 10px 6px;
    background: #eceff1;
    text-align: center;
    font-weight: bold;
}

.day {
    min-height: 115px;
    padding: 7px;
}

.day.other-month {
    background: #fafafa;
    color: #aaa;
}

.day.today { background: #fff8e1; }

.date-number {
    font-weight: bold;
    margin-bottom: 6px;
}

.booking {
    display: block;
    margin: 3px 0;
    padding: 4px 5px;
    overflow: hidden;
    border-radius: 4px;
    background: #bbdefb;
    color: #0d47a1;
    font-size: .78rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

form {
    padding: 1em;
}

div.booking-item form {
    padding: 0;
}

label {
    display: block;
    margin: 10px 0 4px;
    font-weight: bold;
    font-size: .9rem;
}

input, select, textarea {
    width: 100%;
    padding: 9px;
    border: 1px solid #bbb;
    border-radius: 5px;
    font: inherit;
    background: var(--cream);
}

textarea {
    min-height: 70px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-row.three {
    grid-template-columns: 100px 1fr 1fr;
}

.form-section {
    border-top: 1px solid #ddd;
    margin-top: 18px;
    padding-top: 14px;
}

.new-customer {
    margin-top: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
}

.new-customer summary {
    cursor: pointer;
    font-weight: bold;
}

.new-customer-content {
    padding-top: 8px;
}

.notice {
    padding: 12px;
    margin-bottom: 18px;
    border-radius: 6px;
    background: #e8f5e9;
    color: #1b5e20;
}

.notice.error {
    background: #ffebee;
    color: #b71c1c;
}

.booking-list {
    display: grid;
    gap: 10px;
}

.booking-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.booking-item small { color: #607d8b; }

.search-box { position: relative; }

#customer-results {
    position: absolute;
    z-index: 10;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .15);
}

.customer-result {
    padding: 9px;
    cursor: pointer;
}

.customer-result:hover { background: #e3f2fd; }

.selected-customer {
    display: none;
    margin-top: 6px;
    padding: 7px;
    border-radius: 5px;
    background: #e8f5e9;
    color: #1b5e20;
    font-size: .9rem;
}

@media (max-width: 900px) {
    body { padding: 12px; }

    .layout { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .day {
        min-height: 90px;
        padding: 4px;
    }

    .booking { font-size: .68rem; }

    .form-row,
    .form-row.three {
        grid-template-columns: 1fr;
    }

    .month-navigation h1 { font-size: 1.2rem; }

    .wrap {
        max-width: inherit;
        padding: 0;
    }

    div.month-navigation a.button {
        font-size: 75%;
        padding: 0.5em;
    }

    .card {
        padding: 1em;
    }

    .calendar {
        font-size: 75%;
        width: 200%;
    }

    div.overflow {
        width: 100%;
        overflow: auto;
    }
}