/* BarberPro SaaS — tema escuro com dourado.
   A cor principal da empresa entra na variável --brand (o dourado é o
   padrão) e colore os destaques: botões, selos, links e a lateral. */
:root {
  --bg: #0e0e13;
  --card: #17171f;
  --card2: #1e1e29;
  --line: #2a2a3a;
  --text: #f2f0e8;
  --muted: #a8a5b5;
  --brand: #d4af37;
  --brand-ink: #1a1405;
  --green: #34c759;
  --blue: #4f8ef7;
  --red: #ff5a5f;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--brand); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* ---------- topo e lateral ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: #12121a; position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 12px; object-fit: cover;
  border: 1px solid var(--line); background: var(--card2); flex: none;
}
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 22px; font-weight: 800;
  color: var(--brand-ink); background: linear-gradient(135deg, #f3d67a, var(--brand));
}
.brand-name { font-weight: 800; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { color: var(--muted); font-size: 13px; }
.bell { position: relative; background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; }
.badge {
  position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff;
  font-size: 12px; font-weight: 800; display: grid; place-items: center;
}
.layout { display: flex; align-items: flex-start; }
.sidebar {
  width: 240px; flex: none; padding: 16px 12px; position: sticky; top: 65px;
  height: calc(100vh - 65px); overflow: auto;
}
.sidebar h4 { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin: 18px 8px 6px; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; background: transparent; color: var(--text);
  border: 1px solid transparent; border-radius: 10px; padding: 10px 12px; font-weight: 600;
}
.nav-item:hover { background: var(--card2); }
.nav-item.active { background: var(--card2); border-color: var(--brand); color: var(--brand); }
.nav-item .badge { position: static; }
main { flex: 1; min-width: 0; padding: 20px; max-width: 1080px; }

/* ---------- cartões, formulários, botões ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card h2, .card h3 { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid2 { grid-template-columns: repeat(2, 1fr); }
.grid4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) {
  .sidebar { display: none; }
  .grid2, .grid4 { grid-template-columns: 1fr 1fr; }
  main { padding: 14px; }
  .bottomnav { display: flex !important; }
}
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; background: #101018; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.btn {
  background: linear-gradient(135deg, #f3d67a, var(--brand));
  color: var(--brand-ink); border: none; border-radius: 10px;
  padding: 11px 18px; font-weight: 800;
}
.btn.secondary { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.btn.blue { background: var(--blue); color: #fff; }
.btn.red { background: var(--red); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.err { color: #ff9a9e; font-weight: 600; }
.ok { color: var(--green); font-weight: 600; }
.notice { background: #2a2110; border: 1px solid var(--brand); border-radius: 10px; padding: 12px 14px; }
.tag {
  display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 9px;
  border-radius: 999px; background: var(--card2); border: 1px solid var(--line);
}
.tag.gold { background: #2a2110; border-color: var(--brand); color: var(--brand); }
.tag.green { background: #12351c; border-color: var(--green); color: var(--green); }
.tag.blue { background: #12263f; border-color: var(--blue); color: var(--blue); }
.tag.red { background: #3d1214; border-color: var(--red); color: var(--red); }
.tag.gray { background: var(--card2); color: var(--muted); }

/* ---------- listas e itens ---------- */
.item { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.item:last-child { border-bottom: none; }
.item img.thumb { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: none; border: 1px solid var(--line); }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 800; }
.price { font-weight: 800; color: var(--brand); }
.unread { border-left: 3px solid var(--brand); padding-left: 12px; background: #211d0e; border-radius: 0 10px 10px 0; }
.cover {
  height: 110px; border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(135deg, #f3d67a, var(--brand), #8a6a12);
  display: flex; align-items: flex-end; padding: 0 18px 12px; margin: -18px -18px 14px;
}
.avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--card); background: var(--card2);
  display: grid; place-items: center; font-size: 30px; font-weight: 800; color: var(--brand);
}
input[type="file"] { padding: 8px; }
.preview { max-width: 220px; max-height: 160px; border-radius: 12px; border: 1px solid var(--line); margin-top: 8px; object-fit: cover; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); padding: 0; }
.swatch.sel { border-color: #fff; outline: 2px solid var(--brand); }

/* ---------- agendamento ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.step {
  flex: 1; min-width: 120px; text-align: center; padding: 10px; border-radius: 10px;
  background: var(--card2); border: 1px solid var(--line); font-weight: 700; color: var(--muted);
}
.step.on { border-color: var(--brand); color: var(--brand); }
.chip {
  border: 1px solid var(--line); background: var(--card2); color: var(--text);
  border-radius: 999px; padding: 8px 14px; font-weight: 700;
}
.chip:hover { border-color: var(--brand); }
.chip.sel { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.chip.free { border-color: var(--green); color: var(--green); }
.chip.booked { border-color: var(--blue); color: var(--blue); }
.chip.blocked { border-color: var(--red); color: var(--red); }
.chip:disabled { opacity: .45; cursor: default; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 700; }
.tab.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); }

/* ---------- barra inferior (celular) ---------- */
.bottomnav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #12121a; border-top: 1px solid var(--line);
  justify-content: space-around; padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.bottomnav button { background: none; border: none; color: var(--muted); font-size: 11px; font-weight: 700; padding: 4px 6px; }
.bottomnav button.on { color: var(--brand); }
body.has-bottomnav main { padding-bottom: 70px; }

/* Confirmação dentro do app (substitui o confirm() nativo, que o
   robô de testes não consegue confirmar e que é ruim no celular). */
.dlg-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 16px; }
.dlg-overlay .dlg { max-width: 420px; width: 100%; }

/* Menu inicial da página pública: logo da empresa + 3 opções grandes. */
.pubmenu .btn { display: block; width: 100%; margin-bottom: 12px; padding: 14px; font-size: 16px; }
.pubmenu .btn:last-child { margin-bottom: 0; }
#viewPublic .brand-logo { width: 72px; height: 72px; }
#viewPublic .brand-mark { width: 72px; height: 72px; font-size: 32px; }
