:root {
    --forest: #17221d;
    --forest-soft: #26352e;
    --cream: #f5f0e6;
    --paper: #fbfaf7;
    --white: #ffffff;
    --gold: #b18a4b;
    --gold-soft: #eadfc9;
    --ink: #18211d;
    --muted: #667069;
    --line: #e5e1d8;
    --danger: #a53a3a;
    --success: #236444;
    --warning: #8a6422;
    --shadow: 0 24px 80px rgba(23, 34, 29, .11);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

h1, h2, h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    letter-spacing: -.025em;
}
p { line-height: 1.65; }
input, textarea, select {
    width: 100%;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--white);
    padding: 12px 13px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(177, 138, 75, .12);
}
input[readonly] { background: #f2f0eb; color: #59615c; }
label {
    display: grid;
    gap: 7px;
    color: #4f5953;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .035em;
}
code {
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(23, 34, 29, .08);
}

.eyebrow, .step-label {
    display: inline-block;
    color: var(--gold);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 11px 19px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .065em;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .62; transform: none; }
.button-primary {
    color: var(--white);
    background: var(--forest);
    box-shadow: 0 12px 28px rgba(23, 34, 29, .16);
}
.button-primary:hover { background: var(--forest-soft); box-shadow: 0 16px 34px rgba(23, 34, 29, .22); }
.button-secondary { color: var(--forest); border-color: var(--line); background: var(--white); }
.button-secondary:hover { border-color: #c8c1b4; }
.button-secondary.danger { color: var(--danger); }
.button-quiet { min-height: 38px; padding: 8px 14px; color: #455049; border-color: var(--line); background: transparent; }
.button-wide { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.text-button {
    appearance: none;
    border: 0;
    padding: 3px;
    color: var(--forest);
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.text-button.danger { color: var(--danger); }
.icon-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--forest);
    background: var(--white);
    cursor: pointer;
    font-size: 18px;
}
.icon-button:disabled { cursor: default; opacity: .3; }

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}
.wordmark-mark {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(177, 138, 75, .5);
    border-radius: 50%;
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 13px;
    letter-spacing: .04em;
}
.wordmark strong, .wordmark small { display: block; }
.wordmark strong { font-family: Georgia, serif; font-size: 17px; font-weight: 500; }
.wordmark small { margin-top: 2px; color: var(--muted); font-size: 9px; letter-spacing: .11em; text-transform: uppercase; }

/* Client experience */
.client-page { min-height: 100vh; overflow-x: hidden; }
.ambient {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(1px);
}
.ambient-one {
    width: 520px;
    height: 520px;
    top: -290px;
    right: -210px;
    background: radial-gradient(circle, rgba(221, 198, 155, .32), rgba(221, 198, 155, 0) 70%);
}
.ambient-two {
    width: 500px;
    height: 500px;
    bottom: -330px;
    left: -220px;
    background: radial-gradient(circle, rgba(56, 89, 72, .16), rgba(56, 89, 72, 0) 72%);
}
.client-header {
    display: flex;
    width: min(1180px, calc(100% - 32px));
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    padding: 24px 0;
}
.private-label {
    display: none;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.private-label span { color: var(--gold); }
.client-main {
    width: min(1180px, calc(100% - 28px));
    min-height: calc(100vh - 190px);
    margin: 0 auto;
    padding: 28px 0 60px;
}
.gate-card {
    max-width: 760px;
    margin: clamp(40px, 9vh, 110px) auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,244,235,.94)),
        var(--white);
    box-shadow: var(--shadow);
    padding: clamp(30px, 6vw, 70px);
    text-align: center;
}
.gate-card h1 {
    max-width: 650px;
    margin: 12px auto 18px;
    font-size: clamp(35px, 6vw, 62px);
    line-height: 1.04;
}
.gate-card p { max-width: 570px; margin: 0 auto 28px; color: var(--muted); }
.client-intro {
    display: grid;
    gap: 20px;
    align-items: end;
    margin: 20px 0 38px;
}
.client-intro h1 {
    max-width: 760px;
    margin-top: 10px;
    font-size: clamp(38px, 6.4vw, 72px);
    line-height: 1.02;
}
.client-intro > p { max-width: 470px; margin: 0; color: var(--muted); font-size: 15px; }
.notice {
    margin: 0 0 18px;
    border: 1px solid var(--gold-soft);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    color: #6a552f;
    background: #fff9ed;
    font-size: 13px;
}
.notice.is-error { color: #7b2929; border-color: #e6c6c6; background: #fff4f4; }
.management-card, .scheduler {
    border: 1px solid rgba(218, 211, 198, .9);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .9);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.management-card {
    display: grid;
    gap: 28px;
    padding: clamp(26px, 5vw, 54px);
}
.management-copy h2 { margin: 8px 0 6px; font-size: clamp(30px, 4vw, 47px); }
.management-copy > p { margin: 0; color: var(--muted); }
.booking-summary {
    display: grid;
    gap: 12px;
    margin: 26px 0 0;
}
.booking-summary div { padding: 14px 0; border-top: 1px solid var(--line); }
.booking-summary dt { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.booking-summary dd { margin: 7px 0 0; font-weight: 700; }
.management-actions { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.cutoff-note { max-width: 350px; margin: 0; color: var(--muted); font-size: 13px; }
.scheduler { display: grid; }
.calendar-panel, .details-panel { padding: clamp(22px, 4vw, 42px); }
.calendar-panel {
    background:
        linear-gradient(rgba(255,255,255,.87), rgba(255,255,255,.95)),
        radial-gradient(circle at top left, #efe3c9, transparent 60%);
}
.details-panel { border-top: 1px solid var(--line); }
.section-heading { display: grid; gap: 16px; }
.section-heading h2, .details-panel h2 { margin-top: 6px; font-size: 27px; }
.timezone-field { max-width: 240px; }
.timezone-field small { color: var(--muted); font-size: 10px; font-weight: 500; }
.calendar-toolbar {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 12px;
    margin: 32px 0 18px;
}
.calendar-toolbar h3 { text-align: center; font-size: 22px; }
.weekday-row, .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}
.weekday-row { margin-bottom: 8px; }
.weekday-row span {
    padding: 5px 0;
    color: #8a918d;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .1em;
    text-align: center;
    text-transform: uppercase;
}
.calendar-day {
    position: relative;
    display: grid;
    min-width: 0;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #b0b5b1;
    background: transparent;
    font-size: 12px;
}
button.calendar-day { color: var(--forest); border-color: #dcd6ca; background: var(--white); cursor: pointer; font-weight: 800; }
button.calendar-day::after {
    position: absolute;
    width: 5px;
    height: 5px;
    right: 7px;
    bottom: 6px;
    border-radius: 50%;
    background: var(--gold);
    content: "";
}
button.calendar-day:hover, button.calendar-day.is-selected {
    color: var(--white);
    border-color: var(--forest);
    background: var(--forest);
}
button.calendar-day.is-selected::after { background: #e4c98f; }
.calendar-day.outside { opacity: .28; }
.calendar-legend { display: flex; align-items: center; gap: 8px; margin: 17px 0 0; color: var(--muted); font-size: 11px; }
.calendar-legend span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
#selected-date-copy { margin: 8px 0 15px; color: var(--muted); font-size: 13px; }
.slot-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.slot-button {
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--forest);
    background: var(--white);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}
.slot-button:hover, .slot-button.is-selected { color: var(--white); border-color: var(--forest); background: var(--forest); }
.booking-form { display: grid; gap: 19px; margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
.form-grid, .locked-fields { display: grid; gap: 13px; }
.form-heading h2 { margin-top: 6px; }
.full-field { grid-column: 1 / -1; }
.consent-field {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}
.consent-field input { width: 17px; height: 17px; margin: 0; accent-color: var(--forest); }
.form-error { margin: 0; color: var(--danger); font-size: 12px; font-weight: 700; }
.reschedule-actions { margin-top: 30px; padding-top: 25px; border-top: 1px solid var(--line); }
.reschedule-actions > p { color: var(--muted); font-size: 13px; }
.client-footer {
    display: flex;
    width: min(1180px, calc(100% - 32px));
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px 22px;
    margin: 0 auto;
    border-top: 1px solid var(--line);
    padding: 24px 0 30px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Admin */
.admin-page { min-height: 100vh; background: #f3f1ec; }
.admin-header {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    align-items: center;
    gap: 22px;
    border-bottom: 1px solid var(--line);
    padding: 14px clamp(16px, 4vw, 48px);
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(14px);
}
.admin-brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.admin-brand strong, .admin-brand small { display: block; }
.admin-brand strong { font-family: Georgia, serif; font-size: 17px; }
.admin-brand small { margin-top: 2px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.admin-header nav { display: none; gap: 17px; }
.admin-header nav a { color: var(--muted); font-size: 11px; font-weight: 800; text-decoration: none; }
.admin-main { width: min(1400px, calc(100% - 28px)); margin: 0 auto; padding: 38px 0 80px; }
.admin-title { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.admin-title h1 { margin-top: 8px; font-size: clamp(37px, 5vw, 58px); }
.alert {
    margin: 0 0 17px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    font-size: 13px;
    line-height: 1.5;
}
.alert-success { color: var(--success); border-color: #bcd8ca; background: #eef9f3; }
.alert-error { color: var(--danger); border-color: #e6c6c6; background: #fff4f4; }
.alert-warning { color: var(--warning); border-color: #e7d6ad; background: #fff9e9; }
.new-link-card {
    display: grid;
    gap: 17px;
    margin-bottom: 22px;
    border-radius: var(--radius-md);
    padding: 24px;
    color: var(--white);
    background: var(--forest);
    box-shadow: 0 18px 45px rgba(23, 34, 29, .18);
}
.new-link-card h2 { margin-top: 6px; font-size: 27px; }
.new-link-card p { margin: 0; color: #bdc6c0; font-size: 11px; }
.copy-row { display: grid; gap: 9px; }
.copy-row input { border-color: rgba(255,255,255,.18); color: #fff; background: rgba(255,255,255,.08); }
.copy-row .button-primary { color: var(--forest); background: #ddc48d; }
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.metric-grid article {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 18px;
    background: var(--white);
}
.metric-grid span { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.metric-grid strong { display: block; margin-top: 8px; font-family: Georgia, serif; font-size: 29px; font-weight: 500; }
.admin-section {
    margin-top: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: clamp(18px, 3vw, 30px);
    background: var(--white);
}
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-title h2 { margin-top: 6px; font-size: 31px; }
.section-title > p { max-width: 400px; margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.inline-create-form, .filter-form {
    display: grid;
    gap: 11px;
    align-items: end;
    margin-bottom: 23px;
    border-radius: var(--radius-sm);
    padding: 16px;
    background: #f7f5f0;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: #7b837e; font-size: 9px; letter-spacing: .1em; text-align: left; text-transform: uppercase; }
th, td { border-bottom: 1px solid var(--line); padding: 13px 10px; vertical-align: top; }
td strong, td small { display: block; }
td small { margin-top: 4px; color: var(--muted); }
.action-cell { display: flex; flex-wrap: wrap; gap: 7px 12px; }
.status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 8px;
    color: #56605a;
    background: #eceeea;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.status-confirmed, .status-active, .status-open, .status-sent { color: #21603f; background: #e5f3eb; }
.status-cancelled, .status-revoked, .status-failed { color: #8f3030; background: #fae7e7; }
.status-booked { color: #685124; background: #f5edd9; }
.status-blocked, .status-skipped { color: #626865; background: #ebedeb; }
.empty-cell, .empty-state { padding: 25px; color: var(--muted); text-align: center; }
.slot-admin-list, .booking-admin-list { display: grid; gap: 10px; }
.slot-admin-card, .booking-admin-card {
    display: grid;
    gap: 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
}
.slot-admin-card h3, .booking-admin-card h3 { margin-top: 8px; font-family: inherit; font-size: 15px; font-weight: 800; letter-spacing: 0; }
.slot-admin-card p, .booking-admin-card p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.slot-card-actions, .booking-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 13px; }
details { position: relative; }
summary { color: var(--forest); cursor: pointer; font-size: 12px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
details form {
    display: grid;
    z-index: 2;
    width: min(320px, 80vw);
    gap: 10px;
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
    background: var(--white);
    box-shadow: 0 15px 40px rgba(23, 34, 29, .12);
}
.locked-copy { color: var(--muted); font-size: 11px; }
.booking-admin-card dl { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin: 0; }
.booking-admin-card dl div { min-width: 0; }
.booking-admin-card dt { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.booking-admin-card dd { margin: 5px 0 0; overflow-wrap: anywhere; font-size: 11px; line-height: 1.45; }

/* Login */
.admin-login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at 20% 10%, rgba(177,138,75,.21), transparent 31%),
        radial-gradient(circle at 80% 90%, rgba(61,89,74,.21), transparent 31%),
        var(--paper);
}
.login-card {
    width: min(440px, 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: clamp(28px, 6vw, 48px);
    background: rgba(255,255,255,.95);
    box-shadow: var(--shadow);
}
.login-card .wordmark-mark { margin-bottom: 28px; }
.login-card h1 { margin: 8px 0 10px; font-size: 44px; }
.login-card > p { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.login-card form { display: grid; gap: 17px; }

@media (min-width: 600px) {
    .private-label { display: inline-flex; gap: 6px; }
    .client-main { width: min(1180px, calc(100% - 48px)); }
    .weekday-row, .calendar-grid { gap: 8px; }
    .calendar-day { border-radius: 13px; font-size: 14px; }
    .form-grid, .locked-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .booking-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .copy-row { grid-template-columns: 1fr auto; }
    .metric-grid { grid-template-columns: repeat(4, 1fr); }
    .inline-create-form { grid-template-columns: repeat(2, minmax(0,1fr)) auto; }
    .slot-create-form { grid-template-columns: 1.4fr 1fr .55fr auto; }
    .filter-form { grid-template-columns: 1fr 180px auto; }
}

@media (min-width: 900px) {
    .client-intro { grid-template-columns: 1.5fr .7fr; }
    .management-card { grid-template-columns: 1fr auto; }
    .scheduler { grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr); }
    .details-panel { border-top: 0; border-left: 1px solid var(--line); }
    .section-heading { grid-template-columns: 1fr minmax(190px, .56fr); align-items: start; }
    .calendar-day { border-radius: 15px; font-size: 15px; }
    .calendar-toolbar h3 { font-size: 26px; }
    .admin-header nav { display: flex; }
    .slot-admin-card { grid-template-columns: 1fr auto; align-items: center; }
    .booking-admin-card { grid-template-columns: minmax(210px,.8fr) minmax(320px,1.2fr) auto; align-items: center; }
    .booking-actions { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

