/* ==========================================================
   ESTILOS GERAIS E ESTRUTURA DO ADMIN
   ========================================================== */

#conteudoAdmin {
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  padding: 32px;
  box-sizing: border-box;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.content-header .header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.content-header .brand-logo {
  max-width: 85px;
  height: auto;
}

.content-header h1 {
  margin: 0;
}

.content-header .btn-voltar {
  text-decoration: none;
  font-size: 0.9rem;
  padding: 10px 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 24px;
  align-items: start;
}

/* ==========================================================
   CARD DO CALENDÁRIO & FULLCALENDAR
   ========================================================== */

.calendar-card {
  background: #fafafa;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
}

.fc {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  border: none !important;
  width: 100% !important;
  max-width: 100% !important;
}

#calendar {
  height: auto !important;
  max-height: none !important;
  width: 100% !important;
}

.fc .fc-scroller,
.fc .fc-scroller-liquid-absolute,
.fc-scroller-harness {
  overflow: visible !important;
  height: auto !important;
}

.fc-theme-standard td, 
.fc-theme-standard th, 
.fc-theme-standard .fc-scrollgrid {
  border: none !important;
  background-color: transparent !important;
}

.fc .fc-toolbar {
  margin-bottom: 20px !important;
}

.fc .fc-toolbar-title {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  text-transform: capitalize;
}

.fc .fc-button-primary {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
  border-radius: 20px !important;
  font-weight: 600 !important;
  font-size: 0.8rem !important;
  padding: 6px 16px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03) !important;
  transition: all 0.2s ease !important;
}

.fc .fc-button-primary:hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

.fc .fc-col-header-cell {
  padding: 8px 0 !important;
  background: transparent !important;
}

.fc .fc-col-header-cell-cushion {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: #475569 !important;
  text-decoration: none !important;
}

.fc .fc-daygrid-day {
  background: transparent !important;
}

.fc .fc-daygrid-day-frame {
  min-height: 85px !important;
  padding: 8px !important;
  margin: 3px !important;
  border-radius: 12px !important;
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}

.fc-daygrid-day:hover .fc-daygrid-day-frame {
  border-color: #93c5fd !important;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.08) !important;
  cursor: pointer;
}

.fc .fc-daygrid-day-number {
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  text-decoration: none !important;
  padding: 0 !important;
  align-self: flex-end;
}

.fc-day-other .fc-daygrid-day-number {
  color: #cbd5e1 !important;
}

.fc-day-other .fc-daygrid-day-frame {
  background-color: #f8fafc !important;
  border-color: #f1f5f9 !important;
}

.fc .fc-day-today {
  background-color: transparent !important;
}

.fc .fc-day-today .fc-daygrid-day-frame {
  background-color: #eff6ff !important;
  border: 1.5px solid #2563eb !important;
}

.fc .fc-day-today .fc-daygrid-day-number {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border-radius: 50% !important;
  width: 22px !important;
  height: 22px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.75rem !important;
}

.fc-daygrid-event {
  background-color: #2563eb !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 4px 8px !important;
  font-weight: 600 !important;
  font-size: 0.7rem !important;
  text-align: center !important;
}

.fc-daygrid-event .fc-event-title {
  color: #ffffff !important;
}

/* Dia Selecionado no Calendário */
.fc .fc-daygrid-day.dia-selecionado .fc-daygrid-day-frame {
  background-color: #dbeafe !important; 
  border: 2px solid #2563eb !important; 
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2) !important;
}

.fc .fc-daygrid-day.dia-selecionado .fc-daygrid-day-number {
  color: #1e40af !important;
  font-weight: 800 !important;
}

/* ==========================================================
   SIDEBAR INFORMAÇÕES & CARDS FINANCEIROS
   ========================================================== */

.admin-sidebar-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.finance-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.finance-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--text-title);
}

.btn-faturamento-link {
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  border: 1px solid var(--border);
}

.btn-faturamento-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  background-color: #ffffff;
}

.icone-link {
  font-size: 1.2rem;
  color: var(--primary);
  transition: transform 0.2s ease;
}

.btn-faturamento-link:hover .icone-link {
  transform: translateX(4px);
}

.total-card {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: white;
  border: none;
}

.total-card h3 {
  color: #e0e7ff;
}

.total-valor {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 4px 0;
}

.total-card small {
  color: #93c5fd;
  font-size: 0.8rem;
}

/* ==========================================================
   TABS DE SALAS & HORÁRIOS
   ========================================================== */

.tabs-salas {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 16px;
}

.profissionais-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 180px;
  overflow-y: auto;
}

.prof-finance-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.prof-finance-item:last-child {
  border-bottom: none;
}

.valor-devido {
  font-weight: 700;
  color: var(--accent-green);
  font-size: 0.95rem;
}

.reservas-lista-admin {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: none;
  overflow: visible;
}

.turno-grupo {
  margin-bottom: 8px;
}

