:root {
  --bg: #0f0f11;
  --surface: #19191d;
  --surface-2: #222228;
  --line: #2e2e36;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #e8b04b;
  --on-accent: #17130a;
  --danger: #f87171;
  --ok: #4ade80;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
.display { font-family: "Playfair Display", Georgia, serif; font-weight: 700; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.ic { flex: none; vertical-align: middle; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- estrutura ---------- */
.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 20px 16px 40px; }
.wrap.narrow { max-width: 440px; }
.wrap.wide { max-width: 1040px; }
.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 28px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap-row { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h2 { margin-bottom: 4px; }
.card > .muted + * { margin-top: 14px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  background: var(--accent); color: var(--on-accent);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.danger { background: transparent; color: var(--danger); border-color: rgba(248, 113, 113, 0.4); }
.btn.danger:hover { background: rgba(248, 113, 113, 0.1); filter: none; }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 0.875rem; border-radius: 10px; }
.btn.icon-only { padding: 0; width: 44px; min-height: 44px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }

/* ---------- formulários ---------- */
label { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 6px; }
.field + .field { margin-top: 14px; }
.hint { color: var(--muted); font-size: 0.82rem; margin-top: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="date"], input[type="time"], select {
  width: 100%; min-height: 46px; padding: 0 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; font: inherit;
}
input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
input[type="file"] { width: 100%; font: inherit; color: var(--muted); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 0; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; font-weight: 500; cursor: pointer; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.flash { padding: 12px 14px; border-radius: 12px; border: 1px solid; font-size: 0.95rem; }
.flash.ok { border-color: rgba(74, 222, 128, 0.4); background: rgba(74, 222, 128, 0.08); color: #bbf7d0; }
.flash.erro { border-color: rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.08); color: #fecaca; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 0.92rem; }
.notice.warn { border-color: rgba(232, 176, 75, 0.5); }

/* ---------- cores da barbearia ---------- */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { position: relative; margin: 0; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.swatch span { display: block; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--text); }
.swatch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ---------- topo ---------- */
.topbar { border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar .inner { max-width: 1040px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; min-width: 0; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex: none; }
.logo.ph { display: grid; place-items: center; color: var(--accent); border: 1px solid var(--line); }
.logo.big { width: 84px; height: 84px; border-radius: 20px; }

/* ---------- navegação do painel ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; max-width: 1040px; margin: 0 auto; padding: 8px 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px;
  border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; font-size: 0.93rem;
}
.tabs a:hover { background: var(--surface-2); color: var(--text); }
.tabs a.on { background: var(--surface-2); color: var(--accent); }
.tabsbar { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }

/* ---------- link para compartilhar ---------- */
.share { display: flex; gap: 8px; flex-wrap: wrap; }
.share input { flex: 1 1 220px; font-size: 0.9rem; }

/* ---------- agenda ---------- */
.daystrip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: thin; }
.day {
  flex: none; width: 60px; min-height: 68px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font: inherit; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease;
}
.day small { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.day b { font-size: 1.2rem; line-height: 1.2; }
.day:hover { border-color: var(--muted); }
.day.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.day.on small { color: var(--on-accent); }
.day:disabled, .day.off { opacity: 0.35; cursor: not-allowed; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 1.5rem; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 0.85rem; }

.appt { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.appt .time { flex: none; width: 58px; text-align: center; }
.appt .time b { display: block; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.appt .time span { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.appt .body { flex: 1; min-width: 0; }
.appt .name { font-weight: 600; }
.appt .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.appt .actions form { margin: 0; }
.appt.is-cancelled, .appt.is-noshow { opacity: 0.6; }
.appt.is-block { border-style: dashed; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; border: 1px solid var(--line); color: var(--muted); }
.chip.booked { color: var(--accent); border-color: currentColor; }
.chip.done { color: var(--ok); border-color: currentColor; }
.chip.noshow, .chip.cancelled { color: var(--danger); border-color: currentColor; }

.empty { text-align: center; padding: 36px 16px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

/* ---------- listas editáveis ---------- */
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.item form { margin: 0; }
.item .cols { display: grid; grid-template-columns: 1fr; gap: 10px; }
.item .cols label { margin-bottom: 4px; font-size: 0.8rem; color: var(--muted); }
.item .btns { display: flex; gap: 8px; margin-top: 12px; }
@media (min-width: 640px) {
  .item .cols.svc { grid-template-columns: 2fr 1fr 1fr; }
  .item .cols.one { grid-template-columns: 1fr; }
}

.hours { display: grid; gap: 10px; }
.hrow { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.hrow .times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hrow .times label { font-size: 0.75rem; color: var(--muted); margin-bottom: 2px; }
@media (min-width: 720px) {
  .hrow { grid-template-columns: 150px 1fr; align-items: center; }
  .hrow .times.four { grid-template-columns: repeat(4, 1fr); }
}

table.list { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
table.list th, table.list td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { color: var(--muted); font-weight: 500; font-size: 0.8rem; }
.tablebox { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- página do cliente ---------- */
.shophead { text-align: center; padding: 28px 16px 8px; }
.shophead .logo { margin: 0 auto 12px; }
.shophead h1 { font-size: 1.7rem; }
.step-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.step-title .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 0.85rem; flex: none; }

.opt { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; margin: 0; min-height: 60px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-weight: 400;
  transition: border-color 0.15s ease, background 0.15s ease; }
.opt:hover { border-color: var(--muted); }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.opt .mark { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: transparent; }
.opt.round .mark { border-radius: 50%; }
.opt.on { border-color: var(--accent); background: var(--surface-2); }
.opt.on .mark { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.opt:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt .t { font-weight: 600; }
.opt .price { font-weight: 600; white-space: nowrap; }
.opts { display: grid; gap: 10px; }
.opts.two { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.slot { min-height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.slot:hover { border-color: var(--muted); }
.slot.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.bar { position: sticky; bottom: 0; margin: 28px -16px -40px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(15, 15, 17, 0.94); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
.bar .inner { max-width: 688px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.bar .sum { flex: 1; min-width: 0; }
.bar .sum b { display: block; }
.bar .sum span { color: var(--muted); font-size: 0.85rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.done-mark { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; margin: 0 auto 16px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- site de apresentação ---------- */
.hero { padding: 56px 16px 40px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 6.5vw, 3.4rem); max-width: 16ch; margin: 0 auto 16px; }
.hero h1 em { color: var(--accent); font-style: italic; }
.hero p { color: var(--muted); max-width: 46ch; margin: 0 auto 26px; font-size: 1.08rem; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.features { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.feature .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); margin-bottom: 12px; }
.feature p { color: var(--muted); margin-top: 6px; font-size: 0.95rem; }
.steps3 { counter-reset: s; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.steps3 .card::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; margin-bottom: 12px; }
.steps3 p { color: var(--muted); margin-top: 6px; font-size: 0.95rem; }
.foot { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 28px 16px; border-top: 1px solid var(--line); }

@media (min-width: 720px) {
  h1 { font-size: 1.9rem; }
  .stats { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- compra ---------- */
.pricetag { color: var(--text) !important; margin-bottom: 18px !important; }
.pricetag b { color: var(--accent); font-size: 1.25rem; }
.buy { text-align: center; }
.buy .price { font-size: 3rem; font-weight: 700; line-height: 1.1; color: var(--accent); }
.buy ul { list-style: none; padding: 0; margin: 18px auto; max-width: 320px; text-align: left; display: grid; gap: 10px; }
.buy li { display: flex; gap: 10px; align-items: flex-start; }
.buy li .ic { color: var(--ok); margin-top: 3px; }
