/* ========== RESET E VARIÁVEIS ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #8a2e73;
  --primary-light: #b856a2;
  --primary-dark: #6b235a;
  --secondary: #f8f3f7;
  --accent: #d4af37;
  --bg-dark: #0f172a;
  --bg-light: #f8f9fa;
  --text-dark: #2d3748;
  --text-light: #718096;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --orange: #fb923c;
  --shadow: 0 4px 20px rgba(138, 46, 115, 0.1);
  --shadow-lg: 0 10px 40px rgba(138, 46, 115, 0.15);
}

body {
  font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--text-dark);
  line-height: 1.6;
}

/* ========== CONTAINER PRINCIPAL ========== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  text-align: center;
  margin-bottom: 30px;
  color: white;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 5px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* ========== TELA DE LOGIN ========== */
#adminLogin {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 100%;
  animation: fadeInUp 0.5s ease;
}

.login-box h2 {
  color: var(--primary);
  margin-bottom: 25px;
  text-align: center;
  font-size: 1.8rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-dark);
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(138, 46, 115, 0.1);
}

/* ========== BOTÕES ========== */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-delete {
  background: var(--danger);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.btn-delete:hover {
  background: #dc2626;
}

/* ========== DASHBOARD ========== */
#adminDashboard {
  display: none;
  animation: fadeInUp 0.5s ease;
}

.dashboard-header {
  background: white;
  padding: 25px;
  border-radius: 15px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

.welcome h2 {
  color: var(--primary);
  margin-bottom: 5px;
}

.welcome p {
  color: var(--text-light);
  font-size: 0.95rem;
}

.logout-btn {
  background: var(--danger);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

/* ========== TABS ========== */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  background: white;
  padding: 10px;
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.tab-btn {
  flex: 1;
  padding: 15px 20px;
  background: transparent;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  background: var(--secondary);
  color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

/* ========== CARDS DE ESTATÍSTICAS ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.stat-card.purple::before { background: var(--purple); }
.stat-card.blue::before { background: var(--blue); }
.stat-card.green::before { background: var(--success); }
.stat-card.orange::before { background: var(--orange); }

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  font-size: 3rem;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: var(--secondary);
}

.stat-info {
  flex: 1;
}

.stat-info h3 {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ========== GRÁFICOS ========== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.chart-card {
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.chart-card.full-width {
  grid-column: 1 / -1;
}

.chart-card h3 {
  color: var(--primary);
  margin-bottom: 20px;
  font-size: 1.2rem;
  border-bottom: 2px solid var(--secondary);
  padding-bottom: 10px;
}

.services-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.service-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: var(--bg-light);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.service-item:hover {
  background: var(--secondary);
  transform: translateX(5px);
}

.service-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.service-icon {
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
}

.service-details h4 {
  color: var(--text-dark);
  margin-bottom: 3px;
}

.service-details p {
  color: var(--text-light);
  font-size: 0.9rem;
}

.service-stats {
  text-align: right;
}

.service-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.service-revenue {
  font-size: 0.9rem;
  color: var(--success);
  font-weight: 600;
}

/* ========== FATURAMENTO SEMANAL ========== */
.week-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.week-day {
  display: flex;
  align-items: center;
  gap: 15px;
}

.day-name {
  width: 80px;
  font-weight: 600;
  color: var(--text-dark);
}

.day-bar {
  flex: 1;
  height: 30px;
  background: var(--bg-light);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.day-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  transition: width 0.8s ease;
}

/* ========== PRÓXIMOS AGENDAMENTOS ========== */
.upcoming-appointments {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.appointment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--bg-light);
  border-radius: 12px;
  border-left: 4px solid var(--primary);
  transition: all 0.3s ease;
}

.appointment-item:hover {
  background: var(--secondary);
  transform: translateX(5px);
}

.appointment-time {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 100px;
}

.time-badge {
  background: var(--primary);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.appointment-client {
  flex: 1;
}

.appointment-client h4 {
  color: var(--text-dark);
  margin-bottom: 3px;
}

.appointment-client p {
  color: var(--text-light);
  font-size: 0.9rem;
}

.appointment-service {
  text-align: right;
}

.service-badge {
  background: var(--success);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.price-badge {
  color: var(--success);
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: 5px;
}

/* ========== TABELA ========== */
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.table-header h2 {
  color: white;
}

.table-container {
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--secondary);
}

th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

td {
  padding: 15px;
  border-bottom: 1px solid #e2e8f0;
}

tbody tr:hover {
  background: var(--bg-light);
}

.message {
  text-align: center;
  color: var(--text-light);
  padding: 40px !important;
}

.loading {
  text-align: center;
  color: var(--text-light);
  padding: 20px;
}

/* ========== RELATÓRIOS ========== */
.filters-section {
  background: white;
  padding: 25px;
  border-radius: 15px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.filters-section h3 {
  color: var(--primary);
  margin-bottom: 20px;
}

.filters {
  display: flex;
  gap: 20px;
  align-items: end;
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-dark);
  font-weight: 500;
}

.filter-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
}

.filter-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.report-card {
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: var(--shadow);
  text-align: center;
}

.report-card h4 {
  color: var(--text-light);
  margin-bottom: 15px;
  font-size: 0.95rem;
}

.report-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

/* ========== ANIMAÇÕES ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== RESPONSIVIDADE ========== */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .charts-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .tabs {
    flex-direction: column;
  }
  
  .filters {
    flex-direction: column;
  }
  
  .table-container {
    overflow-x: scroll;
  }
  
  .header h1 {
    font-size: 2rem;
  }
}
