:root {
    --ink: #20251f;
    --muted: #697067;
    --forest: #244c38;
    --forest-dark: #183427;
    --cream: #f6f1e7;
    --paper: #fffdf8;
    --gold: #d49a3a;
    --line: #dcd8ce;
    --danger: #a33d35;
    --success: #2f6a46;
    --shadow: 0 18px 55px rgba(41, 47, 39, .10);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--cream); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--forest); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }

.site-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: .9rem max(1.25rem, calc((100vw - 1160px) / 2)); color: white; background: var(--forest-dark); box-shadow: 0 3px 20px rgba(0,0,0,.12); }
.brand { display: flex; align-items: center; gap: .75rem; color: white; font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.brand-mark, .auth-ball { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; color: var(--forest-dark); background: var(--gold); border-radius: 50%; font-family: Georgia, serif; font-weight: 800; box-shadow: inset -.2rem -.2rem 0 rgba(0,0,0,.12); }
.site-header nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.site-header nav a { padding: .55rem .75rem; color: rgba(255,255,255,.82); border-radius: .45rem; text-decoration: none; font-size: .92rem; }
.site-header nav a:hover, .site-header nav a:focus-visible { color: white; background: rgba(255,255,255,.1); }

.page-shell { width: min(1160px, calc(100% - 2rem)); margin: 0 auto; padding: 3.25rem 0 5rem; }
.page-shell--centered { width: min(520px, calc(100% - 2rem)); padding-top: 5rem; }
.page-heading { margin-bottom: 2rem; }
.page-heading h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 600; letter-spacing: -.035em; }
.eyebrow { margin: 0 0 .5rem; color: var(--forest); font-size: .75rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.lead { color: var(--muted); line-height: 1.65; }

.auth-card, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 1rem; box-shadow: var(--shadow); }
.auth-card { padding: clamp(1.4rem, 5vw, 2.4rem); }
.auth-card--wide { width: min(700px, 100%); }
.auth-card__intro { margin-bottom: 1.75rem; }
.auth-card__intro h2 { margin: 1rem 0 .35rem; font-family: Georgia, serif; font-size: 1.55rem; }
.auth-card__intro p, .auth-card__setup { color: var(--muted); line-height: 1.55; }
.auth-card__setup { margin: 1.5rem 0 0; font-size: .9rem; text-align: center; }
.auth-ball { width: 3rem; height: 3rem; font-size: 1.35rem; }

