/* =========================================================
   Design system — Agenda & Clube
   O tema vem do atributo <html data-tema="barbearia | salao">
   A cor de destaque pode ser trocada pela loja (--accent).
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Barbearia: escuro, dourado, tipografia condensada e marcante */
:root,
:root[data-tema="barbearia"] {
  color-scheme: dark;
  --bg: #0c0c0e;
  --bg-elev: #131316;
  --surface: #18181c;
  --surface-2: #212126;
  --border: #2a2a31;
  --border-strong: #3b3b44;
  --text: #f3efe6;
  --text-2: #c9c4b8;
  --muted: #8f8a80;
  --accent: #d4a24c;
  --accent-ink: #17120a;

  --ok: #5fd38d;      --ok-bg: rgba(95, 211, 141, .12);
  --warn: #f0b357;    --warn-bg: rgba(240, 179, 87, .13);
  --danger: #f2766b;  --danger-bg: rgba(242, 118, 107, .13);
  --whats: #3ddc7c;   --whats-bg: rgba(61, 220, 124, .12);

  --font-display: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  --display-case: uppercase;
  --display-track: .035em;
  --display-weight: 400;
  --h2-size: 1.55rem;

  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 9px;
  --radius-btn: 9px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 14px 34px rgba(0, 0, 0, .35);

  --hero-bg:
    linear-gradient(180deg, transparent 40%, var(--bg)),
    repeating-linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 9%, transparent) 0 14px,
      transparent 14px 28px),
    #101013;
}

/* Salão: claro, rosé/nude, serifa elegante, formas arredondadas */
:root[data-tema="salao"] {
  color-scheme: light;
  --bg: #fbf6f2;
  --bg-elev: #fdf9f6;
  --surface: #ffffff;
  --surface-2: #f6ede7;
  --border: #eddfd6;
  --border-strong: #dbc8bc;
  --text: #2d2023;
  --text-2: #5d4a4f;
  --muted: #97858b;
  --accent: #b4637a;
  --accent-ink: #ffffff;

  --ok: #2f8f5b;      --ok-bg: #e4f4ea;
  --warn: #b0731b;    --warn-bg: #fbf0dc;
  --danger: #c0392b;  --danger-bg: #fbe6e3;
  --whats: #1a9d4f;   --whats-bg: #e2f6ea;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --display-case: none;
  --display-track: -.01em;
  --display-weight: 600;
  --h2-size: 1.3rem;

  --radius-lg: 24px;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-btn: 999px;
  --shadow: 0 16px 40px rgba(140, 80, 92, .09);

  --hero-bg:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 46%),
    radial-gradient(circle at 88% 0%, rgba(233, 184, 160, .45), transparent 42%),
    radial-gradient(circle at 70% 100%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 50%),
    #f6ece6;
}

:root {
  --accent-soft: color-mix(in srgb, var(--accent) 15%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 45%, transparent);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-track);
  text-transform: var(--display-case);
  line-height: 1.1;
}

button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
svg { display: block; flex-shrink: 0; }
i[data-icon] { display: inline-flex; font-style: normal; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.eyebrow {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); overflow-wrap: break-word; }

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 35%, transparent);
}
[data-tema="salao"] .brand-mark { border-radius: 50%; }
.brand-mark.com-logo { overflow: hidden; background: var(--surface); padding: 0; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  background: var(--surface-2);
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s var(--ease), background-color .2s, border-color .2s, color .2s, filter .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }

.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }

.btn-icon { padding: 9px; aspect-ratio: 1; }
.btn-sm { padding: 6px 11px; font-size: .8rem; }
.btn-sm.btn-icon { padding: 7px; }
.btn-block { width: 100%; }

.btn-whats { background: var(--whats-bg); color: var(--whats); }
.btn-whats:hover { filter: brightness(1.1); }
.btn-ok { background: var(--ok-bg); color: var(--ok); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-del { background: transparent; color: var(--muted); border-color: transparent; }
.btn-del:hover { background: var(--danger-bg); color: var(--danger); }

.btn.carregando { position: relative; color: transparent !important; }
.btn.carregando::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--accent-ink);
  border-right-color: transparent;
  animation: girar .7s linear infinite;
}
.btn-ghost.carregando::after { border-color: var(--text); border-right-color: transparent; }

