:root {
  --bg: #F7F3E8; --surface: #FFFDF7; --ink: #4A5228; --ink2: #3E4230; --muted: #858672; --line: #E7E1CF;
  --clay: #8A9156; --clay-soft: #EEEDDA; --sage: #6B7340; --sage-soft: #E9EBD8; --danger: #A8503C; --warn: #A27A2C;
  --olive: #5A6236; --olive-dark: #444C26; --cream: #FCF8ED;
  --serif: 'Cormorant Garamond', 'Readex Pro', serif;
  --r: 18px; --r-sm: 12px; --shadow: 0 1px 2px rgba(30,42,43,.04), 0 6px 24px rgba(30,42,43,.06);
  font-family: 'Readex Pro', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
body { font-size: 15px; line-height: 1.5; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 26px; font-family: var(--serif); font-weight: 600; } h2 small { font-family: 'Readex Pro', sans-serif; font-size: 14px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; } .danger { color: var(--danger); }
.row { display: flex; gap: 8px; align-items: center; } .row.end { justify-content: flex-end; } .row.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }

/* Buttons */
.btn { border: 0; border-radius: 999px; padding: 11px 20px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; transition: transform .1s, background .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--olive); color: #fff; } .btn.primary:hover { background: var(--olive-dark); }
.btn.outline { background: transparent; border: 1.5px solid var(--ink); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { padding: 7px 14px; font-size: 13px; } .btn.block { width: 100%; margin-top: 10px; }
.link { background: none; border: 0; padding: 4px 2px; color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13px; }
.link.danger { color: var(--danger); }
.icon-btn { background: var(--surface); border: 1px solid var(--line); width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; cursor: pointer; text-decoration: none; font-size: 15px; flex: none; }
.icon-btn.wa { color: #1F8A4C; }
.chip { background: var(--clay-soft); color: var(--ink); border: 0; border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; }
.lang-btn { background: transparent; color: var(--olive); border: 1.5px solid currentColor; border-radius: 999px; min-width: 36px; height: 32px; cursor: pointer; font-weight: 600; font-size: 13px; }

/* Forms */
.field { display: grid; gap: 6px; } .field > span { font-size: 13px; color: var(--ink2); font-weight: 500; }
.field small { color: var(--muted); font-size: 12px; }
input, select, textarea { width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-sm); padding: 11px 13px; outline: none; transition: border .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
input[type=color] { padding: 4px; height: 44px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; } .check input { width: auto; }
.form-error { color: var(--danger); font-size: 13px; min-height: 1em; }
.search { margin: 12px 0; }

/* Cards */
.card { background: var(--surface); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); margin-bottom: 12px; }
.card.notice { display: grid; gap: 10px; justify-items: start; border: 1px dashed var(--clay); box-shadow: none; }
.empty-state { padding: 26px 16px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--r); border: 1px dashed var(--line); margin-bottom: 12px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.sec { margin: 22px 0 10px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--line); white-space: nowrap; }
.pill.ok, .pill.booked, .pill.attended { background: var(--sage-soft); color: #4C5C40; }
.pill.wait, .pill.waitlist { background: var(--clay-soft); color: #8A5634; }
.pill.late_cancel, .pill.no_show { background: #F6DCD5; color: var(--danger); }
.pill.muted, .pill.cancelled { background: #EEE9E1; color: var(--muted); }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.auth-hero { background: var(--cream); color: var(--olive); padding: 16px 22px 64px; text-align: center; position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.auth-hero::before, .auth-hero::after { content: ''; position: absolute; border-radius: 50%; border: 1.5px solid rgba(90,98,54,.18); pointer-events: none; }
.auth-hero::before { width: 420px; height: 420px; inset-inline-start: -260px; top: -160px; }
.auth-hero::after { width: 300px; height: 300px; inset-inline-end: -170px; bottom: -190px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; color: var(--olive); }
.hero-logo { width: min(210px, 52vw); height: auto; display: block; margin: 4px auto 14px; filter: drop-shadow(0 8px 24px rgba(68,76,38,.12)); }
.auth-hero h1 { font-family: var(--serif); font-size: clamp(24px, 6vw, 32px); line-height: 1.25; font-weight: 600; margin-bottom: 6px; color: var(--olive-dark); }
.auth-hero p { color: var(--muted); font-size: 14px; }
.auth-card { width: min(440px, calc(100% - 32px)); margin: -44px auto 30px; display: grid; gap: 14px; align-self: start; align-content: start; position: relative; z-index: 1; padding: 22px; }
.seg { display: flex; background: var(--bg); border-radius: 999px; padding: 4px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 999px; cursor: pointer; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.seg.small button { padding: 6px 12px; font-size: 13px; }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 40px; height: 40px; border-radius: 50%; display: block; box-shadow: 0 0 0 1px var(--line); }
.brand .word { direction: ltr; color: var(--olive); font-family: var(--serif); font-size: 19px; letter-spacing: .12em; line-height: 1; }
.brand .word b { font-weight: 600; } .brand .word i { font-style: italic; letter-spacing: .02em; font-weight: 500; font-size: 21px; }

/* Shell */
.shell { min-height: 100vh; padding-bottom: 84px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; background: rgba(252,248,237,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.nav { position: fixed; bottom: 0; inset-inline: 0; z-index: 30; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); overflow-x: auto; scrollbar-width: none; }
.nav a { flex: 1 0 auto; min-width: 64px; display: grid; justify-items: center; gap: 2px; padding: 6px 8px; text-decoration: none; color: var(--muted); font-size: 11px; border-radius: 12px; }
.nav a svg { width: 22px; height: 22px; } .nav a.on { color: var(--ink); background: var(--bg); }
.view { width: min(760px, 100%); margin: 0 auto; padding: 18px 16px 30px; }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.head-row input[type=date] { width: auto; padding: 7px 10px; }

@media (min-width: 900px) {
  .shell.staff { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; padding-bottom: 0; }
  .shell.staff .topbar { grid-column: 1 / -1; }
  .shell.staff .nav { position: sticky; top: 59px; align-self: start; flex-direction: column; height: calc(100vh - 59px); border-top: 0; border-inline-end: 1px solid var(--line); background: transparent; padding: 14px 10px; gap: 2px; }
  .shell.staff .nav a { flex: none; display: flex; gap: 10px; font-size: 14px; padding: 10px 12px; }
  .shell.staff .nav a.on { background: var(--surface); box-shadow: var(--shadow); }
  .shell.staff .view { width: min(1000px, 100%); padding: 26px 28px; }
  .shell.client .nav { width: min(520px, 100%); margin: 0 auto; inset-inline: 0; border-radius: 22px 22px 0 0; border: 1px solid var(--line); }
}

/* Client schedule */
.hello { display: flex; justify-content: space-between; align-items: end; margin-bottom: 14px; }
.balance { background: var(--olive); color: #fff; border-radius: 16px; padding: 8px 14px; text-decoration: none; display: grid; justify-items: center; line-height: 1.1; }
.balance b { font-size: 22px; } .balance span { font-size: 11px; color: #E3E4CC; }
.days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; margin: 0 -16px; padding-inline: 16px; }
.days button { flex: none; width: 58px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 16px; padding: 8px 0; cursor: pointer; display: grid; justify-items: center; }
.days button small { font-size: 11px; color: var(--muted); } .days button b { font-size: 18px; font-weight: 600; }
.days button.on { background: var(--olive); border-color: var(--olive); color: #fff; } .days button.on small { color: #E3E4CC; }
.days button.empty:not(.on) { opacity: .45; }
.session { display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--r); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); border-inline-start: 4px solid var(--c, var(--sage)); }
.session .time { display: grid; justify-items: center; line-height: 1.2; } .session .time b { font-size: 17px; direction: ltr; } .session .time small { color: var(--muted); font-size: 11px; text-align: center; }
.session h3 { font-size: 15px; color: var(--ink2); } .session .info p { font-size: 13px; }
.session .act { display: grid; gap: 4px; justify-items: end; }
.seats { display: flex; gap: 8px; align-items: center; margin-top: 4px; font-size: 12px; color: var(--muted); }
.dots { display: inline-flex; gap: 4px; } .dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--c, var(--sage)); }
.dots i.on { background: var(--c, var(--sage)); }

/* Packages */
.pkg-mine { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.pkg-mine .big { font-size: 30px; font-weight: 600; display: grid; justify-items: center; line-height: 1; } .pkg-mine .big small { font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 4px; }
.bar { grid-column: 1 / -1; height: 6px; background: var(--bg); border-radius: 9px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--clay); }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.price { display: grid; gap: 4px; align-content: start; margin: 0; } .price .amt { font-size: 30px; font-weight: 600; font-family: var(--serif); color: var(--olive); } .price .per { color: var(--sage); font-weight: 500; }

/* Staff lists */
.line { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 11px 14px; background: var(--surface); border-radius: var(--r-sm); margin-bottom: 6px; border-inline-start: 3px solid var(--c, transparent); font-size: 14px; }
.line.off { opacity: .5; } .line.hl { border-inline-start-color: var(--clay); }
.card .line { box-shadow: none; padding: 9px 0; border-radius: 0; border-bottom: 1px solid var(--line); margin: 0; background: transparent; }
.card .line:last-child { border-bottom: 0; }
.roster { border-inline-start: 4px solid var(--c); } .roster.cancelled { opacity: .55; }
.roster-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; margin-bottom: 8px; }
.people { list-style: none; margin: 0 0 6px; padding: 0; }
.people li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.people li:last-child { border-bottom: 0; }
.note { font-size: 12px; color: var(--warn); }
.table-list { display: grid; gap: 6px; }
.trow { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; background: var(--surface); border: 0; border-radius: var(--r-sm); padding: 12px 14px; cursor: pointer; text-align: start; }
.trow:hover { box-shadow: var(--shadow); }
.client-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--surface); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 2px; box-shadow: var(--shadow); }
.stat small { color: var(--muted); font-size: 12px; } .stat b { font-size: 24px; font-weight: 600; } .stat span { font-size: 12px; color: var(--muted); }
.stat.dark { background: var(--olive); color: #fff; } .stat.dark small, .stat.dark span { color: #E3E4CC; }
.grid2 { display: grid; gap: 12px; } @media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.grid2 .card { margin: 0; } .grid2 + .grid2 { margin-top: 12px; } .grid2 + .btn { margin-top: 14px; }
.grid2 h4 { margin-bottom: 10px; }
.bars { display: flex; align-items: end; gap: 4px; height: 140px; direction: ltr; }
.bars .b { flex: 1; display: grid; grid-template-rows: 1fr auto; height: 100%; align-items: end; }
.bars .b i { display: block; background: var(--clay); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .b small { font-size: 9px; color: var(--muted); text-align: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin-top: 8px; font-size: 14px; } .kv span { color: var(--muted); }

/* Modal & toast */
.modal-wrap { position: fixed; inset: 0; background: rgba(30,42,43,.45); z-index: 100; display: grid; place-items: end center; animation: fade .15s; }
@media (min-width: 640px) { .modal-wrap { place-items: center; } }
.modal { background: var(--surface); width: min(480px, 100%); max-height: 90vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 20px; display: grid; gap: 14px; }
@media (min-width: 640px) { .modal { border-radius: 22px; } }
.modal.small { width: min(380px, 100%); } .modal p { white-space: pre-line; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.pick-list { display: grid; gap: 4px; max-height: 50vh; overflow: auto; }
.pick-list button { display: flex; justify-content: space-between; border: 0; background: var(--bg); border-radius: 10px; padding: 11px 12px; cursor: pointer; text-align: start; }
.toast { position: fixed; bottom: 96px; inset-inline: 16px; margin: auto; width: fit-content; max-width: 92vw; background: var(--olive-dark); color: #fff; padding: 11px 18px; border-radius: 14px; z-index: 200; opacity: 0; transform: translateY(10px); transition: .25s; font-size: 14px; }
.toast.show { opacity: 1; transform: none; } .toast.err { background: var(--danger); } .toast.warn { background: #8A5634; }
@keyframes fade { from { opacity: 0; } }

/* Install / notifications / announcements */
.row.between { justify-content: space-between; }
.card.install { border: 1.5px solid var(--clay); display: grid; gap: 12px; }
.install-head { display: flex; gap: 12px; align-items: center; } .install-head img { border-radius: 11px; flex: none; }
.steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 14px; }
.announce-banner { background: var(--clay-soft); border-radius: var(--r); padding: 12px 16px; margin-bottom: 10px; border-inline-start: 4px solid var(--clay); }
.announce-banner p { font-size: 14px; color: var(--ink2); margin-top: 2px; white-space: pre-line; }
.card.ann { display: grid; gap: 6px; } .card.ann.off { opacity: .55; } .card.ann p { white-space: pre-line; }
