/* ============================================================
   BARBER SYSTEM — The Atelier Design System
   Baseado em: DESIGN.md (Zaia Intelligence)
   ============================================================ */

/* -- Fontes & Base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Montserrat', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-headline { font-family: 'Space Grotesk', sans-serif; }
.font-label    { font-family: 'Sora',          sans-serif; }

/* -- Material Symbols --------------------------------------- */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
}

/* -- Scrollbars minimalistas -------------------------------- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc3d9; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #7b7488; }

/* -- Sidebar ------------------------------------------------ */
#sidebar { transition: transform 0.25s ease; }

/* Item de menu ativo */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  color: #4a4456;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  text-decoration: none;
}

.nav-item:hover {
  background: #f3eaff;
  color: #1f1730;
}

.nav-item.ativo {
  background: #f3eaff;
  color: #5300bd;
  font-weight: 600;
  border-right: 3px solid #6f0af5;
}

.nav-item.ativo .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  color: #6f0af5;
}

.nav-section-label {
  font-size: 0.65rem;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7b7488;
  padding: 1rem 1rem 0.25rem;
}

/* -- Cards -------------------------------------------------- */
.card {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(28, 27, 32, 0.04);
}

.card-low {
  background: #f8f1ff;
  border-radius: 1rem;
  padding: 1.5rem;
}

/* -- Botões ------------------------------------------------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: linear-gradient(135deg, #5300bd, #6f0af5);
  color: #ffffff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(111, 10, 245, 0.25);
  transition: all 0.2s ease;
}

.btn-primary:hover  { opacity: 0.9; }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: #eee4ff;
  color: #1f1730;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover { background: #e9ddff; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: transparent;
  color: #4a4456;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ghost:hover { background: #f3eaff; color: #1f1730; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: #ffdad6;
  color: #ba1a1a;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover { background: #ffb4ab; }

/* -- Inputs ------------------------------------------------- */
.input-field {
  width: 100%;
  background: #f8f1ff;
  border: none;
  border-bottom: 2px solid rgba(204, 195, 217, 0.4);
  border-radius: 0.5rem 0.5rem 0 0;
  padding: 0.75rem 1rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  color: #1f1730;
  outline: none;
  transition: border-color 0.2s ease;
}

.input-field:focus { border-bottom-color: #6f0af5; }
.input-field::placeholder { color: #7b7488; }

.input-group { margin-bottom: 1rem; }

.input-label {
  display: block;
  font-family: 'Sora', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7b7488;
  margin-bottom: 0.375rem;
}

select.input-field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%237b7488'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* -- Tabelas ------------------------------------------------ */
.tabela-container { overflow-x: auto; }

.tabela {
  width: 100%;
  border-collapse: collapse;
}

.tabela thead tr {
  background: #f8f1ff;
}

.tabela th {
  text-align: left;
  font-family: 'Sora', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7b7488;
  padding: 0.75rem 1rem;
}

.tabela td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: #1f1730;
  vertical-align: middle;
}

.tabela tbody tr {
  border-bottom: 1px solid rgba(204, 195, 217, 0.15);
  transition: background 0.15s ease;
}

.tabela tbody tr:hover { background: #fef7ff; }
.tabela tbody tr:last-child { border-bottom: none; }

/* -- Badges / Status ---------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-family: 'Sora', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-agendado    { background: #f3eaff; color: #5300bd; }
.badge-confirmado  { background: #dbeafe; color: #1d4ed8; }
.badge-em_andamento{ background: #fef9c3; color: #854d0e; }
.badge-concluido   { background: #dcfce7; color: #166534; }
.badge-cancelado   { background: #f1f5f9; color: #64748b; }
.badge-nao_compareceu { background: #ffdad6; color: #ba1a1a; }
.badge-pendente    { background: #fef9c3; color: #854d0e; }
.badge-pago        { background: #dcfce7; color: #166534; }
.badge-ativo       { background: #dcfce7; color: #166534; }
.badge-inativo     { background: #f1f5f9; color: #64748b; }
.badge-adm         { background: #f3eaff; color: #5300bd; }
.badge-barbeiro    { background: #eee4ff; color: #4a4456; }

/* -- Stats Cards -------------------------------------------- */
.stat-card {
  background: #ffffff;
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(28, 27, 32, 0.04);
  position: relative;
  overflow: hidden;
}

.stat-card .stat-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 3.5rem;
  opacity: 0.06;
  color: #5300bd;
}

.stat-label {
  font-family: 'Sora', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7b7488;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #1f1730;
  line-height: 1;
}

.stat-sub {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  color: #7b7488;
  margin-top: 0.5rem;
}

/* -- Agenda / Calendário ------------------------------------ */
.agenda-grid {
  display: grid;
  gap: 0;
  background: #ffffff;
  border-radius: 1.25rem;
  overflow: hidden;
}

.agenda-coluna { position: relative; min-height: 640px; }

.slot-horario {
  height: 80px;
  border-bottom: 1px dashed rgba(204, 195, 217, 0.2);
  display: flex;
  align-items: flex-start;
  padding-top: 0.5rem;
  position: relative;
}

.evento-agendamento {
  position: absolute;
  left: 6px;
  right: 6px;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
  z-index: 10;
}

.evento-agendamento:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(83, 0, 189, 0.15);
}

.evento-agendado     { background: rgba(111,10,245,0.08); border-left: 3px solid #6f0af5; }
.evento-confirmado   { background: rgba(29,78,216,0.08);  border-left: 3px solid #1d4ed8; }
.evento-em_andamento { background: rgba(202,138,4,0.12);  border-left: 3px solid #ca8a04; }
.evento-concluido    { background: rgba(22,101,52,0.08);  border-left: 3px solid #16a34a; }
.evento-cancelado    { background: rgba(100,116,139,0.08);border-left: 3px solid #94a3b8; opacity: 0.6; }

.linha-hora-atual {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #6f0af5;
  z-index: 20;
  pointer-events: none;
}

.linha-hora-atual::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -4px;
  width: 10px;
  height: 10px;
  background: #6f0af5;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(111,10,245,0.5);
}

/* -- Toast -------------------------------------------------- */
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: 1rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: all;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  min-width: 280px;
  max-width: 380px;
  animation: slideIn 0.3s ease;
}

.toast-sucesso { background: #dcfce7; color: #166534; }
.toast-erro    { background: #ffdad6; color: #ba1a1a; }
.toast-info    { background: #f3eaff; color: #5300bd; }
.toast-aviso   { background: #fef9c3; color: #854d0e; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(1rem); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(1rem); }
}

/* -- Loading Spinner ---------------------------------------- */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-dark {
  border: 2px solid rgba(83,0,189,0.2);
  border-top-color: #5300bd;
}

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

/* -- Empty State -------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state .material-symbols-outlined { font-size: 3.5rem; color: #ccc3d9; }
.empty-state p { font-family: 'Sora', sans-serif; font-size: 0.875rem; color: #7b7488; margin-top: 0.75rem; }

/* -- Utilitários -------------------------------------------- */
.text-monetario {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.divider { height: 1px; background: rgba(204, 195, 217, 0.2); margin: 1.25rem 0; }

.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f1730;
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.tooltip:hover::after { opacity: 1; }

/* -- Responsividade básica ---------------------------------- */
@media (max-width: 1024px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.aberto { transform: translateX(0); }
  main { margin-left: 0 !important; }
}

/* -- Animações de entrada ----------------------------------- */
.fade-in {
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
