:root {
  --bg: #f5f5f4;
  --card: #ffffff;
  --text: #1c1c1c;
  --muted: #6b6b6b;
  --accent: #1c1310;
  --accent-2: #9c3138;
  --accent-2-dark: #6c1a24;
  --accent-2-tint: #fbeeee;
  --accent-2-tint-strong: #f6dcdc;
  --border: #e5e5e5;
  --danger: #b91c1c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.navbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--accent);
  color: white;
}
.navbar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex-shrink: 0;
}
.navbar .nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.navbar .nav-links a {
  position: relative;
  color: white;
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background-color 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}
.navbar .nav-links a:hover {
  background-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}
.navbar .nav-links a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  background: var(--accent-2);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}
.navbar .nav-links a:hover::after { transform: scaleX(1); }
.navbar .nav-links a.ativo {
  background-color: rgba(255, 255, 255, 0.16);
  font-weight: 700;
}
.navbar .nav-links a.ativo::after { transform: scaleX(1); }
.navbar .nav-logout {
  justify-self: end;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s ease;
}
.navbar .nav-logout:hover { color: white; }
h1 { font-size: 22px; margin-bottom: 4px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
p.muted, span.muted { color: var(--muted); font-size: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=time], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
button, .btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-2-dark));
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.15s ease;
}
button:hover, .btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0); filter: brightness(0.97); }
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--accent-2);
  border: 1px solid var(--accent-2);
}
button.secondary:hover, .btn.secondary:hover { background: var(--accent-2-tint); filter: none; }
button.danger { background: var(--danger); }
/* Reseta a aparência padrão de <button> para ações que precisam ser POST
   (proteção contra CSRF) mas devem continuar parecendo um link de texto
   simples, como antes (ex.: excluir, sair). */
.link-plain {
  display: inline;
  margin-top: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
}
.erro { color: var(--danger); font-size: 14px; margin-top: 10px; }
.row { display: flex; gap: 10px; align-items: center; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.slots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.slot {
  padding: 8px 12px;
  border: 1px solid var(--accent-2);
  border-radius: 20px;
  color: var(--accent-2);
  font-size: 13px;
  cursor: pointer;
  background: white;
}
.slot.selecionado, .slot:hover { background: var(--accent-2); color: white; }
.day-pill {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  text-decoration: none;
  color: var(--text);
}
.day-pill.ativo { background: var(--accent-2); color: white; border-color: var(--accent-2); }
.stat { display: flex; gap: 24px; flex-wrap: wrap; }
.num { font-size: 28px; font-weight: 700; }

.free-tier-bar {
  margin-top: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.free-tier-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent-2);
  transition: width 0.2s ease;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 18px;
}
.stat-grid .tile { display: flex; flex-direction: column; gap: 4px; }
.stat-grid .num { font-size: 26px; }
.stat-grid .label { color: var(--muted); font-size: 13px; }

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 140px;
  padding-top: 20px;
}
.bar-chart .bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.bar-chart .bar-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.bar-chart .bar {
  width: 22px;
  max-width: 24px;
  border-radius: 4px 4px 0 0;
  background: var(--accent-2);
  transition: filter 0.15s ease;
}
.bar-chart .bar-col:hover .bar { filter: brightness(1.15); }
.bar-chart .bar-label {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-list .rank-row {
  display: grid;
  grid-template-columns: 110px 1fr 32px;
  align-items: center;
  gap: 10px;
}
.rank-list .rank-name {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-list .rank-track {
  height: 16px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.rank-list .rank-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent-2);
  transition: filter 0.15s ease, width 0.2s ease;
}
.rank-list .rank-row:hover .rank-fill { filter: brightness(1.15); }
.rank-list .rank-count {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}
.link-box {
  background: var(--accent-2-tint);
  border: 1px dashed var(--accent-2);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  word-break: break-all;
}

.logo-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  overflow: hidden;
  flex-shrink: 0;
}
.logo-circle img { width: 100%; height: 100%; object-fit: cover; }
.logo-circle-lg {
  width: 96px;
  height: 96px;
  font-size: 36px;
  margin: 0 auto 16px;
}

.logo-uploader {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.logo-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.file-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.file-input-wrap input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
}
.file-input-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.file-input-wrap:hover .file-input-btn {
  border-color: var(--accent-2);
  background: var(--accent-2-tint);
}
.file-input-name {
  font-size: 13px;
  color: var(--muted);
}
.logo-form button[type="submit"] { margin-top: 0; }

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 20px 32px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.footer-link:hover { opacity: 0.75; }
.m3-logo {
  height: 20px;
  width: auto;
}
.footer-legal, .footer-support {
  font-size: 12px;
  color: var(--muted);
}
.footer-legal a, .footer-support a {
  color: var(--muted);
  text-decoration: underline;
}
.footer-legal a:hover, .footer-support a:hover { opacity: 0.75; }
.footer-legal span { padding: 0 4px; }

.legal-doc { max-width: 680px; margin: 0 auto; line-height: 1.6; }
.legal-logo { height: 40px; width: auto; margin-bottom: 12px; display: block; }
.legal-doc h2 { margin-top: 28px; font-size: 17px; }
.legal-doc ul { padding-left: 20px; }

.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 12px;
  transition: color 0.15s ease;
}
.back-link:hover { color: var(--accent-2); }

.link-box {
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.link-box:hover { background: var(--accent-2-tint-strong); }
.copy-feedback {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: #15803d;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.copy-feedback.visivel { opacity: 1; }

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.tabs button {
  margin-top: 0;
  background: none;
  color: var(--muted);
  border: none;
  border-radius: 0;
  padding: 10px 4px;
  margin-right: 18px;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.tabs button:hover { filter: none; transform: none; color: var(--text); }
.tabs button.ativo { color: var(--accent-2); border-bottom-color: var(--accent-2); }
.tab-painel { display: none; }
.tab-painel.ativo { display: block; }

.barbeiro-list { display: flex; flex-direction: column; gap: 10px; }
.barbeiro-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.barbeiro-row:last-child { border-bottom: none; }
.barbeiro-row .nome { font-weight: 600; }
.barbeiro-row .status-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}
.status-badge.ativo { background: #dcfce7; color: #15803d; }
.status-badge.inativo { background: #f3f4f6; color: var(--muted); }

.barbeiro-picker { display: flex; flex-direction: column; gap: 10px; }
.barbeiro-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  background: white;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.barbeiro-card:hover { border-color: var(--accent-2); background: var(--accent-2-tint); }
.barbeiro-card .nome { font-weight: 700; }

.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.galeria-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; }
.galeria-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.galeria-item .excluir-foto {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-decoration: none;
  line-height: 1;
}
.galeria-item .excluir-foto:hover { background: var(--danger); }

.galeria-publica {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 16px 0;
}
.galeria-publica img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.instagram-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.instagram-link:hover { text-decoration: underline; }