@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Formulários ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
}
.form-stack { display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .field-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .02em;
}

input, select {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
input::placeholder { color: var(--muted); opacity: .85; }
input:hover, select:hover { border-color: var(--border-strong); }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23908a82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.form-grid .btn { min-height: 44px; }

/* =========================================================
   PAINEL (index.html)
   ========================================================= */
.app { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 24px;
}
.topbar-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Indicadores */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.stat::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--accent-soft);
  opacity: .6;
}
.stat-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 10px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}
.stat-label { font-size: .8rem; font-weight: 500; color: var(--muted); }
.stat strong {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-track);
  font-size: 2rem;
  line-height: 1.15;
}
.stat small { font-size: .78rem; color: var(--muted); }

/* Abas */
.tabs {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
}
.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent); color: var(--accent-ink); }

/* Painéis */
.panel {
  padding: 20px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.panel h2 { font-size: var(--h2-size); display: flex; align-items: center; gap: 10px; }
.panel h2 i { color: var(--accent); }
.panel-sub { margin-top: 4px; font-size: .85rem; color: var(--muted); }

/* minmax(0, 1fr): a coluna pode encolher até caber na tela, mesmo com conteúdo largo dentro */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2 > * { min-width: 0; }
.grid-2 .panel { margin-bottom: 0; }
.grid-2 + .grid-2, .panel + .grid-2 { margin-top: 16px; }

.date-nav { display: flex; align-items: center; gap: 6px; }
.date-nav input { width: auto; min-height: 40px; padding: 7px 10px; }

/* Listas */
.lista { display: flex; flex-direction: column; gap: 8px; }
.lista-sep { margin-top: 14px; }

.item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s, transform .2s var(--ease);
  animation: entrar .3s var(--ease) both;
}
.item:hover { border-color: var(--border-strong); }
.item-compacto { padding: 9px 12px; }

.item-hora {
  min-width: 66px;
  padding: 6px 10px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 1.3rem;
  letter-spacing: var(--display-track);
  line-height: 1.2;
}
.item-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .82rem;
  font-weight: 700;
}
.item-compacto .item-avatar { width: 34px; height: 34px; font-size: .75rem; }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-main strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-main span { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-lado { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.item-acoes { display: flex; align-items: center; gap: 4px; }
.item-preco { font-weight: 600; color: var(--text-2); font-size: .9rem; }

@keyframes entrar { from { opacity: 0; transform: translateY(4px); } }

/* Selos */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-neutro { background: var(--surface-2); color: var(--text-2); }
.badge-neutro::before { display: none; }

/* Estado vazio e carregando */
.vazio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 16px;
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.vazio svg { color: var(--accent); }

.skeleton {
  height: 62px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2));
  background-size: 200% 100%;
  animation: brilho 1.2s infinite;
}
@keyframes brilho { to { background-position: -200% 0; } }

/* Aparência (escolha do tema) */
.tema-opcoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tema-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  background: var(--bg-elev);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.tema-card input { position: absolute; opacity: 0; pointer-events: none; }
.tema-card:hover { border-color: var(--border-strong); }
.tema-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tema-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.tema-preview {
  height: 64px;
  margin-bottom: 8px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: calc(var(--radius) - 4px);
}
.tema-preview i { width: 22px; height: 22px; border-radius: 50%; background: currentColor; }
.tema-card-barbearia .tema-preview {
  background: repeating-linear-gradient(135deg, #1b1b1f 0 10px, #141417 10px 20px);
  color: #d4a24c;
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 1.9rem;
  letter-spacing: .04em;
}
.tema-card-barbearia .tema-preview i { border-radius: 6px; }
.tema-card-salao .tema-preview {
  background: radial-gradient(circle at 20% 30%, #f3d3db, transparent 60%), #fbf3ee;
  color: #b4637a;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.7rem;
}
.tema-nome { font-weight: 600; font-size: .9rem; }
.tema-card small { font-size: .75rem; color: var(--muted); }

.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.swatch {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--sw);
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .2s;
}
.swatch:hover { transform: scale(1.08); }
.swatch.ativo { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw); }
.swatch-custom {
  overflow: hidden;
  background: conic-gradient(#f43f5e, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef, #f43f5e);
}
.swatch-custom input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

/* Botão de avisos (sino) */
.btn-avisos.ativo { color: var(--accent); border-color: var(--accent-line); }
.btn-avisos.pendente { position: relative; }
.btn-avisos.pendente::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--bg);
}

