:root {
    color-scheme: light;
    --bg: #f7f5f1;
    --panel: #ffffff;
    --panel-soft: #fbfaf7;
    --text: #18231f;
    --muted: #64716b;
    --line: #d8ded8;
    --accent: #1f6f64;
    --accent-dark: #154f48;
    --danger: #a73535;
    --success: #1f7a4d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(31, 111, 100, 0.08), rgba(255, 255, 255, 0) 280px),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: var(--accent);
    font-weight: 700;
}

code {
    background: #eef3ef;
    border-radius: 4px;
    font-size: 0.92em;
    padding: 2px 5px;
}

.page {
    margin: 34px auto;
    width: min(940px, calc(100% - 28px));
}

.page-wide {
    width: min(1280px, calc(100% - 28px));
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 34px rgba(24, 35, 31, 0.09);
    padding: clamp(20px, 4vw, 34px);
}

.panel-narrow {
    max-width: 560px;
    margin: 0 auto;
}

.topbar,
.heading-row {
    align-items: flex-start;
    display: flex;
    gap: 20px;
    justify-content: space-between;
}

.heading {
    margin-bottom: 24px;
}

.topbar .heading {
    margin-bottom: 12px;
}

.eyebrow {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 6px;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    margin: 0 0 10px;
}

h2 {
    font-size: 1.15rem;
    margin: 0 0 14px;
}

p {
    color: var(--muted);
    margin: 0;
}

.locale-switcher {
    display: grid;
    gap: 6px;
    min-width: 190px;
}

.locale-switcher span,
.field span {
    font-weight: 800;
}

select,
input,
textarea {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    min-height: 46px;
    padding: 11px 12px;
    width: 100%;
}

select:focus,
input:focus,
textarea:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(31, 111, 100, 0.16);
}

.guest-form {
    display: grid;
    gap: 18px;
}

.guest-card {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0;
    padding: 18px;
}

.guest-card legend {
    color: var(--text);
    font-size: 1.08rem;
    font-weight: 850;
    padding: 0 8px;
}

.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.field-error {
    color: var(--danger);
    font-size: 0.9rem;
}

button,
.button-link {
    align-items: center;
    background: var(--accent);
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    justify-content: center;
    min-height: 46px;
    padding: 11px 18px;
    text-decoration: none;
}

button:hover,
.button-link:hover {
    background: var(--accent-dark);
}

.button-secondary {
    background: #eef3ef;
    border: 1px solid var(--line);
    color: var(--accent-dark);
}

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

.button-small {
    min-height: 36px;
    padding: 7px 12px;
}

.link-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.notice {
    background: #eef3ef;
    border: 1px solid var(--line);
    border-radius: 6px;
    margin-bottom: 20px;
    padding: 12px 14px;
}

.notice.success {
    background: #e7f5ef;
    border-color: #9bd3bc;
    color: #174a33;
}

.notice.error {
    background: #faeeee;
    border-color: #e2b0b0;
    color: var(--danger);
}

.admin-create-form {
    align-items: end;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(180px, 260px) auto;
    margin-bottom: 22px;
    padding-bottom: 22px;
}

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

table {
    border-collapse: collapse;
    min-width: 920px;
    width: 100%;
}

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

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

.status {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.86rem;
    font-weight: 800;
    padding: 4px 9px;
}

.status-filled {
    background: #e7f5ef;
    color: var(--success);
}

.status-open {
    background: #fff6e5;
    color: #8a5a00;
}

.summary-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 22px;
}

.summary-grid div {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 12px;
}

.summary-grid strong,
dt {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.summary-grid span,
dd {
    margin: 0;
}

.guest-detail-list {
    display: grid;
    gap: 16px;
}

.guest-detail {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.guest-detail dl {
    display: grid;
    gap: 10px 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.guest-detail dl div {
    min-width: 0;
}

.toast {
    background: #17211c;
    border-radius: 8px;
    bottom: 22px;
    box-shadow: 0 14px 34px rgba(24, 35, 31, 0.24);
    color: #ffffff;
    font-weight: 800;
    inset-inline-end: 22px;
    max-width: min(360px, calc(100vw - 32px));
    padding: 13px 16px;
    position: fixed;
    z-index: 20;
}

.toast[hidden] {
    display: none;
}

[dir="rtl"] th,
[dir="rtl"] td {
    text-align: right;
}

@media (max-width: 760px) {
    .page {
        margin: 18px auto;
        width: min(100% - 18px, 940px);
    }

    .topbar,
    .heading-row,
    .admin-create-form {
        display: grid;
    }

    .locale-switcher {
        min-width: 0;
        width: 100%;
    }

    .form-grid,
    .summary-grid,
    .guest-detail dl {
        grid-template-columns: 1fr;
    }

    button,
    .button-link {
        width: 100%;
    }

    .link-actions {
        align-items: stretch;
        display: grid;
    }

    .guest-card {
        padding: 16px 12px;
    }

    .toast {
        bottom: 14px;
        inset-inline: 14px;
        max-width: none;
    }
}
