/* Studio 80 Afro Hair · Agenda
   Laranja da fachada, grafite do "80", branco do "AFRO HAIR". */
:root {
  --orange: #EE5A1F;
  --orange-600: #D84C14;
  --orange-50: #FFF1EA;
  --orange-100: #FDDCCB;
  --brand-ink: #1E1B19; /* grafite fixo da marca, igual no claro e no escuro */

  --ink: #161412;
  --ink-2: #45403B;
  --muted: #736C66;
  --line: #ECE6E0;
  --bg: #F6F3EF;
  --card: #FFFFFF;

  --ok: #15803D;
  --ok-bg: #E7F6EC;
  --warn: #C2410C;
  --warn-bg: #FFF1EA;
  --err: #DC2626;
  --err-bg: #FDECEC;
  --wa: #25D366;
  --wa-ink: #0B7A3B;
  --chat-bg: #EFE7DE;
  --bubble: #D9FDD3;
  --bubble-ink: #111B21;

  --radius: 18px;
  --tabbar-h: 66px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --orange-50: rgba(238, 90, 31, .12);
    --orange-100: rgba(238, 90, 31, .28);
    --ink: #F5F0EA;
    --ink-2: #D2CBC4;
    --muted: #8F8881;
    --line: #2C2826;
    --bg: #100E0D;
    --card: #1B1817;
    --ok: #4ADE80;
    --ok-bg: rgba(34, 197, 94, .14);
    --warn: #FB923C;
    --warn-bg: rgba(238, 90, 31, .14);
    --err: #F87171;
    --err-bg: rgba(220, 38, 38, .16);
    --wa-ink: #4ADE80;
    --chat-bg: #0B141A;
    --bubble: #005C4B;
    --bubble-ink: #E9EDEF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --orange-50: rgba(238, 90, 31, .12);
  --orange-100: rgba(238, 90, 31, .28);
  --ink: #F5F0EA;
  --ink-2: #D2CBC4;
  --muted: #8F8881;
  --line: #2C2826;
  --bg: #100E0D;
  --card: #1B1817;
  --ok: #4ADE80;
  --ok-bg: rgba(34, 197, 94, .14);
  --warn: #FB923C;
  --warn-bg: rgba(238, 90, 31, .14);
  --err: #F87171;
  --err-bg: rgba(220, 38, 38, .16);
  --wa-ink: #4ADE80;
  --chat-bg: #0B141A;
  --bubble: #005C4B;
  --bubble-ink: #E9EDEF;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.4;
  background: var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
body.sheet-open { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
.ic { flex: none; }
.muted { color: var(--muted); }
b { font-weight: 600; }

/* ---------- topo laranja ---------- */
.screen { max-width: 520px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 96px); }
.top {
  background: var(--orange);
  color: #fff;
  padding: calc(var(--safe-t) + 14px) 16px 18px;
  border-radius: 0 0 28px 28px;
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top-head h1 { margin: 22px 0 0; font-size: 36px; font-weight: 800; letter-spacing: -0.035em; line-height: 1; }
.top-head p { margin: 6px 0 0; font-weight: 500; opacity: .88; }

.brand { display: inline-flex; align-items: center; gap: 7px; color: #fff; }
.brand-80 { font-weight: 800; font-size: 34px; line-height: .8; letter-spacing: -0.05em; color: var(--brand-ink); }
.brand-bar { width: 2.5px; height: 28px; border-radius: 2px; background: var(--brand-ink); }
.brand-name { display: flex; flex-direction: column; font-weight: 800; font-size: 13px; line-height: .92; letter-spacing: .01em; }
.brand-name small { font-size: 6.5px; letter-spacing: .32em; font-weight: 700; margin-bottom: 2px; opacity: .95; }
.brand-africa { width: 15px; height: 16px; color: var(--brand-ink); align-self: flex-end; margin-left: -1px; }

.wa-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 14px 0 12px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .2); color: #fff; font-size: 13px; font-weight: 600;
}
.wa-pill.on { background: #fff; color: #0B7A3B; }

.days {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 18px -16px 0; padding: 0 16px; scroll-behavior: smooth;
}
.days::-webkit-scrollbar { display: none; }
.day {
  flex: 0 0 50px; height: 68px; border: 0; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: rgba(255, 255, 255, .15); color: #fff;
}
.day span { font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; opacity: .88; }
.day strong { font-size: 20px; font-weight: 700; line-height: 1; }
.day .dot { width: 5px; height: 5px; border-radius: 50%; }
.day .dot.has { background: #fff; }
.day.closed { opacity: .5; }
.day.today:not(.on) { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .75); }
.day.on { background: var(--brand-ink); opacity: 1; }
.day.on .dot.has { background: var(--orange); }

/* ---------- conteúdo ---------- */
.content { padding: 18px 16px 0; }
.day-summary { display: flex; justify-content: space-between; gap: 8px; margin: 2px 2px 12px; font-size: 14px; color: var(--muted); }
.day-summary b { color: var(--ink); }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.appt {
  position: relative; width: 100%;
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 15px 14px 15px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); text-align: left; transition: transform .12s;
}
.appt:active { transform: scale(.985); }
.appt::before { content: ''; position: absolute; left: -1px; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: var(--orange); }
.appt-time strong { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.appt-name { display: block; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-meta { display: block; margin-top: 1px; font-size: 13.5px; color: var(--muted); }
.appt-rems { display: flex; gap: 4px; }
.appt-row { position: relative; }
.appt.due { padding-right: 70px; }
.appt.due .appt-time strong { color: var(--orange); }
.appt-check {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 2px solid var(--orange); border-radius: 15px; background: var(--card); color: var(--orange);
  transition: background-color .15s, color .15s, transform .1s;
}
.appt-check:active { background: var(--orange); color: #fff; transform: translateY(-50%) scale(.94); }

.free {
  width: 100%; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 12px 10px 16px; border: 1.5px dashed color-mix(in srgb, var(--muted) 45%, transparent);
  border-radius: var(--radius); background: transparent; color: var(--ink); text-align: left;
  transition: border-color .15s, background-color .15s;
}
.free:active { background: var(--orange-50); border-color: var(--orange); }
.free-time { font-size: 16px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.free-main b { display: block; font-size: 15px; color: var(--ok); }
.free-main small { display: block; font-size: 13px; color: var(--muted); }
.free-add { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--orange-50); color: var(--orange); }
.appt.st-done::before { background: var(--ok); }
.appt.st-done .st { color: var(--ok); }
.appt.st-no_show::before { background: var(--err); }
.appt.st-no_show .st { color: var(--err); }
.appt.st-done, .appt.st-no_show { opacity: .7; }

.chip-rem {
  display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 8px;
  border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--muted); white-space: nowrap;
}
.chip-rem.ok { background: var(--ok-bg); color: var(--ok); }
.chip-rem.warn { background: var(--warn-bg); color: var(--warn); }
.chip-rem.err { background: var(--err-bg); color: var(--err); }
.chip-rem.wait { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }

.now {
  display: flex; align-items: center; gap: 8px; margin: 0 2px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange);
}
.now::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.now::after { content: ''; flex: 1; height: 2px; border-radius: 2px; background: var(--orange); }

.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty h3 { margin: 14px 0 4px; font-size: 20px; color: var(--ink); }
.empty p { margin: 0; }
.empty.small { padding: 28px 16px; list-style: none; }
.empty-africa { width: 58px; height: 64px; color: var(--orange-100); }

/* fila manual */
.manual { margin-bottom: 18px; padding: 14px; border: 1px solid var(--orange-100); border-radius: var(--radius); background: var(--orange-50); }
.manual-head { display: flex; gap: 12px; align-items: flex-start; }
.manual-ic { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 11px; background: var(--orange); color: #fff; }
.manual-head strong { display: block; font-size: 15.5px; }
.manual-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-2); }
.manual ul { list-style: none; margin: 12px 0 6px; padding: 0; }
.manual li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--orange-100); font-size: 14px; }
.link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--orange); font-size: 14px; font-weight: 600; }
.link.center { display: flex; margin: 10px auto 0; text-align: center; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 18px; border: 0; border-radius: 15px;
  font-size: 15.5px; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: transform .1s, background-color .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-600); }
