* {
    box-sizing: border-box;
}

:root {
    --bg: #f4f7fa;
    --surface: #ffffff;
    --surface-soft: #f7f9fb;
    --text: #1f2933;
    --muted: #66727d;
    --border: #d9e0e6;
    --primary: #155b8a;
    --primary-dark: #0f466b;
    --primary-soft: #eaf3f9;
    --success: #25683f;
    --success-soft: #edf8f0;
    --success-accent: #8bc49d;
    --warning: #7b5b12;
    --warning-soft: #fff4cc;
    --warning-accent: #e3c66f;
    --danger: #9b2c2c;
    --danger-soft: #fdecec;
    --shadow: 0 14px 34px rgba(31, 41, 51, .08);
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-dark);
}

.wrap {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.hero {
    background: transparent;
}

.hero-inner {
    padding: 1.45rem 0 .8rem;
}

.hero img {
    display: block;
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 1.25rem;
}

.page {
    padding: 1.7rem 0 3.5rem;
}

.page-intro {
    margin-bottom: 1.6rem;
}

.eyebrow,
.card-kicker {
    margin: 0 0 .35rem;
    color: var(--primary);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1,
h2 {
    line-height: 1.18;
}

h1 {
    margin: 0 0 .9rem;
    font-size: clamp(1.85rem, 4vw, 2.8rem);
    letter-spacing: -.025em;
}

h2 {
    margin: 0;
}

.intro {
    margin: 0;
    color: #43515d;
    font-size: 1.04rem;
}

.flash,
.notice,
.error {
    padding: 1rem 1.1rem;
    border-radius: .8rem;
    margin: 1rem 0 1.5rem;
    border: 1px solid transparent;
}

.flash {
    background: var(--success-soft);
    border-color: #c6e3cf;
}

.notice {
    background: var(--primary-soft);
    border-color: #c9dfed;
}

.error {
    background: var(--danger-soft);
    border-color: #efcaca;
    color: #7c2020;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.4rem;
    align-items: start;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.15rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.card-heading {
    padding: 1.2rem 1.5rem 1.05rem;
    background: linear-gradient(180deg, #fff, #f7f9fb);
    border-bottom: 1px solid var(--border);
}

.card-kicker {
    padding-left: .05rem;
}

.card-heading h2 {
    font-size: 1.18rem;
}

.slot-list {
    padding: .25rem 0;
}

.slot {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) auto;
    gap: .9rem;
    align-items: center;
    min-height: 70px;
    padding: .9rem 1.2rem;
    border-top: 1px solid #edf0f2;
    transition: background .15s ease;
}

.slot:first-child {
    border-top: 0;
}

.slot-free {
    background: var(--success-soft);
    box-shadow: inset 4px 0 0 var(--success-accent);
}

.slot-locked {
    background: var(--warning-soft);
    box-shadow: inset 4px 0 0 var(--warning-accent);
}

.slot-filled {
    background: var(--surface);
}

.slot-time {
    font-weight: 800;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.slot-name {
    min-width: 0;
}

.status {
    display: inline-block;
}

.status-open {
    color: var(--success);
    font-weight: 750;
}

.status-locked {
    color: var(--warning);
    font-weight: 700;
}

.status-filled {
    color: #394651;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: .7rem;
    padding: .68rem 1rem;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.button:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(21, 91, 138, .18);
}

.button.secondary {
    background: #5f6b75;
}

.button.secondary:hover {
    background: #4d5861;
}

.button.danger {
    background: var(--danger);
}

.button.danger:hover {
    background: #7e2424;
}

.footer-panel {
    margin-top: 1.6rem;
    padding: 1rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: .9rem;
    background: rgba(255, 255, 255, .72);
}

.footer-panel p {
    margin: 0 0 .2rem;
    color: #4b5964;
}

.form-page {
    max-width: 820px;
}

.form-card {
    max-width: 720px;
    margin: 0 auto;
    background: var(--surface);
    padding: clamp(1.25rem, 4vw, 2rem);
    border: 1px solid var(--border);
    border-radius: 1.15rem;
    box-shadow: var(--shadow);
}

.selection-summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin: 1rem 0 .8rem;
    padding: 1rem 1.1rem;
    border-radius: .85rem;
    background: var(--primary-soft);
    border: 1px solid #c9dfed;
}

.selection-summary strong {
    color: #173d56;
}

.selection-summary span {
    white-space: nowrap;
    font-weight: 800;
}

.field {
    margin: 1.15rem 0;
}

.field label {
    display: block;
    font-weight: 750;
    margin-bottom: .4rem;
}

.field input,
.field select {
    width: 100%;
    min-height: 46px;
    padding: .78rem .85rem;
    border: 1px solid #aeb8c1;
    border-radius: .65rem;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.field input:focus,
.field select:focus {
    outline: 3px solid rgba(21, 91, 138, .13);
    border-color: var(--primary);
}

.field-help {
    margin: .35rem 0 0;
    color: var(--muted);
    font-size: .9rem;
}

.actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: 1.35rem;
}

.danger-zone {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-top: 2rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--border);
}

.danger-zone p {
    margin: 0;
}

.delete-confirmation {
    min-width: 250px;
}

.delete-confirmation summary {
    list-style: none;
    width: 100%;
}

.delete-confirmation summary::-webkit-details-marker {
    display: none;
}

.delete-confirmation[open] summary {
    margin-bottom: .75rem;
}

.delete-confirmation-panel {
    padding: 1rem;
    border: 1px solid #efcaca;
    border-radius: .85rem;
    background: var(--danger-soft);
}

.delete-confirmation-actions {
    margin-top: .9rem;
}

.muted {
    color: var(--muted);
    font-size: .94rem;
}

@media (max-width: 760px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .page {
        padding-top: 1.2rem;
    }

    .hero-inner {
        padding: 1rem 0 .55rem;
    }

    .hero img {
        border-radius: 1rem;
    }

    .slot {
        grid-template-columns: 88px minmax(0, 1fr) auto;
        padding: .85rem 1rem;
    }
}

@media (max-width: 560px) {
    .wrap {
        width: min(100% - 1rem, 1120px);
    }

    .hero img {
        max-height: 190px;
    }

    .card-heading {
        padding-left: 1.2rem;
        padding-right: 1.2rem;
    }

    .slot {
        grid-template-columns: 1fr auto;
        gap: .4rem .7rem;
    }

    .slot-time {
        grid-column: 1;
    }

    .slot-name {
        grid-column: 1;
    }

    .slot-action {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
    }

    .selection-summary,
    .danger-zone {
        align-items: flex-start;
        flex-direction: column;
    }

    .delete-confirmation {
        width: 100%;
        min-width: 0;
    }

    .actions .button {
        flex: 1 1 100%;
    }
}
