:root {
    --bg: #fbf7f4;
    --surface: #ffffff;
    --surface-soft: #f6ebe8;
    --ink: #22201f;
    --muted: #746b67;
    --line: #eadbd6;
    --peony: #c9556b;
    --peony-dark: #9f354d;
    --sage: #1f6b5a;
    --mint: #dcebe5;
    --gold: #b8863b;
    --shadow: 0 18px 50px rgba(57, 38, 34, 0.09);
}

* {
    box-sizing: border-box;
}

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

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 268px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px;
    background: #fffaf8;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    color: #fff;
    background: var(--peony);
    font-family: Georgia, serif;
    font-size: 24px;
    box-shadow: 0 10px 22px rgba(201, 85, 107, 0.26);
}

.brand strong {
    display: block;
    font-family: Georgia, serif;
    font-size: 26px;
    line-height: 1;
}

.brand small,
small,
.hint,
.muted {
    color: var(--muted);
}

.nav {
    display: grid;
    gap: 6px;
}

.nav a,
.ghost-button {
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    text-align: left;
}

.nav a.active,
.nav a:hover,
.ghost-button:hover {
    color: var(--ink);
    background: var(--surface-soft);
}

.logout-form {
    margin-top: auto;
}

.content {
    min-width: 0;
    padding: 28px;
}

.page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.page-header h1,
.login-card h1 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1;
    letter-spacing: 0;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--peony-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.flash,
.notice {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #bee0d0;
    border-radius: 8px;
    color: #174d3f;
    background: #edf8f3;
}

.flash.error {
    border-color: #efc1c7;
    color: #8d2437;
    background: #fff0f2;
}

.login-panel {
    min-height: calc(100vh - 56px);
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 480px);
    gap: 24px;
    align-items: stretch;
}

.peony-photo {
    min-height: 520px;
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(34, 32, 31, 0.18), rgba(34, 32, 31, 0)),
        url("peony-mark.svg") center / cover no-repeat;
    box-shadow: var(--shadow);
}

.login-card,
.panel,
.metrics article {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.login-card {
    padding: 34px;
    align-self: center;
}

.stack {
    display: grid;
    gap: 14px;
}

.stack label,
.compact-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 11px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

textarea {
    resize: vertical;
}

select[multiple] {
    min-height: 154px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--peony);
    box-shadow: 0 0 0 3px rgba(201, 85, 107, 0.14);
}

.primary-button,
.secondary-button,
.tiny-button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    font-weight: 800;
}

.primary-button {
    color: #fff;
    background: var(--peony);
}

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

.secondary-button {
    color: #fff;
    background: var(--sage);
}

.secondary-button:hover {
    background: #185447;
}

.tiny-button {
    min-height: 32px;
    padding: 7px 10px;
    color: var(--sage);
    background: var(--mint);
    font-size: 12px;
}

.muted-button {
    color: var(--muted);
    background: #f2eee9;
}

.icon-button {
    width: 34px;
    min-height: 34px;
    color: #fff;
    background: var(--sage);
}

.date-switcher,
.inline-form,
.row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-switcher input {
    width: auto;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metrics article {
    padding: 18px;
}

.metrics span {
    display: block;
    color: var(--peony);
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
}

.metrics p {
    margin: 7px 0 0;
    color: var(--muted);
}

.dashboard-grid,
.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 18px;
    margin-bottom: 18px;
}

.settings-grid {
    grid-template-columns: minmax(280px, 430px) minmax(0, 1fr);
}

.panel {
    min-width: 0;
    padding: 20px;
}

.panel.wide {
    grid-column: span 1;
}

.panel h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pill {
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--gold);
    background: #fbf1df;
    font-size: 12px;
    font-weight: 800;
}

.schedule-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.master-column {
    min-height: 220px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdfc;
}

.master-column h3 {
    margin: 0;
}

.booking {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
    border-left: 4px solid var(--peony);
    border-radius: 8px;
    background: #fff4f5;
}

.booking.status-done {
    border-left-color: var(--sage);
    background: #eef8f4;
}

.booking.status-cancelled,
.booking.status-no_show {
    border-left-color: #a8a19c;
    background: #f3f0ed;
    opacity: 0.72;
}

.booking div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.booking p,
.request-list p {
    margin: 0;
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.slot-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.slot-list span {
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--sage);
    background: var(--mint);
    font-weight: 800;
}

.request-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.request-list article {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdfc;
}

.request-list article > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.row-actions {
    flex-wrap: wrap;
    margin-top: 10px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.checkbox-grid input {
    width: auto;
    min-height: 0;
}

.table-panel {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.disabled-row {
    opacity: 0.5;
}

.empty {
    color: var(--muted);
    font-style: italic;
}

.bot-flow {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.bot-flow span {
    padding: 12px;
    border-left: 4px solid var(--sage);
    border-radius: 8px;
    background: #eef8f4;
    font-weight: 800;
}

@media (max-width: 980px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 16px;
    }

    .nav {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        overflow-x: auto;
    }

    .nav a {
        text-align: center;
        white-space: nowrap;
    }

    .logout-form {
        margin-top: 0;
    }

    .content {
        padding: 18px;
    }

    .dashboard-grid,
    .settings-grid,
    .login-panel {
        grid-template-columns: 1fr;
    }

    .peony-photo {
        min-height: 280px;
    }
}

@media (max-width: 680px) {
    .page-header,
    .date-switcher,
    .split,
    .metrics,
    .booking div:first-child {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .metrics {
        display: grid;
    }

    .nav {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }

    .login-card,
    .panel {
        padding: 16px;
    }

    .checkbox-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .row-actions {
        align-items: stretch;
    }
}