/* Cartão de "novo agendamento" */
.avisos-novos {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  width: min(400px, calc(100% - 32px));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.aviso-novo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  background: var(--surface);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .3);
  animation: avisoEntra .4s var(--ease);
  transition: opacity .3s, transform .3s;
}
.aviso-novo.saindo { opacity: 0; transform: translateX(16px); }
.aviso-novo-icone {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  animation: sino 1s var(--ease) 2;
}
.aviso-novo-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .85rem; }
.aviso-novo-texto span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.aviso-fechar {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
}
.aviso-fechar:hover { background: var(--surface-2); color: var(--text); }
@keyframes avisoEntra { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
@keyframes sino { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(4deg); } }

.instalar-dicas strong { display: block; margin-bottom: 4px; font-size: .9rem; }
.instalar-dicas p { font-size: .85rem; color: var(--text-2); }

/* Atalhos para próximos dias com agendamentos */
.proximos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.proximos-titulo { font-size: .8rem; color: var(--muted); margin-right: 2px; }
.chip-dia { padding: 6px 8px 6px 14px; font-size: .82rem; font-weight: 600; cursor: pointer; }
.chip-dia:hover { border-color: var(--accent); }
.chip-dia b {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .72rem;
}

/* Bloqueios na agenda: listrado e apagado, para não confundir com cliente */
.item-bloqueio {
  background: repeating-linear-gradient(135deg, var(--bg-elev) 0 10px, var(--surface-2) 10px 20px);
  border-style: dashed;
}
.item-bloqueio .item-hora { background: var(--surface-2); color: var(--muted); }
.item-bloqueio .item-main strong { color: var(--text-2); }
.badge svg { display: inline-block; }
.badge:has(svg)::before { display: none; }

/* Janela larga (horários de um profissional) */
.dialog { max-height: calc(100dvh - 32px); overflow-y: auto; overflow-x: hidden; }
.dialog.dialog-largo { width: min(600px, calc(100% - 24px)); }
.dialog .semana { gap: 6px; }

/* =========================================================
   Caixa do dia
   ========================================================= */
.caixa-dia {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .88rem;
}
.caixa-dia[hidden] { display: none; }
.caixa-linha { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.caixa-rotulo { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; }
.caixa-rotulo svg { color: var(--accent); }
.caixa-formas { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .82rem; }
.caixa-formas b { color: var(--text); font-weight: 600; }
.caixa-falta { color: var(--warn); font-size: .82rem; }
.caixa-ok { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); font-size: .82rem; font-weight: 600; }

/* =========================================================
   Lembretes
   ========================================================= */
.faixa-lembretes {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
}
.faixa-lembretes[hidden] { display: none; }
.faixa-icone {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}
.faixa-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .88rem; }
.faixa-texto span { color: var(--text-2); font-size: .82rem; }
.seg-mini { margin-bottom: 0; }
.seg-mini button { padding: 8px; }
.lem-item.enviado { opacity: .6; }
.lem-item .item-lado { gap: 6px; }
#dlg-lembretes .lista { max-height: 45vh; overflow-y: auto; }

@media (max-width: 560px) {
  .faixa-lembretes { flex-wrap: wrap; }
  .faixa-lembretes .btn { width: 100%; }
  #btn-lembretes span { display: none; }
  #btn-lembretes { padding: 9px; }
}

/* =========================================================
   Clientes
   ========================================================= */