.form-stack, .form-grid { display: grid; gap: 1.15rem; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid__full { grid-column: 1 / -1; }
label { display: grid; gap: .45rem; color: #343a33; font-size: .88rem; font-weight: 750; }
label small { color: var(--muted); font-weight: 400; }
input, select, textarea { width: 100%; padding: .78rem .85rem; color: var(--ink); background: #fff; border: 1px solid #c9c8c0; border-radius: .55rem; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(36,76,56,.13); }
input:disabled, select:disabled, textarea:disabled { color: #5f635e; background: #efeee9; }
textarea { resize: vertical; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: .7rem 1rem; border: 1px solid transparent; border-radius: .55rem; font-weight: 800; text-decoration: none; cursor: pointer; }
.button--primary { color: white; background: var(--forest); }
.button--primary:hover { background: var(--forest-dark); }
.button--secondary { color: var(--forest); background: transparent; border-color: #bcc6be; }
.button--danger { color: #7a302a; background: #f8e7e4; border-color: #e1b7b1; }
.button--confirm { color: white; background: #2f6a46; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; padding-top: .5rem; }

.notice { margin-bottom: 1.2rem; padding: .85rem 1rem; border-radius: .6rem; line-height: 1.45; }
.notice--error { color: #772c26; background: #fae8e5; border: 1px solid #e8bcb7; }
.notice--success { color: #245137; background: #e6f2e9; border: 1px solid #bad6c1; }
.notice--info { color: #3f4c5d; background: #e9f0f6; border: 1px solid #c7d4df; }

.dashboard-intro, .toolbar, .panel__heading { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.dashboard-intro { margin-bottom: 1.5rem; }
.dashboard-intro h2 { margin: 0 0 .3rem; font-family: Georgia, serif; font-size: 1.45rem; }
.dashboard-intro p, .toolbar p { margin: 0; color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.stat-grid--two { grid-template-columns: repeat(2, 1fr); }
.stat-card { display: grid; gap: .55rem; padding: 1.25rem; background: rgba(255,253,248,.74); border: 1px solid var(--line); border-radius: .85rem; }
.stat-card span { color: var(--muted); font-size: .83rem; }
.stat-card strong { font-family: Georgia, serif; font-size: 1.75rem; }
.stat-card--accent { color: white; background: var(--forest); border-color: var(--forest); }
.stat-card--accent span { color: rgba(255,255,255,.72); }
.panel { padding: 1.4rem; }
.panel__heading { margin-bottom: 1rem; }
.panel__heading h2 { margin: 0; font-family: Georgia, serif; font-size: 1.25rem; }
.empty-state { display: grid; gap: .3rem; padding: 2.5rem 1rem; color: var(--muted); text-align: center; border: 1px dashed #cbc8bd; border-radius: .7rem; }
.empty-state strong { color: var(--ink); }
.event-list { display: grid; }
.event-row { display: grid; grid-template-columns: 8rem 1fr auto; gap: 1rem; align-items: center; padding: 1rem .25rem; color: inherit; text-decoration: none; border-top: 1px solid var(--line); }
.event-row:first-child { border-top: 0; }
.event-row time { color: var(--forest); font-weight: 800; }
.event-row > span { display: grid; gap: .2rem; color: var(--muted); font-size: .9rem; }
.event-row > span strong { color: var(--ink); font-size: 1rem; }
.event-row em { color: var(--muted); font-size: .8rem; font-style: normal; }

.toolbar { margin-bottom: 1.25rem; }
.panel--table { padding: .35rem 1.2rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .95rem .7rem; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; padding: .32rem .55rem; border-radius: 999px; background: #ecebe6; font-size: .78rem; font-weight: 750; }
.status--planned { color: #71531f; background: #f7e8c5; }
.status--cancelled { color: #7a302a; background: #f5dfdc; }
.status--completed { color: #2d536f; background: #deecf5; }
.status--settled { color: #27543a; background: #dfeee3; }
.form-panel { max-width: 780px; }
.number-preview { display: grid; gap: .25rem; margin-bottom: 1.4rem; padding: 1rem 1.15rem; background: #ede9dd; border-radius: .75rem; }
.number-preview span, .number-preview small { color: var(--muted); }
.number-preview strong { color: var(--forest); font-family: Georgia, serif; font-size: 2rem; }
.checkbox-label { grid-template-columns: auto 1fr; align-items: center; padding: .9rem 1rem; background: #f0eee7; border-radius: .65rem; }
.checkbox-label input { width: 1.1rem; height: 1.1rem; }
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.row-cancelled { color: var(--muted); background: #f2eee8; }
.row-cancelled td:nth-child(2) { text-decoration: line-through; }
.row-inactive { color: var(--muted); background: #f2eee8; }
.split-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 1rem; align-items: start; }
.user-list { display: grid; }
.user-row { display: grid; grid-template-columns: 2.5rem 1fr auto; gap: .8rem; align-items: center; padding: .85rem 0; border-top: 1px solid var(--line); }
.user-row:first-child { border-top: 0; }
.avatar { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; color: white; background: var(--forest); border-radius: 50%; font-weight: 800; }
.user-row div { display: grid; gap: .15rem; }
.user-row div span, .user-row em { color: var(--muted); font-size: .82rem; font-style: normal; }
.site-footer { padding: 1.25rem; color: var(--muted); text-align: center; font-size: .78rem; }

@media (max-width: 760px) {
    .site-header { position: static; align-items: flex-start; flex-direction: column; gap: .7rem; }
    .site-header nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
    .page-shell { padding-top: 2rem; }
    .dashboard-intro, .toolbar { align-items: stretch; flex-direction: column; }
    .stat-grid, .stat-grid--two, .split-layout { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .option-grid { grid-template-columns: 1fr; }
    .form-grid__full { grid-column: auto; }
    .event-row { grid-template-columns: 1fr auto; }
    .event-row time { grid-column: 1 / -1; }
}
