:root {
  --olive: #4a4b34;
  --olive-dark: #343524;
  --sage: #777b65;
  --rose: #b77d76;
  --terra: #a66950;
  --cream: #f7d7c8;
  --gold: #c6a271;
  --paper: #fbf8f3;
  --ink: #292a22;
  --muted: #706f65;
  --line: rgba(74, 75, 52, .16);
  --success: #55704d;
  --danger: #9d5145;
  --shadow: 0 24px 70px rgba(60, 49, 37, .13);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 8%, rgba(247, 215, 200, .7), transparent 30rem),
    radial-gradient(circle at 92% 3%, rgba(119, 123, 101, .15), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }
button, a { touch-action: manipulation; }
a { color: inherit; }
[hidden] { display: none !important; }

.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.brand strong { display: block; font: 500 1.26rem Georgia, serif; letter-spacing: .12em; }
.brand span { display: block; font-size: .65rem; letter-spacing: .2em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.back-link { text-decoration: none; color: var(--olive); font-weight: 750; }

.hero { padding: 28px 0 22px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: end; }
.eyebrow { color: var(--terra); font-size: .74rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3 { color: var(--olive); }
h1 { font: 500 clamp(2.5rem, 7vw, 5.6rem)/.92 Georgia, serif; letter-spacing: -.05em; margin: 12px 0 18px; }
h2 { font: 500 2rem/1 Georgia, serif; margin: 0 0 16px; }
h3 { margin: 0; font-size: 1rem; }
.hero p { color: var(--muted); max-width: 680px; font-size: 1.05rem; }
.hero-person { justify-self: end; display: flex; align-items: center; gap: 14px; padding: 13px 16px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 22px; }
.hero-person img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.hero-person small, .muted { color: var(--muted); }

.layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 22px; padding: 10px 0 60px; }
.card { background: rgba(255,255,255,.88); border: 1px solid var(--line); border-radius: 28px; padding: 26px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.stack { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
label { color: var(--olive); font-size: .8rem; font-weight: 800; }
input, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(74,75,52,.24);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  padding: 11px 13px;
}
input:focus, select:focus { outline: 3px solid rgba(198,162,113,.28); border-color: var(--gold); }
.check { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: .82rem; }
.check input { width: 18px; min-height: 18px; margin-top: 2px; accent-color: var(--olive); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--olive);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:hover { background: var(--olive-dark); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.secondary { background: var(--cream); color: var(--olive); }
.btn.ghost { background: transparent; color: var(--olive); border: 1px solid var(--line); }
.btn.danger { background: #f5e6e2; color: var(--danger); }
.btn.small { padding: 8px 12px; font-size: .82rem; }

.notice { border-left: 3px solid var(--gold); background: #f7f0e7; padding: 13px 15px; border-radius: 11px; color: #5f5d53; font-size: .84rem; }
.status { min-height: 24px; padding: 10px 0 0; color: var(--muted); font-size: .86rem; }
.status.error { color: var(--danger); }
.status.ok { color: var(--success); }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: #ece9df; color: var(--olive); padding: 6px 10px; font-size: .75rem; font-weight: 850; }
.pill.success { background: #e6efe3; color: var(--success); }
.pill.warn { background: #f5e8df; color: var(--terra); }

.account-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.account-head img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.metric { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: #fff; }
.metric strong { display: block; color: var(--olive); font: 600 1.55rem Georgia, serif; }
.metric span { color: var(--muted); font-size: .76rem; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 10px; }
.list { display: grid; gap: 10px; }
.list-item { border: 1px solid var(--line); border-radius: 18px; padding: 15px; background: #fff; }
.list-item.complete { opacity: .68; }
.list-item.complete h3 { text-decoration: line-through; }
.task-button { width: 100%; border: 0; background: none; padding: 0; color: inherit; text-align: left; cursor: pointer; display: grid; grid-template-columns: auto 1fr; gap: 12px; }
.task-check { width: 25px; height: 25px; border: 2px solid var(--gold); border-radius: 50%; display: grid; place-items: center; color: #fff; }
.complete .task-check { border-color: var(--sage); background: var(--sage); }
.appointment { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; }
.appointment time { font-weight: 900; color: var(--olive); }
.appointment .meta { color: var(--muted); font-size: .8rem; margin-top: 5px; }
.arrival-controls { grid-column: 1 / -1; display: grid; gap: 9px; padding-top: 10px; border-top: 1px solid var(--line); }
.arrival-controls p { margin: 0; color: var(--muted); font-size: .78rem; }
.arrival-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.privacy { color: var(--muted); font-size: .76rem; margin-top: 18px; }

.membership-catalog-card { grid-row: span 2; }
.membership-term-switch { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; margin-top: 18px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: rgba(74,75,52,.07); }
.membership-term-switch button { min-height: 46px; border: 0; border-radius: 999px; padding: 9px 14px; background: transparent; color: var(--olive); font-weight: 900; cursor: pointer; transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
.membership-term-switch button span { display: block; font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; opacity: .76; }
.membership-term-switch button.active { background: var(--olive); color: #fff; box-shadow: 0 7px 18px rgba(74,75,52,.2); }
.membership-term-switch button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.membership-grid { display: grid; gap: 12px; margin-top: 18px; }
.membership-plan { border: 1px solid var(--line); border-radius: 20px; padding: 17px; background: linear-gradient(145deg, #fff, #faf5ee); }
.membership-plan.signature { border-color: rgba(198,162,113,.65); }
.membership-plan.privilege { background: linear-gradient(145deg, var(--olive), var(--olive-dark)); color: #fff; }
.membership-plan.privilege h3, .membership-plan.privilege strong, .membership-plan.privilege .muted { color: #fff; }
.membership-plan-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.membership-plan-head strong { color: var(--olive); white-space: nowrap; }
.membership-benefits { margin: 13px 0; padding-left: 20px; font-size: .84rem; }
.membership-value { color: var(--muted); font-size: .76rem; }
.privilege .membership-value { color: rgba(255,255,255,.78); }
.membership-select { width: 100%; }
.membership-plan.privilege .membership-select { background: var(--gold); color: var(--olive-dark); }
.membership-term-grid { display: grid; gap: 10px; margin-top: 14px; }
.membership-term-option { display: grid; gap: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.72); color: var(--ink); }
.membership-term-option.recommended { border: 2px solid var(--gold); background: #fff8eb; box-shadow: 0 8px 22px rgba(198,162,113,.18); }
.membership-term-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.membership-term-option > b { color: var(--olive); font-size: 1.25rem; }
.membership-priority-callout { color: var(--olive); font-weight: 800; }
.membership-plan.privilege .membership-term-option .muted { color: var(--muted); }
.membership-dialog { width: min(520px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: 24px; padding: 26px; color: var(--ink); background: var(--paper); box-shadow: var(--shadow); }
.membership-dialog::backdrop { background: rgba(41,42,34,.58); backdrop-filter: blur(3px); }
.membership-active { border-color: rgba(85,112,77,.42); background: #f5faf3; }
.membership-entitlement { display: grid; gap: 9px; }
.entitlement-counts { display: flex; flex-wrap: wrap; gap: 7px; }

.team-body { background: #f4f2ec; }
.team-body .topbar { border-bottom: 1px solid var(--line); }
.team-mark { background: var(--olive); color: #fff; border-radius: 999px; padding: 7px 11px; font-size: .72rem; font-weight: 900; letter-spacing: .1em; }
.team-shell { width: min(1240px, calc(100% - 32px)); margin: 0 auto; }
.team-main { padding: 26px 0 54px; }
.team-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.team-header h1 { font-size: clamp(2.4rem, 5vw, 4.5rem); margin-bottom: 4px; }
.team-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr); gap: 20px; }
.day-picker { display: grid; grid-template-columns: minmax(210px, .65fr) repeat(2, minmax(150px, .35fr)); gap: 16px; align-items: end; margin-bottom: 20px; }
.day-summary { min-height: 70px; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid var(--line); padding-left: 18px; }
.day-summary strong { color: var(--olive); font: 600 1.8rem Georgia, serif; }
.day-summary span { color: var(--muted); font-size: .76rem; }
.staff-appointment { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.staff-appointment time { color: var(--olive); font-size: 1.1rem; font-weight: 900; }
.staff-appointment .appointment-action { grid-column: 2 / -1; }
.login-wrap { min-height: calc(100vh - 95px); display: grid; place-items: center; padding: 34px 0; }
.login-card { width: min(510px, 100%); }
.login-card .nyla { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); }
.manager-panel { margin-top: 20px; }
.manager-form { display: grid; grid-template-columns: 1.2fr .8fr 1fr auto; gap: 12px; align-items: end; }
.manager-form .form-action { min-width: 170px; }
.manager-form .form-action .btn { min-height: 48px; }
.credential-card { margin: 18px 0; border: 1px solid rgba(198,162,113,.65); border-radius: 18px; background: #fbf2e7; padding: 18px; }
.credential-card > strong { display: block; color: var(--olive); margin-bottom: 10px; }
.credential-card > div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: center; padding: 6px 0; }
.credential-card span { color: var(--muted); font-size: .8rem; font-weight: 800; }
.credential-card code { color: var(--olive); font: 800 1.2rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.credential-card p { color: var(--danger); font-size: .78rem; }
.staff-account-list { display: grid; gap: 10px; margin-top: 14px; }
.staff-account { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #fff; }
.staff-account .meta { color: var(--muted); font-size: .78rem; margin-top: 3px; }
.staff-account .actions { justify-content: flex-end; }

.offline { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 999px; z-index: 20; font-size: .78rem; }

@media (max-width: 820px) {
  .hero, .layout, .team-grid { grid-template-columns: 1fr; }
  .hero-person { justify-self: start; }
  .metric-grid { grid-template-columns: 1fr; }
  .team-header { align-items: start; flex-direction: column; }
  .day-picker { grid-template-columns: 1fr 1fr; }
  .day-picker .field { grid-column: 1 / -1; }
  .manager-form { grid-template-columns: 1fr 1fr; }
  .manager-form .form-action { min-width: 0; }
}

@media (max-width: 560px) {
  .shell, .team-shell { width: min(100% - 20px, 1120px); }
  .topbar { min-height: 66px; }
  .brand span { display: none; }
  .back-link { font-size: .82rem; }
  .hero { padding-top: 16px; }
  .hero-person { display: none; }
  .layout { padding-bottom: 32px; }
  .card { border-radius: 22px; padding: 20px; }
  .grid-2 { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .actions .btn { flex: 1; }
  .appointment { grid-template-columns: 1fr auto; }
  .appointment time { grid-column: 1 / -1; }
  .staff-appointment { grid-template-columns: 1fr auto; }
  .staff-appointment time { grid-column: 1 / -1; }
  .staff-appointment .appointment-action { grid-column: 1 / -1; }
  .manager-form { grid-template-columns: 1fr; }
  .staff-account { grid-template-columns: 1fr; }
  .staff-account .actions { justify-content: flex-start; }
  .credential-card > div { grid-template-columns: 1fr; gap: 2px; }
}

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