.tela {
  display: none;
}

.tela.ativa {
  display: flex;
}

:root {
  /* Base */
  --bg: #0d1117;
  --fundo: #0d1117;
  --card: #161b22;
  --background-cards: #161b22;

  /* Texto */
  --texto: #e6edf3;
  --texto-fraco: #8b949e;
  --muted: #8b949e;

  /* Cores de destaque */
  --accent: #f97316;
  --accent-2: #06b6d4;
  --primaria: #06b6d4;
  --primaria-hover: #0891b2;

  /* Feedback */
  --sucesso: #10b981;
  --alerta: #f59e0b;
  --erro: #ef4444;

  /* Bordas e layout */
  --borda: #30363d;
  --radius: 14px;
  --gap: 18px;

  color: #e6edf3;
}

/* RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Manrope";
}

/* BODY */
body {
  background: var(--bg);
  color: var(--muted);
  font-family: Inter, system-ui, sans-serif;
}

/* LAYOUT GERAL */
.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* SIDEBAR */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  height: 100%;
  background: var(--card);
  border-radius: var(--radius);
  color: white;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
  padding: 20px 10px;
}

.sidebar.open {
  transform: translateX(0);
}

.nav-item {
  padding: 10px;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  display: block;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.nav-item.active {
  background: var(--accent);
  color: #fff;
}

.user {
  margin-top: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #000;
}

/* TOPBAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: var(--radius);
  color: white;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 900;
}

.hamburger {
  font-size: 24px;
  cursor: pointer;
}

.btn {
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  border: none;
}

/* CONTENT */
#content {
  padding: 20px;
}

form {
  background: #161b22;
  padding: 24px 32px;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #e6edf3;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  font-family: Inter, system-ui, sans-serif;
  position: relative;
  text-align: center;
}

form p {
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
  color: var(--accent);
}

form label {
  font-size: 0.9rem;
  font-weight: 500;
  display: block;
  text-align: center;
}

/* Inputs e select */
form input,
form select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #0d1117;
  color: #e6edf3;
  font-size: 0.95rem;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border 0.2s;
  align-items: center;
}

form input:focus,
form select:focus {
  border: 1px solid var(--accent);
}

.erro {
  display: flex;
  width: 100%;
  background-color: #d32f2f;
  color: white;
  text-align: center;
  border-radius: 0 10px 10px 10px;
  padding: 5px;
}

/* ===========================
   ESTILO PADRÃO DE TODOS BOTÕES
   =========================== */

