@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-title: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --accent-green: #2e7d32;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-body);
  min-height: 100vh;
  overflow-x: hidden;
}

.dashboard-layout {
  display: flex;
  justify-content: center;
  width: 100vw;
  min-height: 100vh;
}

.main-content {
  width: 100%;
  max-width: 1100px;
  padding: 24px 20px 80px 20px;
  display: flex;
  flex-direction: column;
}

/* HEADER DA APLICAÇÃO */
.app-header-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0 16px 0;
  text-align: center;
  gap: 12px;
}

.brand-top {
  display: flex;
  align-items: center; 
  gap: 14px;
}

.brand-logo-centered {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
}

@media (min-width: 768px) {
  .brand-logo-centered {
    width: 80px;
    height: 80px;
  }
}

.brand-title-centered {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1a1a1a;
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

.btn-novo-agendamento {
  margin-top: 0 !important;
  padding: 10px 18px !important;
}

.link-admin-top {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: #fff;
  transition: all 0.2s ease;
}

.link-admin-top:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* FILTRO DE DATA DESTAQUE */
.bar-filtros {
  margin-bottom: 16px;
}

.filtro-data-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  width: fit-content;
}

.filtro-data-container label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-title);
  white-space: nowrap;
}

.filtro-data-container input {
  border: 1px solid var(--border);
  background: var(--bg-main);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
}

/* ABAS DE SALAS */
.tabs-salas {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 4px;
}

.tab-btn {
  flex: 1;
  min-width: 110px;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.tab-btn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #cbd5e1;
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.tab-btn.active .dot {
  background-color: #ffffff;
}

/* GRID DE HORÁRIOS */
.horarios-grid-cliente {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.card-horario-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

/* 🟢 CARD LIVRE (Fundo verde claro com borda verde) */
.card-horario-item.livre {
  border-left: 6px solid var(--accent-green);
  background-color: #eaf8f0;
}

.card-horario-item.livre:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 🔴 CARD OCUPADO (Fundo vermelho claro com borda vermelha) */
.card-horario-item.ocupado {
  border-left: 6px solid #ef4444;
  background-color: #fef2f2;
}

.card-horario-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-hora {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.livre {
  background-color: #c8e6c9;
  color: #1b5e20;
}

.status-badge.ocupado {
  background-color: #fee2e2;
  color: #991b1b;
}

.card-cliente-info {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(0,0,0,0.05);
  font-size: 0.85rem;
}

.card-cliente-info strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 🌿 BOTÃO VERDE DENTRO DO CARD LIVRE */
.btn-reservar-card {
  width: 100%;
  background-color: #387654;
  color: #ffffff;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.2s ease;
}

.btn-reservar-card:hover {
  background-color: #2b5b40;
}

.fab-agendar {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 20px;
  background-color: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 22px;
  border-radius: 50px;
  border: none;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  z-index: 99;
}

/* FORMULÁRIO E MODAL POP-UP */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.modal-overlay.ativo {
  display: flex;
}

.modal-content {
  background-color: #fff;
  width: 100%;
  max-width: 460px;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  animation: modalEntrada 0.2s ease-out;
}

@keyframes modalEntrada {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-title);
}

.btn-fechar-modal {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-title);
  text-transform: uppercase;
}

input, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: #f8fafc;
  font-size: 0.95rem;
  color: var(--text-title);
  outline: none;
}

input:focus, select:focus {
  border-color: var(--primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.btn-block {
  width: 100%;
  margin-top: 8px;
}

/* RESPONSIVIDADE MOBILE */
@media (max-width: 850px) {
  .horarios-grid-cliente {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .main-content {
    padding: 16px 12px 100px 12px;
  }

  .brand-logo {
    max-height: 55px; 
  }

  .brand-title {
    font-size: 1rem;
    margin-top: -2px;
  }

  .btn-novo-agendamento {
    display: none; 
  }

  .fab-agendar {
    display: block;
  }

  .filtro-data-container {
    width: 100%;
    justify-content: space-between;
  }

  .horarios-grid-cliente {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}