textarea {
  width: 100%;
  min-height: 70px;
  padding: 10px 13px;
  resize: vertical;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .95rem;
  color: inherit;
  transition: border-color .2s, box-shadow .2s;
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.cli-filtros { display: grid; grid-template-columns: 1fr 210px; gap: 10px; }
.item-clicavel { cursor: pointer; }
.item-clicavel:hover { border-color: var(--accent-line); }
.item-clicavel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.item-main .item-nota {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 500;
  white-space: normal;
}
.item-nota svg { flex-shrink: 0; }
.badge svg { flex-shrink: 0; }

.dica-cliente {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-size: .82rem;
  color: var(--accent);
}
.dica-cliente[hidden] { display: none; }

.ficha-topo { display: flex; align-items: center; gap: 14px; }
.ficha-topo h3 { margin-bottom: 2px; overflow-wrap: break-word; }
.ficha-avatar { width: 52px; height: 52px; font-size: 1rem; }
.ficha-numeros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ficha-numeros > div {
  display: flex;
  flex-direction: column;
  padding: 10px;
  text-align: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.ficha-numeros strong { font-size: .95rem; }
.ficha-numeros span { font-size: .72rem; color: var(--muted); }
.ficha-acoes { display: flex; flex-wrap: wrap; gap: 6px; }
.dialog .aviso { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: var(--text); }
.ficha-hist { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.hist-linha {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  padding: 8px 12px;
  font-size: .83rem;
  border-bottom: 1px solid var(--border);
}
.hist-linha:last-child { border-bottom: 0; }
.hist-linha span:first-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.hist-linha span:last-child { font-weight: 600; }
.hist-linha.cancelado { opacity: .5; text-decoration: line-through; }

@media (max-width: 560px) {
  .cli-filtros { grid-template-columns: 1fr; }
  .ficha-numeros { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   Relatórios
   ========================================================= */
.rel-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.kpi-label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.kpi-valor {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-track);
  font-size: 1.75rem;
  line-height: 1.15;
}
.kpi-delta { font-size: .78rem; font-weight: 600; }
.kpi-delta.bom { color: var(--ok); }
.kpi-delta.ruim { color: var(--danger); }
.kpi-delta.neutro { color: var(--muted); }
.kpi small { font-size: .75rem; color: var(--muted); line-height: 1.35; margin-top: 2px; }

/* Gráfico de colunas (uma série: cor de destaque da loja) */
.grafico { display: grid; grid-template-columns: 26px 1fr; grid-template-rows: 170px auto; column-gap: 6px; }
.g-eixo-y { position: relative; }
.g-eixo-y span {
  position: absolute;
  right: 0;
  transform: translateY(50%);
  font-size: .68rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.g-area {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;                                   /* respiro entre as colunas */
  border-bottom: 1px solid var(--border-strong);
}
.g-linha { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); pointer-events: none; }
.g-col {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  cursor: pointer;
  outline: none;
}
.g-barra {
  width: 100%;
  max-width: 24px;
  border-radius: 4px 4px 0 0;                 /* topo arredondado, base reta */
  background: var(--accent);
  transition: filter .15s;
}
.g-barra.futuro { opacity: .35; }
.g-col.ativo .g-barra { filter: brightness(1.18); }
.g-valor {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-2);
  pointer-events: none;
}
.g-tooltip {
  position: absolute;
  top: 0;
  z-index: 5;
  transform: translate(-50%, -100%);
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: .78rem;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}
.g-tooltip em { opacity: .7; }
.g-eixo-x { grid-column: 2; display: flex; gap: 2px; padding-top: 4px; }
.g-eixo-x span { flex: 1; min-width: 0; text-align: center; font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.tabela-dados { margin-top: 14px; }
.tabela-dados summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
.tabela-dados summary:hover { color: var(--accent); }
.tabela { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: .85rem; }
.tabela th, .tabela td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.tabela th { color: var(--muted); font-weight: 600; font-size: .75rem; }
.tabela td:nth-child(n+2), .tabela th:nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; }

/* Rankings com barra fina */
.ranking { display: flex; flex-direction: column; gap: 12px; }
.rank-topo { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; margin-bottom: 5px; }
.rank-topo strong { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-topo span { color: var(--muted); white-space: nowrap; font-size: .8rem; }
.rank-trilho { height: 6px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.rank-barra { height: 100%; border-radius: inherit; background: var(--accent); }

/* Cancelar / remarcar */
.link-gestao {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 20px;
  padding: 14px;
  text-align: left;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  font-size: .88rem;
}
.link-gestao span { color: var(--text-2); }
.link-gestao .sucesso-acoes { justify-content: flex-start; margin-top: 8px; }
.sucesso-detalhes.riscado dd { text-decoration: line-through; color: var(--muted); }
.sucesso-icone.icone-cancelado { background: var(--danger); color: #fff; }
.item-cancelado { opacity: .55; }
.item-cancelado .item-hora, .item-cancelado .item-main strong { text-decoration: line-through; }

/* Logo da loja (painel) */
.logo-editor { display: flex; align-items: center; gap: 16px; }
.logo-preview {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--muted);
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }
.logo-preview.carregando { opacity: .5; }
.logo-botoes { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.logo-botoes label.btn { cursor: pointer; }

/* Contatos da loja (página do cliente) */
.loja-contatos { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.contato {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .2s, transform .15s var(--ease);
}
.contato:hover { border-color: var(--accent); }
.contato:active { transform: scale(.97); }
.contato span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contato svg { color: var(--accent); }
.contato-whats svg { color: var(--whats); }
.hero .brand-mark.com-logo { width: 84px; height: 84px; }

/* Link de agendamento */
.link-atual {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
}
.link-atual a#link-atual-texto {
  min-width: 0;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.link-atual a#link-atual-texto:hover { text-decoration: underline; }
.link-acoes { display: flex; gap: 6px; flex-shrink: 0; }
.campo-prefixo {
  display: flex;
  align-items: center;
  min-width: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
}
.campo-prefixo:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.campo-prefixo > span {
  padding-left: 13px;
  color: var(--muted);
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}
.campo-prefixo input { flex: 1; min-width: 0; padding-left: 2px; border: 0; background: transparent; box-shadow: none !important; }
#slug-status.ok { color: var(--ok); }
#slug-status.erro { color: var(--danger); }

/* Duração do serviço (na lista) */
.sel-duracao {
  width: auto;
  min-height: 32px;
  padding: 4px 28px 4px 10px;
  background-position: right 8px center;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-2);
}

/* Clube: mês a mês */
.mes-rotulo { min-width: 150px; text-align: center; font-weight: 600; font-size: .9rem; }

.progresso { margin-bottom: 16px; }
.progresso-topo { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: .82rem; color: var(--muted); }
.progresso-topo strong { color: var(--text); font-weight: 600; }
.progresso-barra { height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.progresso-barra span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .6s var(--ease); }
#clube-aviso-legado { margin: 0 0 16px; }

.item-assinante { flex-wrap: wrap; row-gap: 8px; }
.historico { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px; padding-left: 54px; }
.mes-pill {
  padding: 2px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
}
.mes-pago { background: var(--ok-bg); color: var(--ok); }
.mes-atrasado { background: var(--danger-bg); color: var(--danger); }
.mes-pendente { background: var(--warn-bg); color: var(--warn); }
.mes-futuro { border-color: var(--border-strong); color: var(--muted); }
.mes-vazio { color: var(--muted); opacity: .45; }
.mes-sel { box-shadow: 0 0 0 1.5px currentColor; }

.campo-switch { min-height: 44px; cursor: pointer; font-size: .9rem; }
.chip-simples { padding: 8px 18px; }
.dialog .form-stack .dialog-acoes { margin-top: 6px; }

/* Horário de funcionamento */
.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex-shrink: 0; cursor: pointer; }
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background-color .2s; }
.switch span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .2s var(--ease);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.faixa-hora { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.faixa-hora input[type="time"], .faixa-hora input[type="date"] { width: auto; }
.faixa-hora input:disabled { opacity: .4; }
.faixa-ate { font-size: .85rem; color: var(--muted); }
.hr-topo { align-items: start; }

.semana-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.semana { display: flex; flex-direction: column; gap: 6px; }
.dia-linha {
  display: grid;
  grid-template-columns: auto 92px auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s, opacity .2s;
}
.dia-nome { font-weight: 600; font-size: .9rem; }
.dia-horas { display: flex; align-items: center; gap: 8px; }
.dia-horas input { width: auto; min-height: 38px; padding: 6px 10px; }
.dia-info { justify-self: end; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.dia-linha.fechado .dia-horas { opacity: .3; pointer-events: none; }
.dia-linha.fechado .dia-nome { color: var(--muted); }
.dia-linha.com-erro { border-color: var(--danger); }
.dia-linha.com-erro .dia-info { color: var(--danger); font-weight: 600; }

.chip-folga { padding: 6px 6px 6px 14px; font-size: .85rem; cursor: default; }
.chip-x {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.chip-x:hover { background: var(--danger-bg); color: var(--danger); }
#hr-folgas { margin-top: 10px; }

/* =========================================================
   Avisos e diálogos
   ========================================================= */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  font-size: .9rem;
  font-weight: 500;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
  animation: toastEntra .3s var(--ease);
  transition: opacity .3s, transform .3s;
}
.toast svg { color: var(--accent); }
.toast-erro svg { color: var(--danger); }
.toast.saindo { opacity: 0; transform: translateY(8px); }
@keyframes toastEntra { from { opacity: 0; transform: translateY(10px); } }

.dialog {
  margin: auto;
  width: min(380px, calc(100% - 32px));
  padding: 24px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(0, 0, 0, .5); backdrop-filter: blur(3px); }
.dialog h3 { font-size: 1.45rem; margin-bottom: 6px; }
.dialog p { font-size: .9rem; color: var(--muted); }
.dialog-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

/* =========================================================
   PÁGINA PÚBLICA (agendar.html)
   ========================================================= */
.hero {
  position: relative;
  padding: 52px 16px 84px;
  text-align: center;
  background: var(--hero-bg);
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.hero .brand-mark { width: 64px; height: 64px; margin-bottom: 6px; }
.hero h1 { font-size: clamp(2.4rem, 9vw, 3.8rem); overflow-wrap: anywhere; }
.hero p { max-width: 440px; color: var(--text-2); }

.pub-main {
  position: relative;
  max-width: 680px;
  margin: -48px auto 0;
  padding: 0 16px 150px;
}

.passo {
  padding: 20px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  scroll-margin-top: 16px;
}
.passo-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.passo-n {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .85rem;
  font-weight: 700;
}
.passo h2 { font-size: var(--h2-size); }

.opcoes { display: grid; gap: 8px; }
.opcao {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.opcao input { position: absolute; opacity: 0; pointer-events: none; }
.opcao:hover { border-color: var(--border-strong); }
.opcao:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opcao:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.opcao-nome { flex: 1; min-width: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.opcao-nome { flex-wrap: wrap; column-gap: 10px; row-gap: 2px; }
.opcao-nome small { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; color: var(--muted); font-size: .78rem; }
.opcao-preco { font-weight: 600; color: var(--text-2); white-space: nowrap; }
.opcao-check {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  color: transparent;
  transition: background-color .2s, border-color .2s;
}
.opcao:has(input:checked) .opcao-check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 6px;
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:hover { border-color: var(--border-strong); }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: .75rem;
  font-weight: 700;
}
.chip:has(input:checked) .chip-avatar { background: var(--accent); color: var(--accent-ink); }

.faixa-datas {
  display: flex;
  gap: 8px;
  margin: 0 -20px;
  padding: 2px 20px 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.dia {
  position: relative;
  flex: 0 0 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  scroll-snap-align: start;
  cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s;
}
.dia input { position: absolute; opacity: 0; pointer-events: none; }
.dia:hover { border-color: var(--border-strong); }
.dia-sem { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.dia-num { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.65rem; line-height: 1.05; }
.dia-mes { font-size: .7rem; color: var(--muted); }
.dia:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dia:has(input:checked) span { color: inherit; }
.dia:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.dia.dia-fechado { opacity: .38; cursor: not-allowed; border-style: dashed; }
.dia.dia-fechado:hover { border-color: var(--border); }

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: .8rem;
  font-weight: 600;
}
.hero-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.hero-status.fechado::before { background: var(--danger); }

.grade-horarios {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 12px 6px;
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s, transform .15s var(--ease);
}
.slot:hover:not(:disabled) { border-color: var(--accent); }
.slot:active:not(:disabled) { transform: scale(.96); }
.slot.ativo { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.slot:disabled { opacity: .38; cursor: not-allowed; }
.slot:disabled .slot-h { text-decoration: line-through; }
.slot small { font-size: .65rem; font-weight: 500; }
.slot-skel { height: 48px; border-radius: var(--radius-sm); }
.dica { grid-column: 1 / -1; font-size: .88rem; color: var(--muted); }

.barra-resumo {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.barra-inner { max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.barra-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .85rem; }
.barra-texto strong, .barra-texto span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-texto span { color: var(--muted); }
.barra-inner .btn { padding: 13px 22px; }

.sucesso {
  padding: 36px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.sucesso-icone {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  animation: pop .5s var(--ease);
}
.sucesso h2 { font-size: 2rem; margin-bottom: 8px; }
.sucesso > p { color: var(--text-2); }
.sucesso-detalhes {
  display: grid;
  gap: 1px;
  margin: 22px 0;
  overflow: hidden;
  text-align: left;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sucesso-detalhes div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; background: var(--bg-elev); font-size: .9rem; }
.sucesso-detalhes dt { color: var(--muted); }
.sucesso-detalhes dd { font-weight: 600; text-align: right; }
.sucesso-acoes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } }

.pub-rodape { padding: 24px; text-align: center; font-size: .75rem; color: var(--muted); }

/* =========================================================
   LOGIN (login.html)
   ========================================================= */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  display: flex;
  align-items: center;
  padding: 56px;
  background: var(--hero-bg);
  border-right: 1px solid var(--border);
}
.auth-hero-inner { max-width: 460px; }
.auth-hero h1 { margin: 22px 0 12px; font-size: clamp(2.6rem, 5vw, 4.2rem); }
.auth-hero p { font-size: 1.05rem; color: var(--text-2); }
.auth-lista { list-style: none; display: grid; gap: 12px; margin-top: 30px; }
.auth-lista li { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.auth-lista li svg { color: var(--accent); }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 1.9rem; margin-bottom: 4px; }
.auth-card .panel-sub { margin-bottom: 20px; }

.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
}
.seg button {
  flex: 1;
  padding: 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.seg button.active { background: var(--accent); color: var(--accent-ink); }

.aviso {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: .88rem;
}
.aviso-erro { background: var(--danger-bg); color: var(--danger); }

/* Link discreto (ex.: "Esqueci minha senha") */
.link-sutil {
  align-self: center;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-sutil:hover { color: var(--accent); }

/* =========================================================
   Responsivo
   ========================================================= */
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 36px 20px 30px; border-right: 0; border-bottom: 1px solid var(--border); }
  .auth-hero h1 { margin-top: 16px; }
  .auth-lista { display: none; }
}

@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:last-child { grid-column: 1 / -1; }
  .stat strong { font-size: 1.7rem; }

  /* Abas viram barra de navegação inferior no celular */
  .painel .tabs {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 0;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
  }
  .painel .tab { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: .68rem; min-width: 0; white-space: nowrap; }
  .painel .tab.active { background: var(--accent-soft); color: var(--accent); }
  .painel .app { padding-bottom: 110px; }
  .painel .toasts { bottom: 92px; }
  .avisos-novos { top: 12px; bottom: auto; right: 16px; }

  .topbar { gap: 10px; }
  .topbar-actions { gap: 2px; }
  .topbar-actions .btn span { display: none; }
  .topbar-actions .btn { padding: 8px; }
  .brand { gap: 10px; }
  .brand h1 { font-size: 1.45rem; }
  .brand-mark { width: 36px; height: 36px; }
}

@media (max-width: 560px) {
  .panel, .passo { padding: 16px; }
  .faixa-datas { margin: 0 -16px; padding: 2px 16px 10px; }
  .item { flex-wrap: wrap; }
  .item-lado { width: 100%; justify-content: space-between; flex-wrap: wrap; row-gap: 8px; }
  .item-acoes { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
  .item-compacto { flex-wrap: nowrap; }
  .item-compacto .item-lado { width: auto; }
  /* Serviço com seletor de duração: nome em cima, duração/preço/lixeira embaixo */
  .item-compacto:has(.item-extra) { flex-wrap: wrap; }
  .item-compacto:has(.item-extra) .item-lado { width: 100%; justify-content: flex-end; }
  .historico { padding-left: 0; }
  .mes-rotulo { flex: 1; min-width: 0; }
  .dia-linha { grid-template-columns: auto 1fr auto; row-gap: 8px; }
  .dia-horas { grid-column: 1 / -1; grid-row: 2; }
  .dia-info { grid-column: 3; grid-row: 1; }
  .dia-horas input { flex: 1; }
  .panel-head .date-nav { width: 100%; }
  #btn-bloquear span { display: none; }   /* no celular, só o ícone */
  #btn-bloquear { padding: 9px; }
  .date-nav input { flex: 1; min-width: 0; }   /* deixa o campo de data encolher para caber */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
