:root {
    --ink: #17211c;
    --muted: #647067;
    --oak: #315b43;
    --oak-dark: #234331;
    --moss: #dce8de;
    --cream: #f6f3eb;
    --paper: #fffefa;
    --line: #dfe3dc;
    --danger: #9b332f;
    --shadow: 0 18px 55px rgba(28, 46, 35, .12);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--cream);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; }
a { color: var(--oak); text-underline-offset: 3px; }
button, input, select { font: inherit; }

.guest-shell {
    display: grid;
    place-items: center;
    padding: 40px 20px 70px;
    background:
        radial-gradient(circle at 15% 10%, rgba(83, 121, 91, .19), transparent 32rem),
        linear-gradient(145deg, #f8f5ed, #edf2ea);
}

.guest-card {
    width: min(100%, 500px);
    padding: 42px;
    border: 1px solid rgba(49, 91, 67, .18);
    border-radius: 22px;
    background: rgba(255, 254, 250, .94);
    box-shadow: var(--shadow);
}

.guest-brand { margin-bottom: 30px; text-align: center; }
.guest-brand h1 { margin: 5px 0 4px; font-family: Georgia, serif; font-size: 2.1rem; font-weight: 500; }
.brand-mark {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
    color: white; background: var(--oak); font-family: Georgia, serif; letter-spacing: -3px; padding-right: 3px;
}
.brand-mark.large { width: 58px; height: 58px; margin: 0 auto 18px; font-size: 1.2rem; }
.eyebrow { margin: 0; color: var(--oak); font-size: .73rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.muted { color: var(--muted); }

.stack { display: grid; gap: 18px; }
.stack.compact { margin-top: 15px; }
label { display: grid; gap: 7px; font-size: .9rem; font-weight: 700; }
label small, .field-grid small { color: var(--muted); font-weight: 400; line-height: 1.45; }
input, select {
    width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #c9d0c9; border-radius: 9px;
    color: var(--ink); background: white; outline: none;
}
input:focus, select:focus { border-color: var(--oak); box-shadow: 0 0 0 3px rgba(49, 91, 67, .14); }
.check-row { display: flex; align-items: center; gap: 9px; font-weight: 500; }
.check-row input { width: 17px; min-height: 17px; }

.button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 16px;
    border: 1px solid #bdc6bd; border-radius: 9px; color: var(--ink); background: white; cursor: pointer; text-decoration: none;
}
.button:hover { border-color: var(--oak); }
.button-primary { border-color: var(--oak); color: white; background: var(--oak); font-weight: 750; }
.button-primary:hover { background: var(--oak-dark); }
.button-danger { border-color: #e4c2bf; color: var(--danger); }
.button-quiet { min-height: 36px; padding: 7px 12px; background: transparent; }

.notice { margin-bottom: 22px; padding: 13px 15px; border-radius: 9px; font-size: .9rem; line-height: 1.5; }
.notice ul { margin-bottom: 0; }
.notice-success { border: 1px solid #bad5c0; background: #edf7ee; }
.notice-error { border: 1px solid #e7bdb9; background: #fff0ee; }
.configuration-note { padding: 12px 14px; border-left: 3px solid #9cad9e; color: #526158; background: #f1f4ef; font-size: .86rem; }
.recovery-option { margin-top: 22px; color: var(--muted); }

.app-shell { background: #f4f5f1; }
.topbar {
    display: flex; align-items: center; gap: 32px; min-height: 72px; padding: 0 max(24px, calc((100vw - 1180px) / 2));
    border-bottom: 1px solid var(--line); background: var(--paper);
}
.brand { display: flex; align-items: center; gap: 11px; margin-right: auto; color: var(--ink); text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 1.05rem; }
.brand small { color: var(--muted); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.topbar nav { display: flex; gap: 24px; }
.topbar nav a { color: #4f5b53; font-size: .9rem; font-weight: 650; text-decoration: none; }
.topbar nav a:hover { color: var(--oak); }

.page { width: min(1180px, calc(100% - 40px)); margin: 38px auto 80px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-heading h1 { margin: 5px 0 0; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
.status-pill { padding: 6px 10px; border-radius: 999px; color: var(--oak-dark); background: var(--moss); font-size: .75rem; font-weight: 800; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.metric, .panel { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 5px 20px rgba(31, 43, 35, .04); }
.metric { display: grid; gap: 8px; padding: 20px; }
.metric span, .metric small { color: var(--muted); }
.metric strong { font-family: Georgia, serif; font-size: 1.9rem; font-weight: 500; }
.panel { padding: 24px; }
.panel + .panel { margin-top: 18px; }
.panel h2, .panel h3 { margin-top: 0; }
.panel h2 { font-family: Georgia, serif; font-weight: 500; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel-heading h2 { margin-bottom: 4px; }
.panel-heading p { margin: 0; color: var(--muted); }
.checklist { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.checklist li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 14px; padding: 15px 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist li > span { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #bac4bb; border-radius: 50%; }
.checklist li.done > span { border-color: var(--oak); color: white; background: var(--oak); }
.checklist strong, .checklist small { display: block; }
.checklist small { margin-top: 3px; color: var(--muted); }

.two-column { display: grid; grid-template-columns: 1.45fr .75fr; gap: 20px; align-items: start; }
.details { margin: 0; }
.details div { padding: 12px 0; border-top: 1px solid var(--line); }
.details div:first-child { border-top: 0; }
.details dt { color: var(--muted); font-size: .75rem; text-transform: uppercase; }
.details dd { margin: 4px 0 0; }
.qr-box { display: inline-block; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.qr-box svg { display: block; width: 210px; height: 210px; }
.inline-form { display: flex; align-items: end; gap: 12px; }
.inline-form .grow { flex: 1; }
.table-panel { padding-left: 0; padding-right: 0; overflow: hidden; }
.table-panel .panel-heading { padding: 0 24px; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 13px 16px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: #f7f8f4; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
td small { display: block; max-width: 360px; margin-top: 3px; color: var(--muted); }
.number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.positive { color: var(--oak-dark); }
.negative { color: #8f3e36; }
.row-action { display: flex; align-items: center; gap: 7px; min-width: 310px; }
.row-action select { min-width: 220px; }
.secondary-action { display: inline-flex; min-width: 0; margin-top: 5px; }
.button-small { min-height: 36px; padding: 7px 11px; }
.link-button { padding: 0; border: 0; color: var(--muted); background: none; font: inherit; text-decoration: underline; cursor: pointer; }
.empty-state { padding: 36px; color: var(--muted); text-align: center; }
.report-nav { display: flex; gap: 8px; margin: -10px 0 18px; }
.report-nav a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--oak-dark); background: var(--paper); font-size: .85rem; text-decoration: none; }
.date-filter { display: flex; align-items: end; gap: 12px; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.report-sheet { width: min(760px, 100%); margin: auto; }
.report-sheet > h2, .report-sheet > p { text-align: center; }
.report-sheet > p { margin-top: -5px; color: var(--muted); }
.report-sheet h3 { margin: 30px 0 8px; padding-bottom: 7px; border-bottom: 1px solid var(--line); font-family: Georgia, serif; }
.report-row { display: flex; justify-content: space-between; gap: 20px; padding: 7px 4px; font-variant-numeric: tabular-nums; }
.report-row.subtotal { margin-top: 5px; border-top: 1px solid var(--line); font-weight: 700; }
.report-row.grand-total, .total-row { border-top: 2px solid var(--ink); border-bottom: 2px double var(--ink); font-weight: 800; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 15px 0; }
.recovery-codes code { padding: 9px; border: 1px solid var(--line); border-radius: 6px; background: #f5f6f2; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.settings-form { display: grid; gap: 20px; }
.field-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.field-grid.two { grid-template-columns: repeat(2, 1fr); }
.save-bar { position: sticky; bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; border: 1px solid #cfd7cf; border-radius: 12px; background: rgba(255, 254, 250, .96); box-shadow: var(--shadow); }
.save-bar span { color: var(--muted); font-size: .85rem; }
.footer { padding: 25px; color: #768078; font-size: .75rem; text-align: center; }

@media (max-width: 850px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .two-column, .field-grid, .field-grid.two { grid-template-columns: 1fr; }
    .topbar { flex-wrap: wrap; padding: 14px 20px; }
    .topbar nav { order: 3; width: 100%; }
}
@media (max-width: 540px) {
    .guest-card { padding: 28px 22px; }
    .metric-grid { grid-template-columns: 1fr; }
    .page { width: min(100% - 24px, 1180px); margin-top: 24px; }
    .page-heading, .save-bar { align-items: stretch; flex-direction: column; }
    .checklist li { grid-template-columns: 34px 1fr; }
    .checklist li a { grid-column: 2; }
    .inline-form { align-items: stretch; flex-direction: column; }
    .topbar nav { gap: 15px; overflow-x: auto; }
    .report-nav, .date-filter { align-items: stretch; flex-direction: column; }
    .recovery-codes { grid-template-columns: 1fr; }
}