.turno-titulo {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
  letter-spacing: 0.06em;
}

.horarios-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: none !important;
  overflow: visible !important;
}

.horario-chip {
  padding: 12px 8px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  text-align: center;
  box-sizing: border-box;
}

.horario-chip.livre {
  background-color: #f8fafc;
  color: var(--text-muted);
}

.horario-chip.ocupado {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.horario-chip.selecionado {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.horario-chip strong {
  font-size: 0.82rem;
}

.horario-chip small {
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.btn-cancelar-chip {
  position: absolute;
  top: 3px;
  right: 3px;
  background: #ef4444;
  color: white;
  border: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  font-size: 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-cancelar-chip:hover {
  background: #dc2626;
}

/* ==========================================================
   TELA DE LOGIN
   ========================================================== */

.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  width: 100vw;
  background: linear-gradient(135deg, #16a594 0%, #189276 100%);
  padding: 20px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  box-sizing: border-box;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: surgimentoLogin 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes surgimentoLogin {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-icon-badge {
  width: 56px;
  height: 56px;
  background-color: #eff6ff;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 16px;
  border: 1px solid #2b967d26;
}

.login-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #20876c;
  margin-bottom: 4px;
}

.login-header p {
  font-size: 0.85rem;
  color: #64748b;
}

.login-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-body label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1a906b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: block;
}

.login-body input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background-color: #f8fafc;
  font-size: 1rem;
  letter-spacing: 0.15em;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.login-body input[type="password"]:focus {
  border-color: #2563eb;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  outline: none;
}

.btn-login {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 13px;
  font-size: 0.95rem;
  border-radius: 10px;
  background-color: #2563eb;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-login:hover {
  background-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-arrow {
  transition: transform 0.2s ease;
}

.btn-login:hover .btn-arrow {
  transform: translateX(4px);
}

.login-footer {
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.login-footer a {
  color: #64748b;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.login-footer a:hover {
  color: #2563eb;
}

/* ==========================================================
   MEDIA QUERIES - OTIMIZAÇÃO PARA TABLETS E CELULARES
   ========================================================== */

@media (max-width: 1024px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {

  /* Ajustes da tela principal */
  #conteudoAdmin {
    padding: 16px 12px !important;
  }

  /* Cabeçalho */
  .content-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  .content-header .header-brand {
    justify-content: flex-start;
  }

  .content-header .brand-logo {
    max-width: 65px !important;
  }

  .content-header h1 {
    font-size: 1.4rem !important;
  }

  .content-header .btn-voltar {
    text-align: center;
    width: 100%;
    padding: 12px !important;
  }

  /* Cards e Grid */
  .admin-grid {
    gap: 16px !important;
  }

  .calendar-card {
    padding: 12px !important;
    border-radius: 14px !important;
  }

  .fc .fc-toolbar {
    flex-direction: column !important;
    gap: 10px !important;
    align-items: center !important;
  }

  .fc .fc-toolbar-title {
    font-size: 1.1rem !important;
    text-align: center;
  }

  .fc .fc-button-primary {
    padding: 8px 14px !important;
    font-size: 0.85rem !important;
  }

  .fc .fc-daygrid-day-frame {
    min-height: 52px !important;
    padding: 4px !important;
    margin: 1px !important;
    border-radius: 8px !important;
  }

  .fc .fc-daygrid-day-number {
    font-size: 0.75rem !important;
  }

  .fc-daygrid-event {
    padding: 2px 4px !important;
    font-size: 0.62rem !important;
    border-radius: 4px !important;
  }

  /* Sidebar & Cards Financeiros */
  .admin-sidebar-info {
    gap: 12px !important;
  }

  .finance-card {
    padding: 16px !important;
    border-radius: 14px !important;
  }

  .total-valor {
    font-size: 1.5rem !important;
  }

  /* Tabs das Salas com Scroll Horizontal no Celular */
  .tabs-salas {
    display: flex !important;
    gap: 8px !important;
    overflow-x: auto !important;
    padding-bottom: 6px !important;
    margin-top: 12px !important;
    margin-bottom: 16px !important;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .tabs-salas .tab-btn {
    flex: 0 0 auto !important;
    padding: 8px 14px !important;
    font-size: 0.85rem !important;
  }

  /* Horários */
  .horarios-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .horario-chip {
    padding: 10px 6px !important;
    min-height: 54px;
  }

  .horario-chip strong {
    font-size: 0.85rem !important;
  }

  .horario-chip small {
    font-size: 0.7rem !important;
    max-width: 100% !important;
  }

  .btn-cancelar-chip {
    width: 22px !important;
    height: 22px !important;
    font-size: 0.75rem !important;
    top: -4px !important;
    right: -4px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  }

  /* Login */
  .login-card {
    padding: 28px 20px !important;
    max-width: 100% !important;
  }

  .login-header img {
    max-width: 200px !important;
  }
}