/* Botões gerais */
button {
  margin: 5px;
  padding: 12px 20px;
  border-radius: 14px;
  border: none;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* ===========================
   BOTÃO PRINCIPAL / NOVO / CONFIRMAR
   =========================== */
.btn-principal,
#btn-novo-servico,
#btn-cadastrar-servico,
#btn-confirmar-ed-servico,
.editar-servico {
  background: #06b6d4; /* azul destaque */
  color: #000;
}

.btn-principal:hover,
#btn-novo-servico:hover,
#btn-cadastrar-servico:hover,
#btn-confirmar-ed-servico:hover,
.editar-servico:hover {
  background: #0eb2d1;
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}

/* ===========================
   BOTÃO CANCELAR / DELETAR
   =========================== */
.btn-cancelar,
#btn-cancelar-cad-servico,
#btn-cancelar-ed-servico,
.deletar-servico {
  background: #d32f2f; /* vermelho profundo */
  color: #fff;
}

.btn-cancelar:hover,
#btn-cancelar-cad-servico:hover,
#btn-cancelar-ed-servico:hover,
.deletar-servico:hover {
  background: #f44336; /* vermelho vibrante */
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}

/* ===========================
   BOTÕES SECUNDÁRIOS / NEUTROS
   =========================== */
.btn-secundario {
  background: #444; /* cinza escuro */
  color: #fff;
}

.btn-secundario:hover {
  background: #555;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Container do dropdown */
.dropdown {
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  display: block;
}

.dropdown.active {
  background: var(--accent);
  color: #fff;
}

.dropdown:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* Botão principal */
.dropbtn {
  padding: 10px 20px;
  cursor: pointer;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
}

/* Conteúdo do dropdown, inicialmente escondido */
.dropdown-content {
  display: none;
  position: absolute;
  background-color: #161b22;
  min-width: 160px;
  border: 2px solid #575757;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1;
  margin-top: 5px;
  border-radius: 4px;
}

/* Botões dentro do dropdown */
.dropdown-content button {
  width: 100%;
  padding: 10px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}

.dropdown-content button:hover {
  background-color: #8b949e;
  color: #000000;
}

/* Mostrar dropdown quando aberto */
.dropdown.show .dropdown-content {
  display: block;
}

/* Overlay da tela de confirmação */
.confirmacao-overlay,
.mensagem-overlay,
.overlay {
  position: fixed; /* fica sobre o dashboard */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5); /* fundo semitransparente */
  align-items: center;
  justify-content: center;
  z-index: 9999; /* acima de tudo */
}

/* Caixa de confirmação */
.tela-confirmacao {
  background: #1f2937; /* cor escura tipo dashboard */
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 400px;
  text-align: center;
  color: #fff;
}

/* Título */
.tela-confirmacao h2 {
  color: #f97316;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.mensagem {
  background: #161b22;
  border: 0.5px solid #30363d;
  border-radius: 14px;
  padding: 28px 24px;
  width: 90%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  animation: fadeInScale 0.2s ease;
}

.mensagem-icone {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.mensagem.sucesso .mensagem-icone {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.mensagem.erro .mensagem-icone {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.mensagem-titulo {
  font-size: 15px;
  font-weight: 500;
  color: #e6edf3;
  margin: 0;
}

.mensagem-texto {
  font-size: 13px;
  color: #8b949e;
  line-height: 1.6;
  margin: 0;
}

.mensagem-barra {
  width: 100%;
  height: 3px;
  border-radius: 3px;
  margin-top: 4px;
  animation: barra 3s linear forwards;
}

.mensagem.sucesso .mensagem-barra {
  background: #10b981;
}
.mensagem.erro .mensagem-barra {
  background: #ef4444;
}

input {
  background: #0d1117;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 5px;
  color: white;
}

.card {
  background: #161b22;
  color: #e6edf3;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 400px;
  height: auto;
  max-height: max-content;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.card h2 {
  font-size: 20px;
  margin-bottom: 20px;
}

.card p,
.card span {
  font-size: 17px;
  color: #999;
}

/* ===========================
   RESPONSIVO
   =========================== */
@media (max-width: 600px) {
  button {
    width: 100%;
    font-size: 14px;
    padding: 14px 0;
    margin: 5px 0 5px 0;
  }

  form {
    padding: 20px;
    max-width: 90%;
  }
}

/* ========== BADGE DE STATUS (global — usado em agendamentos pendentes, confirmados e cliente) ========== */
.badge-status {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-status.pendente {
  background-color: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.badge-status.confirmado {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-status.recusado,
.badge-status.cancelado {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-status.atendido {
  background-color: rgba(6, 182, 212, 0.1);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.badge-status.faltou {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ========== FILTROS COM CHIPS (global — usado em agendamentos e financeiro) ========== */
.filtros {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.filtros::-webkit-scrollbar {
  height: 4px;
}

.filtros::-webkit-scrollbar-thumb {
  background: var(--texto-fraco);
  border-radius: 4px;
}

.chip-filtro {
  background: var(--card);
  border: 1px solid transparent;
  color: var(--texto);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.chip-filtro.ativo {
  background: var(--primaria);
  color: white;
  font-weight: 500;
}

/* ========== HEADER ROW (global — padrão de cabeçalho com badge) ========== */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-row h2 {
  margin: 0;
  flex: 1;
}
