:root {
    --ink: #17211b;
    --muted: #66736b;
    --paper: #f5f6f1;
    --surface: #ffffff;
    --line: #dce2da;
    --green: #1d6847;
    --green-dark: #124630;
    --green-soft: #e7f2ea;
    --blue: #2f6794;
    --blue-soft: #e8f3fc;
    --blue-line: #c6ddf0;
    --amber: #f0b44b;
    --red: #a43c32;
    --red-soft: #fbe9e7;
    --shadow: 0 12px 30px rgba(27, 45, 35, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 15px; line-height: 1.5; }
button, input, select { font: inherit; }
a { color: inherit; }
.topbar { min-height: 68px; padding: 0 max(20px, calc((100vw - 1440px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: white; background: var(--green); }
.topbar nav { display: flex; align-items: center; gap: 20px; }
.topbar nav a, .link-button { border: 0; background: transparent; padding: 0; color: var(--muted); text-decoration: none; cursor: pointer; }
.topbar nav a:hover, .link-button:hover { color: var(--green); }
.container { width: min(1440px, calc(100% - 40px)); margin: 0 auto; padding: 38px 0 64px; }
.hero, .admin-hero { display: flex; align-items: end; justify-content: space-between; gap: 32px; padding: 28px 30px; border-radius: 24px; color: white; background: linear-gradient(125deg, var(--green-dark), var(--green) 68%, #36805e); box-shadow: var(--shadow); }
.hero h1, .admin-hero h1 { margin: 2px 0 8px; font-size: clamp(30px, 4vw, 54px); line-height: 1.05; letter-spacing: -.045em; }
.hero p, .admin-hero p { margin: 0; color: rgba(255,255,255,.78); max-width: 720px; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 800; color: var(--green); }
.hero .eyebrow, .admin-hero .eyebrow { color: #bfe5ce; }
.hero-note { min-width: 220px; padding: 17px 18px; display: grid; gap: 3px; border: 1px solid rgba(255,255,255,.18); border-radius: 15px; background: rgba(255,255,255,.09); }
.hero-note strong { font-size: 21px; }
.hero-note span { color: rgba(255,255,255,.72); font-size: 13px; }
.week-switch { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 28px 0; padding: 5px; background: #e7eae4; border-radius: 15px; }
.week-button { min-width: 210px; border: 0; border-radius: 11px; padding: 10px 15px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; text-align: left; }
.week-button small { display: block; font-weight: 500; opacity: .8; }
.week-button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 4px 12px rgba(23,33,27,.08); }
.week-panel { display: none; }
.week-panel.is-active { display: block; }
.stand-section { margin: 0 0 36px; }
.section-heading { min-height: 48px; display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 0 0 14px; }
.section-heading h2 { margin: 2px 0 0; font-size: 24px; letter-spacing: -.025em; }
.legend { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.days-grid { display: grid; grid-template-columns: repeat(7, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; padding: 2px 2px 12px; }
.day-card { min-width: 180px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 6px 18px rgba(27,45,35,.04); overflow: hidden; }
.day-card > header { padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #fafbf8; }
.day-card > header span { font-weight: 800; }
.day-card > header strong { color: var(--muted); font-size: 13px; }
.day-card--today { border-color: #8ab89b; box-shadow: 0 0 0 2px #cfe4d6, var(--shadow); }
.day-card--today > header { background: var(--green-soft); }
.slots { display: grid; }
.slot { padding: 12px 13px; border-bottom: 1px solid #edf0eb; }
.slot:last-child { border-bottom: 0; }
.slot-time { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.slot-time strong { font-size: 13px; }
.slot-time span { color: var(--green); font-size: 11px; font-weight: 700; }
.slot--full { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue-line); }
.slot--full .slot-time span { color: var(--blue); }
.slot--past { background: #f7f8f5; opacity: .72; }
.slot--full.slot--past { background: var(--blue-soft); opacity: .82; }
.occupants { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; }
.occupants li { min-height: 34px; padding: 6px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-radius: 8px; background: var(--green-soft); color: var(--green-dark); font-size: 12px; font-weight: 650; }
.occupants li form { flex: 0 0 auto; }
.occupant-delete { border: 0; padding: 2px 3px; background: transparent; color: #68766e; font-size: 10px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.occupant-delete:hover { color: var(--red); }
.slot--full .occupants li { background: #d9ebf8; color: #244f72; }
.book-button { width: 100%; margin-top: 9px; color: var(--green-dark); background: var(--green-soft); border-color: #bfd9c8; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 15px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font-weight: 750; text-decoration: none; cursor: pointer; }
.button:hover { border-color: #aab8ae; }
.button--primary { border-color: var(--green); background: var(--green); color: white; }
.button--primary:hover { background: var(--green-dark); }
.button--danger { border-color: var(--red); background: var(--red); color: white; }
.button--danger:hover { border-color: #842f28; background: #842f28; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button--small { min-height: 31px; padding: 5px 9px; font-size: 12px; }
.flash { margin: 0 0 18px; padding: 13px 15px; border-radius: 11px; font-weight: 650; }
.flash--success { background: var(--green-soft); color: var(--green-dark); border: 1px solid #bed9c7; }
.flash--error { background: var(--red-soft); color: #7f2c25; border: 1px solid #edc7c2; }
.auth-card { width: min(440px, 100%); margin: 8vh auto; padding: 30px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card h1 { margin: 4px 0 8px; font-size: 34px; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; color: #465149; font-size: 13px; font-weight: 700; }
input, select { min-height: 40px; border: 1px solid #cbd3cc; border-radius: 9px; padding: 7px 10px; background: white; color: var(--ink); }
input:focus, select:focus { outline: 3px solid #d7eadf; border-color: var(--green); }
.admin-hero { align-items: center; }
.admin-hero h1 { font-size: clamp(30px, 4vw, 46px); }
.admin-tabs { position: sticky; top: 68px; z-index: 10; display: flex; gap: 7px; margin: 22px 0 28px; padding: 7px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: rgba(245,246,241,.94); backdrop-filter: blur(12px); }
.admin-tabs a { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 750; text-decoration: none; white-space: nowrap; }
.admin-tabs a:hover { color: var(--green); background: var(--green-soft); }
.admin-section { scroll-margin-top: 145px; margin: 0 0 48px; }
.count-badge { display: grid; place-items: center; min-width: 34px; height: 30px; padding: 0 9px; border-radius: 999px; color: var(--green-dark); background: var(--green-soft); font-weight: 800; }
.admin-grid { display: grid; grid-template-columns: minmax(280px, .65fr) minmax(0, 1.8fr); gap: 16px; align-items: start; }
.admin-sidebar { display: grid; gap: 16px; }
.panel { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 6px 18px rgba(27,45,35,.035); }
.panel h3 { margin: 0 0 4px; font-size: 17px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid h3, .form-grid .button { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 13px; background: #f0f3ee; color: #536057; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; text-align: left; white-space: nowrap; }
td { padding: 10px 13px; border-top: 1px solid #e7ebe6; vertical-align: middle; }
tbody tr:hover { background: #fafbf8; }
td input { min-height: 34px; width: 100%; }
.inline-edit { display: grid; grid-template-columns: minmax(130px, 1fr) auto; gap: 7px; }
.status { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status--active { background: var(--green-soft); color: var(--green-dark); }
.status--inactive { background: #eceeeb; color: #69726c; }
.link-button--danger { color: var(--red); }
.actions { display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.person-editor { display: grid; grid-template-columns: minmax(190px, 1fr) 140px auto; gap: 8px; align-items: end; }
.person-editor label span { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.person-editor input { min-height: 34px; }
.limits-panel { border-color: #bdd7c5; background: linear-gradient(180deg, #ffffff, #f7fbf8); }
.form-note { margin: -2px 0 0; color: var(--muted); font-size: 12px; }
.delete-column { width: 58px; text-align: center; }
.person-delete { width: 32px; height: 32px; border: 1px solid #e3c5c2; border-radius: 9px; background: #fff7f6; color: var(--red); font-size: 22px; line-height: 1; cursor: pointer; }
.person-delete:hover { border-color: var(--red); background: var(--red-soft); }
.bulk-delete-form { overflow: hidden; }
.bulk-toolbar { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: #fafbf8; }
.check-label { display: flex; grid-auto-flow: column; align-items: center; justify-content: start; gap: 8px; cursor: pointer; }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--green); cursor: pointer; }
.check-column { width: 46px; text-align: center; }
.empty, .empty-inline { padding: 48px; text-align: center; border: 1px dashed #bfc8c0; border-radius: var(--radius); color: var(--muted); background: rgba(255,255,255,.5); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.booking-dialog { width: min(460px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 20px; color: var(--ink); box-shadow: 0 24px 80px rgba(12,30,20,.3); }
.booking-dialog::backdrop { background: rgba(12,24,17,.52); backdrop-filter: blur(3px); }
.booking-dialog form { padding: 24px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin: 2px 0 0; font-size: 26px; }
.dialog-close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #eef1ed; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.dialog-slot { margin: 0; padding: 11px 12px; border-radius: 10px; background: var(--green-soft); color: var(--green-dark); font-weight: 750; }

@media (max-width: 900px) {
    .container { width: min(100% - 24px, 1440px); padding-top: 20px; }
    .hero, .admin-hero { align-items: stretch; flex-direction: column; padding: 23px; }
    .hero-note { min-width: 0; }
    .admin-grid { grid-template-columns: 1fr; }
    .days-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 230px; justify-content: start; }
}

@media (max-width: 600px) {
    .topbar { padding: 0 14px; }
    .topbar nav { gap: 12px; font-size: 13px; }
    .week-switch { width: 100%; }
    .week-button { min-width: 0; }
    .section-heading { align-items: center; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid h3, .form-grid .button { grid-column: auto; }
    .days-grid { margin-right: 0; }
    .person-editor { grid-template-columns: 1fr 110px; }
    .person-editor .button { grid-column: 1 / -1; }
}
