:root {
  --bg: #faf7f5; --card: #fff; --ink: #1f1a19; --muted: #7f7470; --line: #ece4e0;
  --brand: #a5644b; --brand-soft: #f6ebe6; --gold: #c48d78; --dark: #141110;
  --ok: #2f7d5b; --ok-soft: #e3f2ea; --bad: #b4443c; --bad-soft: #f8e4e2; --warn: #a86b12; --warn-soft: #fbefd9;
  --r: 14px; --nav-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 Inter, system-ui, -apple-system, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); }
.loading { padding: 40vh 0; text-align: center; color: var(--muted); }

header.top { position: sticky; top: 0; z-index: 5; background: var(--dark);
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; }
.brand { font-family: Quicksand, system-ui, sans-serif; font-weight: 600; font-size: 15px; line-height: 1.1; color: var(--gold); display: flex; align-items: center; gap: 10px; }
.brand img { height: 38px; width: auto; }
.brand small { display: block; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.badge-demo { font: 600 11px Inter, sans-serif; background: var(--warn-soft); color: var(--warn); padding: 2px 8px; border-radius: 99px; }
main { padding: 12px 16px; }

nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); }
nav.tabs .in { display: flex; width: 100%; max-width: 640px; }
nav.tabs button { flex: 1; height: var(--nav-h); border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
nav.tabs button svg { width: 22px; height: 22px; }
nav.tabs button.on { color: var(--brand); }

.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h2 { font-size: 17px; margin: 18px 0 8px; }
h3 { font-size: 14px; margin: 14px 0 6px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.nav-date { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.nav-date .label { flex: 1; text-align: center; font-weight: 600; }
.nav-date .label::first-letter { text-transform: uppercase; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 18px; display: grid; place-items: center; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; }
.card.tap { cursor: pointer; }
.ag { display: flex; gap: 12px; border-left: 4px solid var(--brand); }
.ag.st-concluido { border-left-color: var(--ok); }
.ag.st-cancelado { border-left-color: var(--line); opacity: .6; }
.ag.st-faltou { border-left-color: var(--bad); }
.ag .hora { font-weight: 600; min-width: 48px; }
.ag .hora small { display: block; font-weight: 400; color: var(--muted); }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.gray { background: #eee; color: #666; }
.gap { color: var(--muted); font-size: 12px; text-align: center; padding: 2px 0 8px; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; }
.kpi .v { font-weight: 600; font-size: 15px; margin-top: 2px; }
.kpi .l { font-size: 11px; color: var(--muted); }
.pos { color: var(--ok); } .neg { color: var(--bad); }

.item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .t { font-weight: 500; }
.item .val { font-weight: 600; white-space: nowrap; }

.bar { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; margin: 8px 0; font-size: 13px; }
.bar .track { grid-column: 1 / -1; height: 8px; background: var(--brand-soft); border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--brand); border-radius: 99px; }
.bar.out .track { background: var(--bad-soft); } .bar.out .fill { background: var(--bad); }

.seg { display: flex; background: #efe8e4; border-radius: 12px; padding: 3px; margin-bottom: 10px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 10px; font-weight: 500; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.fab { position: fixed; right: max(16px, calc(50% - 304px)); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); z-index: 7;
  width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--brand); color: #fff; font-size: 28px; box-shadow: 0 6px 18px rgba(165,100,75,.35); }

.btn { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 600; background: var(--brand); color: #fff; }
.btn.sec { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ok { background: var(--ok); } .btn.bad { background: #fff; color: var(--bad); border: 1px solid var(--bad-soft); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }

label.f { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); font-weight: 500; }
label.f input, label.f select, label.f textarea, .search { display: block; width: 100%; margin-top: 4px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 16px; color: var(--ink); }
label.f textarea { min-height: 64px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.check input { width: 20px; height: 20px; }
.err { background: var(--bad-soft); color: var(--bad); padding: 8px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 10px; }
.hint { background: var(--brand-soft); color: var(--brand); padding: 10px 12px; border-radius: 12px; font-size: 13px; margin-bottom: 10px; }

.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(20,17,16,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
.sheet .hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sheet .hd b { font-size: 17px; }
.x { border: 0; background: none; font-size: 26px; color: var(--muted); line-height: 1; }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 90px); transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
#toast.show { opacity: 1; }

.login { max-width: 380px; margin: 0 auto; padding: 18vh 24px 0; }
.login .brand { justify-content: center; font-size: 30px; margin-bottom: 24px; }
a.wa { color: var(--ok); font-weight: 600; text-decoration: none; }
.selos { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.selos span { width: 22px; height: 22px; border-radius: 50%; border: 2px dashed var(--gold); }
.selos span.on { background: var(--gold); border-style: solid; }
nav.tabs button { font-size: 10.5px; }
.f-lbl { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.ac { margin-bottom: 10px; }
.ac .search { margin-top: 0; }
.icon-btn.add { width: 46px; height: 46px; background: var(--brand); color: #fff; border: 0; font-size: 24px; flex: none; }
.ac-list { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-top: 4px; overflow: hidden; }
.ac-list:empty { display: none; }
.ac-list button { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; padding: 12px; border: 0; border-bottom: 1px solid var(--line); background: #fff; }
.ac-list button:last-child { border-bottom: 0; }
.ac-list button.novo { color: var(--brand); font-weight: 600; background: var(--brand-soft); }
.card.sel { margin: 0; border-color: var(--brand); background: var(--brand-soft); }
.card.nova { margin: 0; }
.link { border: 0; background: none; color: var(--brand); font-weight: 600; padding: 4px; }
[hidden] { display: none !important; }
.ver { border: 1px solid #3a3330; background: transparent; color: var(--gold); font-size: 12px; font-weight: 600; border-radius: 99px; padding: 3px 10px; }
.actions.three { grid-template-columns: 1fr 1fr 1fr; }
.actions.three .btn { padding: 12px 6px; }
.three-col { display: grid; grid-template-columns: 0.8fr 1.4fr 1.2fr; gap: 6px; margin-bottom: 10px; }
.three-col .search { margin-top: 0; padding: 11px 8px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.block-center { display: block; margin: 16px auto; font-size: 13px; }
.warn-hint { background: var(--warn-soft); color: var(--warn); }
.block-btn { display: block; width: 100%; text-align: left; border: 0; font: inherit; font-size: 13px; }
.pend { padding: 8px 0; border-top: 1px solid var(--line); margin-top: 6px; cursor: pointer; }
.pend.alerta span, .pend.alerta b { color: var(--warn); }
.nav-date .pick { position: relative; cursor: pointer; padding: 8px 4px; border-radius: 10px; }
.nav-date .pick:active { background: var(--brand-soft); }
.nav-date .pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; }
.cal-ico { color: var(--brand); font-size: 12px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-h { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); padding: 2px 0; }
.cal-d { min-height: 64px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 3px 2px; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; line-height: 1.15; }
.cal-d .n { font-weight: 600; color: var(--muted); font-size: 11px; margin-bottom: 1px; }
.cal-d.tem .n { color: var(--ink); }
.cal-d.hoje { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal-d .r { color: var(--ok); font-weight: 600; }
.cal-d .p { color: #6b6064; }
.cal-d .a { color: var(--warn); font-weight: 600; }
.legenda { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 4px; color: var(--muted); }
.legenda i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
.legenda i.r { background: var(--ok); } .legenda i.p { background: #8a7f83; } .legenda i.a { background: var(--warn); }
table.tab { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tab th { text-align: right; font-weight: 600; color: var(--muted); font-size: 11px; padding: 4px 2px; }
table.tab td { text-align: right; padding: 7px 2px; border-top: 1px solid var(--line); white-space: nowrap; }
table.tab td:first-child, table.tab th:first-child { text-align: left; white-space: normal; }
table.tab tr.tot td { font-weight: 700; }
td.warn { color: var(--warn); font-weight: 600; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.view-btn { font-weight: 600; color: var(--brand); border-color: var(--brand); }
.opt { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 14px 6px; font-size: 16px; }
.opt:last-child { border-bottom: 0; }
.opt.on { color: var(--brand); font-weight: 600; }
.blq-card { background: repeating-linear-gradient(135deg, #f1ecea, #f1ecea 8px, #e9e2df 8px, #e9e2df 16px); color: #5c5357; }
/* grade de horários */
.tl-wrap { margin: 0 -16px; padding: 0 16px; overflow-x: auto; }
.tl { min-width: 100%; }
.tl-wrap.largo .tl { min-width: calc(44px + var(--ncols) * 52px); }
.tl-top, .tl-body { display: grid; grid-template-columns: 44px repeat(var(--ncols), minmax(0, 1fr)); }
.tl-top { position: sticky; top: 0; z-index: 2; background: var(--bg); }
.tl-tit { text-align: center; font-size: 12px; font-weight: 600; padding: 4px 2px 6px; text-transform: capitalize; }
.tl-horas { position: relative; }
.tl-h { position: absolute; right: 6px; transform: translateY(-50%); font-size: 10.5px; color: var(--muted); }
.tl-h:first-child { transform: none; }
.tl-col { position: relative; border-left: 1px solid var(--line); background-color: #fff; cursor: pointer;
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); }
.tl-col:last-child { border-right: 1px solid var(--line); }
.tl-col.hoje { background-color: #fffaf6; }
.tl-ev { position: absolute; border-radius: 6px; padding: 2px 4px; overflow: hidden; font-size: 11px; line-height: 1.2; cursor: pointer; z-index: 1;
  background: color-mix(in srgb, var(--c) 16%, white); border-left: 3px solid var(--c); color: #2b2226; }
.tl-ev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-ev span { display: block; color: #6b6064; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-ev.st-concluido { background: color-mix(in srgb, var(--ok) 14%, white); border-left-color: var(--ok); }
.tl-ev.st-cancelado { opacity: .4; text-decoration: line-through; }
.tl-ev.st-faltou { background: var(--bad-soft); border-left-color: var(--bad); }
.tl-blq { position: absolute; left: 0; right: 0; z-index: 0; cursor: pointer; overflow: hidden;
  background: repeating-linear-gradient(135deg, rgba(120,110,114,.16), rgba(120,110,114,.16) 6px, rgba(120,110,114,.06) 6px, rgba(120,110,114,.06) 12px); }
.tl-blq span { display: block; font-size: 10.5px; color: #5c5357; padding: 2px 4px; font-weight: 600; }
.tl-agora { position: absolute; left: -1px; right: 0; height: 2px; background: var(--bad); z-index: 3; pointer-events: none; }
.tl-agora::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.cal-d .mc { font-weight: 700; font-size: 11px; }
.cal-d.blq { background: repeating-linear-gradient(135deg, #fff, #fff 6px, #f3eeec 6px, #f3eeec 12px); }

/* ---- Pilates ---- */
.login .brand { flex-direction: column; text-align: center; color: var(--brand); font-size: 22px; }
.login .brand img { height: 110px; }
.login-wrap { background: var(--dark); border-radius: 20px; padding: 20px; margin-bottom: 20px; display: flex; justify-content: center; }
.hello { font-family: Quicksand, sans-serif; font-weight: 600; font-size: 20px; margin: 14px 0 2px; }
.kpis.two-k { grid-template-columns: 1fr 1fr; }
.kpi.alert .v { color: var(--bad); }
.kpi.tap { cursor: pointer; }
.cob { display: flex; justify-content: space-between; gap: 10px; align-items: center; border-left: 4px solid var(--line); }
.cob.aberta { border-left-color: var(--gold); }
.cob.hoje { border-left-color: var(--warn); }
.cob.atrasada { border-left-color: var(--bad); }
.cob.paga { border-left-color: var(--ok); }
.cob.cancelada { opacity: .55; }
.cob .t { font-weight: 600; }
.cob .val { font-weight: 700; white-space: nowrap; text-align: right; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.avatar.off { background: #eee; color: #999; }
.slot { display: flex; gap: 12px; align-items: flex-start; }
.slot .hora { font-weight: 700; min-width: 48px; padding-top: 2px; }
.slot .names { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.slot .vagas { font-size: 12px; font-weight: 600; white-space: nowrap; padding-top: 3px; }
.nm { border: 1px solid var(--line); background: var(--brand-soft); color: var(--ink); border-radius: 99px; padding: 4px 10px; font-size: 13px; }
.nm.avulsa { background: #eef3fb; border-color: #d6e2f3; }
.nm.reposicao { background: #eef7f1; border-color: #d3eadb; }
.nm.experimental { background: #fbf3e4; border-color: #f0e0bf; }
.nm.falta { background: #fff; color: var(--muted); text-decoration: line-through; }
.nm .tg { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-left: 4px; color: var(--muted); }
.vazio { color: var(--muted); font-size: 13px; font-style: italic; padding-top: 3px; }
.grade { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.grade th { font-weight: 600; color: var(--muted); font-size: 11px; text-transform: capitalize; }
.grade td { text-align: center; border-radius: 8px; padding: 7px 0; background: #fff; border: 1px solid var(--line); cursor: pointer; font-weight: 600; }
.grade td.h { background: none; border: 0; color: var(--muted); font-weight: 500; cursor: default; text-align: right; padding-right: 4px; }
.grade td.l0 { color: #c7bdb9; font-weight: 500; }
.grade td.l1 { background: var(--brand-soft); color: var(--brand); }
.grade td.l2 { background: #ecc9ba; color: #7c4532; }
.grade td.cheio { background: var(--brand); color: #fff; border-color: var(--brand); }
.hor-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; margin-bottom: 8px; }
.hor-row select { padding: 11px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 16px; width: 100%; }
.hor-row .oc { grid-column: 1 / -1; font-size: 12px; margin-top: -4px; }
.canais { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.canal { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 6px; text-align: center; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink); display: block; }
.canal.wa { color: #1c7d4d; border-color: #cfe9da; background: #f1faf5; }
.canal.sms { color: #3d5a9a; border-color: #d6e0f3; background: #f3f6fc; }
.canal.em { color: var(--brand); border-color: #ecd5ca; background: var(--brand-soft); }
.canal.done { opacity: .45; }
.canal[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.lem { padding: 10px 0; border-bottom: 1px solid var(--line); }
.lem:last-child { border-bottom: 0; }
.auto-box { background: var(--dark); color: #eee; border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; font-size: 13px; }
.auto-box b { color: var(--gold); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.switch input { width: 46px; height: 26px; appearance: none; background: #ddd; border-radius: 99px; position: relative; transition: background .15s; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { left: 23px; }
.regra { display: grid; grid-template-columns: auto 1fr 84px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.regra:last-child { border-bottom: 0; }
.regra input[type=number] { padding: 8px; border: 1px solid var(--line); border-radius: 10px; width: 100%; font-size: 15px; }
.regra input[type=checkbox] { width: 20px; height: 20px; }
.precos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.precos label.f input { padding: 10px 6px; font-size: 15px; }
.tl-log { font-size: 12px; color: var(--muted); padding: 4px 0; border-top: 1px dashed var(--line); }
.mini-bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; padding: 8px 2px 0; }
.mini-bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 10.5px; color: var(--muted); gap: 3px; }
.mini-bars .b i { display: block; width: 100%; max-width: 34px; background: var(--gold); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.mini-bars .b.cur i { background: var(--brand); }
.mini-bars .b em { font-style: normal; font-weight: 600; color: var(--ink); font-size: 10px; }
.cake { font-size: 13px; }
