/* ==========================================================================
   BarberAI OS - Assistente de Configuracao Inicial
   Tela cheia, sobrepondo tudo: enquanto a barbearia nao esta configurada,
   nao ha o que fazer no painel - a agenda estaria vazia e o robo do
   WhatsApp nao teria horario nenhum para oferecer.
   ========================================================================== */

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 10%, #1b263b 0%, #0b0f17 60%);
  overflow-y: auto;
}

.onboarding-overlay.active {
  display: flex;
}

/* Trava o scroll do painel atras enquanto o assistente esta aberto */
body.onboarding-lock {
  overflow: hidden;
}

.onboarding-panel {
  width: 100%;
  max-width: 760px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  padding: 32px;
}

/* ---------- Cabecalho ---------- */

.ob-header { text-align: center; margin-bottom: 22px; }

.ob-brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-primary);
  margin-bottom: 10px;
}

.ob-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 4px;
}

.ob-sub { color: var(--text-muted); font-size: 14px; margin: 0; }

/* ---------- Trilha de passos ---------- */

.ob-trilha {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.ob-step { display: flex; align-items: center; gap: 8px; }

.ob-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-input);
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.ob-step-label { font-size: 12px; color: var(--text-dim); font-weight: 600; }

.ob-step.atual .ob-step-num {
  background: var(--gold-primary);
  color: #0b0f17;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 4px var(--gold-subtle);
}
.ob-step.atual .ob-step-label { color: var(--text-main); }

.ob-step.feito .ob-step-num {
  background: var(--emerald-subtle);
  color: var(--emerald);
  border-color: var(--emerald);
}
.ob-step.feito .ob-step-label { color: var(--text-muted); }

.ob-step-line {
  width: 22px;
  height: 1px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

/* ---------- Corpo ---------- */

.ob-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ob-grid .form-group { margin-bottom: 0; }
.ob-col-2 { grid-column: 1 / -1; }

.ob-body label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.ob-req { color: var(--gold-primary); }

.ob-hint {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--text-dim);
}

.ob-secao {
  margin: 24px 0 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.ob-dica {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 16px;
}

.ob-dica-info {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--sapphire-subtle);
  border-left: 3px solid var(--sapphire);
  border-radius: var(--radius-sm);
}

/* ---------- Cartoes de profissional / servico ---------- */

.ob-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 14px;
}

.ob-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ob-card-head strong {
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--gold-primary);
}

.ob-remover {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: all var(--transition-fast);
}

.ob-remover:hover {
  background: var(--ruby-subtle);
  border-color: var(--ruby);
  color: var(--ruby);
}

.ob-add { width: 100%; margin-top: 4px; }

/* ---------- Dias da semana ---------- */

.ob-label-dias {
  display: block;
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.ob-dias { display: flex; gap: 6px; flex-wrap: wrap; }

.ob-dia {
  position: relative;
  cursor: pointer;
  margin-bottom: 0 !important;
}

.ob-dia input { position: absolute; opacity: 0; pointer-events: none; }

.ob-dia span {
  display: grid;
  place-items: center;
  min-width: 46px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  transition: all var(--transition-fast);
  user-select: none;
}

.ob-dia.on span {
  background: var(--gold-subtle);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.ob-dia input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--gold-subtle);
}

/* ---------- Revisao ---------- */

.ob-revisao { display: grid; gap: 14px; }

.ob-revisao-bloco {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
}

.ob-revisao-bloco h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  color: var(--text-main);
  margin: 0 0 10px;
}

.ob-slogan {
  font-style: italic;
  color: var(--text-dim);
  font-size: 13px;
  margin: -4px 0 10px;
}

.ob-revisao-bloco ul { list-style: none; padding: 0; margin: 0; }

.ob-revisao-bloco li {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
  line-height: 1.5;
}

.ob-revisao-bloco li:last-child { border-bottom: none; }
.ob-revisao-bloco li strong { color: var(--text-main); }

/* ---------- Erro ---------- */

.ob-erro {
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--ruby-subtle);
  border: 1px solid var(--ruby);
  border-radius: var(--radius-sm);
  color: #fecaca;
  font-size: 13px;
  line-height: 1.5;
}

.ob-erro[hidden] { display: none; }

/* ---------- Rodape ---------- */

.ob-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.ob-footer-left, .ob-footer-right { display: flex; gap: 10px; align-items: center; }

.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
}

.btn-ghost:hover {
  color: var(--text-main);
  border-color: var(--border-subtle);
}

/* ---------- Celular ---------- */

@media (max-width: 640px) {
  .onboarding-overlay { padding: 0; }

  .onboarding-panel {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    padding: 22px 18px 28px;
  }

  .ob-grid { grid-template-columns: 1fr; }
  .ob-step-label { display: none; }
  .ob-step-line { width: 14px; }
  .ob-footer { flex-direction: column-reverse; align-items: stretch; }
  .ob-footer-left, .ob-footer-right { justify-content: center; }
  .ob-footer-right .btn { flex: 1; }
  .ob-dia span { min-width: 40px; padding: 8px 6px; }
}

/* ==========================================================================
   Tela de Entrada
   Reaproveita a estrutura do assistente (mesma classe de overlay e painel),
   so que mais estreita: formulario de login largo parece pedir mais do que
   duas linhas de dado.
   ========================================================================== */

.login-panel { max-width: 420px; }

.login-form { margin-top: 20px; }
.login-form .form-group { margin-bottom: 16px; }

.login-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.login-acoes { margin-top: 22px; }

.btn-block {
  width: 100%;
  justify-content: center;
  padding: 12px 20px;
  font-size: 15px;
}

.login-rodape {
  margin-top: 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
  text-align: center;
}

/* Usuario logado na barra de cima */
.topbar-usuario {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 12px;
  margin-right: 4px;
  border-right: 1px solid var(--border-subtle);
}

.topbar-usuario:empty { display: none; }

.topbar-usuario-nome {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .login-panel { max-width: 100%; }
  .topbar-usuario-nome { display: none; }
  .topbar-usuario { padding-right: 8px; }
}

/* Aviso de jornada menor que o horario da barbearia (revisao do assistente) */
.ob-aviso-jornada {
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid var(--gold-primary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
  color: var(--gold-primary);
}

/* Aviso de demonstracao publica na tela de entrada.
   So aparece onde existe data/demo-publica.json. */
.login-demo {
  margin-top: 22px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--gold-subtle);
  border: 1px solid var(--border-gold);
  text-align: center;
}

.login-demo strong {
  display: block;
  color: var(--gold-primary);
  font-size: 14px;
  margin-bottom: 6px;
}

.login-demo p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 12px;
}

.login-demo-creds {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-dim);
}

.login-demo-creds b { color: var(--text-main); font-weight: 700; }