.btn-ink { background: var(--brand-ink); color: #fff; }
.btn-soft { background: var(--bg); color: var(--ink); }
.btn-accent { background: var(--orange-50); color: var(--orange); box-shadow: inset 0 0 0 1.5px var(--orange); }
.btn-ghost { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-danger { background: var(--err-bg); color: var(--err); }
.btn-wa { background: var(--wa); color: #05301A; }
.btn-block { width: 100%; }
.btn-sm { height: 44px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn-lg { height: 58px; border-radius: 17px; font-size: 17px; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading[disabled] { opacity: 1; }
.btn.loading::after {
  content: ''; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px;
  border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
.btn-soft.loading::after, .btn-ghost.loading::after { border-color: var(--line); border-top-color: var(--orange); }
.btn.armed { background: var(--err); color: #fff; }

.cta {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
  display: inline-flex; align-items: center; gap: 8px; height: 58px; padding: 0 30px 0 24px;
  border: 0; border-radius: 999px; background: var(--orange); color: #fff; font-size: 17px; font-weight: 700;
  box-shadow: 0 0 0 5px var(--bg);
  transition: transform .12s, background-color .15s;
}
.cta:hover { background: var(--orange-600); }
.cta:active { transform: translateX(-50%) scale(.96); }

.tabbar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding: 0 max(0px, calc((100vw - 520px) / 2)) var(--safe-b);
  background: color-mix(in srgb, var(--card) 90%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.tabbar button.on { color: var(--orange); }

/* ---------- bottom sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 12, 10, .5); opacity: 0; transition: opacity .25s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 520px; max-height: 92dvh;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 20px calc(24px + var(--safe-b));
  border-radius: 28px 28px 0 0; background: var(--card);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .85, .25, 1);
}
.sheet-wrap.open .sheet { transform: none; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-handle { width: 40px; height: 5px; margin: 0 auto 6px; border-radius: 3px; background: var(--line); }
.sheet-x { position: absolute; top: 14px; right: 16px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--bg); color: var(--ink-2); }
.sheet-title { margin: 10px 48px 20px 0; font-size: 25px; font-weight: 800; letter-spacing: -0.025em; }

/* ---------- formulários ---------- */
.field { display: block; margin-bottom: 16px; }
.field > label, .field .label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field em { font-style: normal; font-weight: 500; color: var(--muted); }
input, select, textarea {
  width: 100%; min-height: 50px; padding: 13px 14px;
  border: 1.5px solid transparent; border-radius: 14px; outline: none;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 16px;
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s, background-color .15s;
}
textarea { resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); background: var(--card); }
input::placeholder, textarea::placeholder { color: var(--muted); }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238C857F' stroke-width='2'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}

.ac { position: relative; }
.ac-list {
  position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; right: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  box-shadow: 0 16px 32px -14px rgba(0, 0, 0, .3);
}
.ac-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: none; text-align: left; }
.ac-item + .ac-item { border-top: 1px solid var(--line); }
.ac-item small { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 15px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); font-size: 14.5px; font-weight: 600;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--card); }

/* Grade de serviços: ícone, nome, duração e valor. O mais pedido ocupa a linha inteira. */
.svc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.svc {
  position: relative; display: grid; gap: 10px; align-content: start; min-width: 0; padding: 12px; text-align: left;
  border: 1.5px solid var(--line); border-radius: 16px; background: var(--card);
  transition: border-color .15s, box-shadow .15s;
}
.svc.wide { grid-column: span 2; grid-template-columns: auto minmax(0, 1fr); align-items: center; padding-right: 108px; }
.svc-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--orange-50); color: var(--orange); transition: background-color .15s, color .15s; }
.svc-txt { min-width: 0; }
.svc-txt b { display: block; font-size: 15px; font-weight: 700; line-height: 1.2; }
.svc-txt small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.svc-badge { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); padding: 4px 9px; border-radius: 999px; background: var(--orange-50); color: var(--orange); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.svc-tick { position: absolute; top: 10px; right: 10px; display: none; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--orange); color: #fff; }
.svc.wide .svc-tick { top: 50%; right: 12px; transform: translateY(-50%); }
.svc.on { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
.svc.on .svc-ic { background: var(--orange); color: #fff; }
.svc.on .svc-tick { display: grid; }
.svc.on .svc-badge { right: 44px; }
.svc:not(.wide) .svc-badge { position: static; transform: none; justify-self: start; margin-top: -4px; }
.svc-total { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--orange-50); color: var(--ink); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.btn-price { margin-left: 4px; padding: 3px 9px; border-radius: 8px; background: rgba(255, 255, 255, .2); font-variant-numeric: tabular-nums; }

/* Serviços em Ajustes */
.svc-list { display: grid; gap: 10px; margin-bottom: 12px; }
.svc-row { display: grid; grid-template-columns: 44px 1fr 1fr 44px; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; }
.svc-row-ic { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 13px; background: var(--orange-50); color: var(--orange); }
.svc-name { grid-column: span 2; min-height: 44px; padding: 10px 12px; font-weight: 600; }
.svc-rm { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; color: var(--muted); }
.svc-num { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border-radius: 12px; background: var(--bg); font-size: 13px; color: var(--muted); }
.svc-num em { font-style: normal; font-weight: 600; }
.svc-num input { flex: 1; min-height: 0; width: 0; min-width: 2.5ch; padding: 0; border: 0; background: none; text-align: right; font-size: 16px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.svc-num input::-webkit-inner-spin-button, .svc-num input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.svc-num:focus-within { box-shadow: inset 0 0 0 1.5px var(--orange); }

.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slots-note { grid-column: 1 / -1; margin: 0 0 2px; font-size: 14px; }
.slot {
  height: 44px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card);
  font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.slot.on { background: var(--orange); border-color: var(--orange); color: #fff; }
.slot:disabled { background: var(--bg); border-color: transparent; color: var(--muted); text-decoration: line-through; cursor: default; }
.slot.past:disabled { text-decoration: none; opacity: .4; }
.slot-other { grid-column: span 2; font-size: 14px; }
.slot-custom { grid-column: span 2; min-height: 44px; padding: 8px 12px; }

.plan {
  display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 18px; padding: 11px 13px;
  border-radius: 13px; font-size: 13.5px; font-weight: 500; line-height: 1.35;
  background: color-mix(in srgb, var(--wa) 11%, transparent); color: var(--wa-ink);
}
.plan .ic { margin-top: 1px; }

/* ---------- detalhe ---------- */
/* Barra do topo do sheet: Editar à esquerda, fechar à direita, mesma linha e altura. */
.detail-head { display: flex; align-items: center; gap: 14px; margin: 58px 0 20px; }
.detail-title { flex: 1; min-width: 0; }
.sheet-edit {
  position: absolute; top: 14px; left: 16px; display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 16px 0 13px; border: 0; border-radius: 999px;
  background: var(--bg); color: var(--ink-2); font-size: 15px; font-weight: 600;
}
.actions-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 22px; }
.actions-2 + .resched { margin: -12px 0 22px; }
.resched-from { margin: -10px 0 18px; color: var(--muted); font-size: 14.5px; }
.link-danger { display: block; min-height: 44px; margin: 4px auto 0; padding: 0 18px; border: 0; background: none; color: var(--err); font-size: 15px; font-weight: 600; }
.detail-head h2 { margin: 0; font-size: 23px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.detail-head p { margin: 3px 0 0; color: var(--muted); font-size: 14.5px; }
.avatar {
  display: grid; place-items: center; flex: none; width: 54px; height: 54px; border-radius: 17px;
  background: var(--orange-50); color: var(--orange); font-size: 18px; font-weight: 800;
}
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.notes { margin: 0 0 18px; padding: 12px 14px; border-radius: 14px; background: var(--bg); color: var(--ink-2); font-size: 14.5px; }
.section-label { margin: 0 0 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.status-badge { display: inline-block; margin: -6px 0 16px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--bg); }
.status-badge.st-done { background: var(--ok-bg); color: var(--ok); }
.status-badge.st-no_show, .status-badge.st-canceled { background: var(--err-bg); color: var(--err); }

.rems { list-style: none; margin: 0 0 20px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.rem { display: flex; align-items: center; gap: 12px; padding: 13px 14px; }
.rem + .rem { border-top: 1px solid var(--line); }
.rem-ic { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px; background: var(--bg); color: var(--muted); }
.rem.ok .rem-ic { background: var(--ok-bg); color: var(--ok); }
.rem.warn .rem-ic { background: var(--warn-bg); color: var(--warn); }
.rem.err .rem-ic { background: var(--err-bg); color: var(--err); }
.rem.wait .rem-ic { background: var(--orange-50); color: var(--orange); }
.rem-txt { flex: 1; min-width: 0; }
.rem-txt b { display: block; font-size: 15px; }
.rem-txt small { display: block; color: var(--muted); font-size: 13px; }
.detail-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.history { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.history li + li { border-top: 1px solid var(--line); }
.history button { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; width: 100%; padding: 12px 14px; border: 0; background: none; text-align: left; }
.history span { color: var(--muted); font-size: 13.5px; }
.history em { grid-row: span 2; align-self: center; font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.history em.st-scheduled { color: var(--orange); }
.history em.st-done { color: var(--ok); }
.history em.st-no_show, .history em.st-canceled { color: var(--err); }

/* ---------- clientes ---------- */
.search {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--muted);
}
.search input { padding: 13px 0; border: 0; background: transparent; }
.search input:focus { background: transparent; border: 0; }
.new-client {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; margin: 0 0 18px;
  border: 1.5px dashed color-mix(in srgb, var(--orange) 55%, transparent); border-radius: 16px;
  background: var(--orange-50); color: var(--orange); font-size: 15.5px; font-weight: 700;
}
.new-client:active { background: var(--orange-100); }
.clients { list-style: none; margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.clients > li + li { border-top: 1px solid var(--line); }
.client { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: none; text-align: left; }
.client .avatar { width: 44px; height: 44px; border-radius: 14px; font-size: 15px; }
.client-main { flex: 1; min-width: 0; }
.client-main b { display: block; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-main small, .client-meta small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.client-meta { text-align: right; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }

/* ---------- ajustes ---------- */
.card { margin-bottom: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); }
.card-title { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 17px; font-weight: 700; }
.card-title .ic { color: var(--orange); }
.hint { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }
.hint:last-child { margin-bottom: 0; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-2 .field { margin-bottom: 12px; }

.wa-status { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.wa-status b { display: block; font-size: 16px; }
.wa-status small { display: block; color: var(--muted); font-size: 13px; }
.wa-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); }
.wa-dot.on { background: var(--wa); box-shadow: 0 0 0 5px color-mix(in srgb, var(--wa) 22%, transparent); }
.wa-test { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 10px; }
.wa-error { margin: 10px 0; color: var(--err); font-size: 13.5px; }
.pair-code {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 4px 0 14px; padding: 20px 12px; border-radius: 16px; background: var(--bg);
  font-size: 34px; font-weight: 800; letter-spacing: .14em; font-variant-numeric: tabular-nums;
}
.pair-code.loading { font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.icon-btn { position: absolute; right: 8px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 11px; background: var(--card); color: var(--ink-2); }
.qr { display: grid; place-items: center; width: 250px; height: 250px; margin: 4px auto 14px; padding: 10px; border-radius: 18px; background: #fff; }
.steps { list-style: none; counter-reset: step; margin: 0 0 14px; padding: 0; }
.steps li { counter-increment: step; display: flex; gap: 11px; padding: 6px 0; font-size: 14.5px; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; flex: none; width: 24px; height: 24px;
  border-radius: 50%; background: var(--orange); color: #fff; font-size: 12.5px; font-weight: 700;
}
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--line); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tpl .field { margin-bottom: 10px; }
.chat { margin: 0 0 18px; padding: 12px; border-radius: 14px; background: var(--chat-bg); }
.bubble {
  position: relative; max-width: 90%; margin-left: auto; padding: 8px 10px 20px;
  border-radius: 12px 12px 3px 12px; background: var(--bubble); color: var(--bubble-ink);
  font-size: 14.5px; line-height: 1.35; white-space: pre-wrap; box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
}
.bubble::after { content: '09:00 ✓✓'; position: absolute; right: 9px; bottom: 4px; font-size: 11px; color: #53BDEB; }
.vars { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.var { height: 36px; padding: 0 10px; border: 1px dashed var(--orange); border-radius: 9px; background: var(--orange-50); color: var(--orange); font-size: 13px; font-weight: 600; }

.chip.svc { padding-right: 6px; }
.chip.svc button { position: relative; display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--bg); color: var(--muted); }
.chip.svc button::after { content: ''; position: absolute; inset: -10px; }
.add-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }

.hours { display: flex; flex-direction: column; gap: 8px; }
.hours-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) 86px 86px; align-items: center; gap: 8px; min-height: 46px; }
.hours-row b { font-size: 15px; }
.hours-row input[type=time] { min-height: 42px; padding: 8px 6px; text-align: center; font-size: 15px; }
.hours-row.off b { color: var(--muted); }
.closed-label { grid-column: span 2; text-align: right; color: var(--muted); font-size: 14px; padding-right: 4px; }
.switch { position: relative; display: inline-block; width: 44px; height: 26px; }
.switch input { position: absolute; inset: -9px -4px; opacity: 0; min-height: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: var(--line); pointer-events: none; transition: background-color .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + span { background: var(--orange); }
.switch input:checked + span::after { transform: translateX(18px); }
.version { margin: 18px 0 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- login ---------- */
.login {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: calc(var(--safe-t) + 24px) 24px calc(var(--safe-b) + 24px); background: var(--orange); color: #fff;
}
.login-africa { width: 92px; height: 100px; color: var(--brand-ink); }
.login .brand { transform: scale(1.35); margin: 4px 0 26px; }
.login .brand-africa { display: none; }
.login-form { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 300px; }
.login-form label { text-align: center; font-weight: 600; opacity: .9; }
.login-form input { text-align: center; font-size: 28px; letter-spacing: .5em; padding-left: calc(14px + .5em); background: rgba(255, 255, 255, .2); color: #fff; }
.login-form input::placeholder { color: rgba(255, 255, 255, .6); }
.login-form input:focus { background: rgba(255, 255, 255, .28); border-color: transparent; }
.login-msg { margin: 0; padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, .2); text-align: center; font-weight: 500; }

/* ---------- toast ---------- */
#toasts {
  position: fixed; z-index: 100; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 92px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px;
}
.toast {
  max-width: 100%; padding: 12px 16px; border-radius: 14px; background: var(--brand-ink); color: #fff;
  font-size: 14.5px; font-weight: 600; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .5);
}
.toast.show { opacity: 1; transform: none; }
.toast-error { background: var(--err); }
.toast.has-action { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px; pointer-events: auto; }
.toast-action { min-height: 44px; padding: 0 14px; border: 0; border-radius: 11px; background: rgba(255, 255, 255, .12); color: #FFA77D; font-size: 14.5px; font-weight: 700; }

@media (hover: hover) {
  .appt:hover { border-color: var(--orange-100); }
  .chip:hover, .slot:not(:disabled):not(.on):hover { border-color: var(--orange); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
