/* ============================================================
   Barbearia SaaS — Custom Styles
   ============================================================ */

/* ─── Variáveis ────────────────────────────────────────────── */
:root {
  --primary: #e94560;
  --primary-dark: #c73652;
  --dark: #1a1a2e;
  --dark2: #0f3460;
  --sidebar-width: 260px;
  --topbar-height: 56px;
  --transition: 0.2s ease;
}

/* ─── Base ──────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #333;
  background: #f5f5f5;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}
.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover {
  background-color: var(--primary);
  border-color: var(--primary);
}
a { color: var(--primary); }

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--dark);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.brand-icon-sm { color: var(--primary); font-size: 1.5rem; }
.brand-text { color: #fff; font-weight: 700; font-size: 1rem; line-height: 1.2; }

.sidebar-nav {
  list-style: none;
  padding: 1rem 0;
  margin: 0;
  flex: 1;
}
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.25rem;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: .9rem;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-nav li a i { font-size: 1.1rem; min-width: 20px; }
.sidebar-nav li a:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}
.sidebar-nav li.active a {
  color: #fff;
  border-left-color: var(--primary);
  background: rgba(233,69,96,0.1);
}
.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: .5rem 0;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.sidebar-user { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 0; }
.user-avatar {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .85rem;
  flex-shrink: 0;
}
.user-name {
  color: #fff; font-weight: 600; font-size: .85rem;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { color: rgba(255,255,255,0.45); font-size: .75rem; display: block; }
.logout-btn { color: rgba(255,255,255,0.45); font-size: 1.2rem; text-decoration: none; }
.logout-btn:hover { color: var(--primary); }

/* ─── Main Content ──────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: #f5f5f5;
}
.content-wrapper {
  padding: 1.5rem;
  max-width: 1200px;
}

/* ─── Topbar (mobile) ───────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 999;
}

/* ─── Sidebar Overlay (mobile) ──────────────────────────────── */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.sidebar-overlay.active { opacity: 1; pointer-events: all; }

/* ─── Metric Cards ──────────────────────────────────────────── */
.metric-card .card-body {
  display: flex; flex-direction: column; gap: .5rem;
  padding: 1.25rem;
}
.metric-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.bg-primary-soft { background: rgba(233,69,96,0.1); }
.bg-success-soft { background: rgba(25,135,84,0.1); }
.bg-warning-soft { background: rgba(255,193,7,0.15); }
.bg-info-soft { background: rgba(13,202,240,0.1); }
.metric-value { font-size: 1.4rem; font-weight: 700; color: #1a1a2e; line-height: 1; }
.metric-label { font-size: .78rem; color: #666; }

/* ─── Status Badges ─────────────────────────────────────────── */
.badge-agendado { background: #0d6efd; color: #fff; }
.badge-confirmado { background: #198754; color: #fff; }
.badge-concluido { background: #6c757d; color: #fff; }
.badge-cancelado { background: #dc3545; color: #fff; }
.badge-nao-compareceu { background: #fd7e14; color: #fff; }

/* ─── Barber Cards ──────────────────────────────────────────── */
.barber-card { transition: transform var(--transition), box-shadow var(--transition); }
.barber-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important; }

.barber-photo {
  width: 56px; height: 56px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid #eee;
}
.barber-avatar {
  width: 56px; height: 56px;
  border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 1.4rem;
  flex-shrink: 0;
}

.avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .75rem;
  flex-shrink: 0;
}

/* ─── Service Check ─────────────────────────────────────────── */
.service-check { cursor: pointer; transition: background var(--transition); }
.service-check:has(input:checked) { background: #fff5f7; border-color: var(--primary) !important; }
.day-check { display: flex; align-items: center; gap: .4rem; cursor: pointer; }

/* ─── Info rows (appointment show) ─────────────────────────── */
.info-row {
  display: flex; align-items: flex-start; gap: .5rem;
  padding: .75rem;
  background: #f8f9fa;
  border-radius: 8px;
}
.info-row i { margin-top: 2px; font-size: 1.1rem; }

/* ─── Plan Cards ────────────────────────────────────────────── */
.plan-card { transition: transform var(--transition); position: relative; overflow: hidden; }
.plan-card:hover { transform: translateY(-4px); }
.plan-featured { border: 2px solid var(--primary) !important; }
.plan-badge-top {
  position: absolute; top: 0; right: 0;
  background: var(--primary); color: #fff;
  font-size: .7rem; font-weight: 700;
  padding: .25rem .75rem;
  border-bottom-left-radius: 8px;
}
.plan-price { margin: .5rem 0; }
.price-currency { font-size: 1.1rem; font-weight: 600; color: #333; vertical-align: top; margin-top: .5rem; display: inline-block; }
.price-value { font-size: 3rem; font-weight: 900; color: var(--dark); line-height: 1; }
.price-period { font-size: .9rem; color: #666; }
.plan-icon-lg {
  width: 56px; height: 56px; border-radius: 12px;
  background: rgba(233,69,96,0.1); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}

/* ─── Booking Public Pages ──────────────────────────────────── */
.progress-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 1.5rem;
}
.step {
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
  min-width: 70px;
}
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: #e9ecef; color: #6c757d;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
  border: 2px solid #dee2e6;
  transition: all var(--transition);
}
.step.active .step-num { background: var(--primary); color: #fff; border-color: var(--primary); }
.step.done .step-num { background: #198754; color: #fff; border-color: #198754; }
.step-label { font-size: .75rem; color: #6c757d; }
.step.active .step-label { color: var(--primary); font-weight: 600; }
.step-line {
  flex: 1; height: 2px; background: #dee2e6;
  min-width: 30px; max-width: 80px; margin-top: -18px;
}
.step-line.done { background: #198754; }

.booking-card {
  transition: all var(--transition);
  border: 2px solid transparent !important;
  cursor: pointer;
}
.booking-card:hover {
  border-color: var(--primary) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(233,69,96,0.15) !important;
}
.service-icon { font-size: 2.5rem; color: var(--primary); }
.service-price { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.service-duration { font-size: .85rem; }

.barber-photo-lg {
  width: 64px; height: 64px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid #eee; flex-shrink: 0;
}
.barber-avatar-lg {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.6rem; flex-shrink: 0;
}

.selected-summary {
  background: #f8f9fa; border-radius: 10px;
  padding: .75rem 1rem; border: 1px solid #e9ecef;
}

/* Datas */
.dates-grid {
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.date-btn {
  display: flex; flex-direction: column; align-items: center;
  padding: .5rem .75rem;
  border: 2px solid #dee2e6; border-radius: 10px;
  background: #fff; cursor: pointer;
  min-width: 60px; transition: all var(--transition);
}
.date-btn:hover { border-color: var(--primary); }
.date-btn.selected {
  border-color: var(--primary); background: var(--primary); color: #fff;
}
.date-weekday { font-size: .65rem; text-transform: uppercase; opacity: .7; }
.date-day { font-size: 1.3rem; font-weight: 700; line-height: 1; }
.date-month { font-size: .65rem; opacity: .7; }

/* Horários */
.slots-grid {
  display: flex; flex-wrap: wrap; gap: .4rem;
}
.slot-btn {
  padding: .5rem 1rem;
  border: 2px solid #dee2e6; border-radius: 8px;
  background: #fff; cursor: pointer;
  font-weight: 600; font-size: .9rem;
  transition: all var(--transition); min-width: 70px;
}
.slot-btn:hover { border-color: var(--primary); color: var(--primary); }
.slot-btn.selected { border-color: var(--primary); background: var(--primary); color: #fff; }

/* ─── Success Page ──────────────────────────────────────────── */
.success-circle {
  width: 90px; height: 90px; border-radius: 50%;
  background: #d4edda; color: #198754;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; margin: 0 auto;
}

.appointment-detail {
  display: flex; align-items: center;
  padding: .6rem 0; border-bottom: 1px solid #f0f0f0;
}
.appointment-detail:last-child { border-bottom: none; }
.detail-label { min-width: 130px; color: #666; font-size: .9rem; }
.detail-value { font-size: .95rem; }

/* ─── Mobile Responsive ─────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .content-wrapper {
    padding: 1rem;
  }
}

@media (max-width: 575.98px) {
  .metric-value { font-size: 1.2rem; }
  .dates-grid { gap: .3rem; }
  .date-btn { min-width: 52px; padding: .4rem .6rem; }
}

/* ─── Print ─────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .btn, form { display: none !important; }
  .main-content { margin-left: 0; }
}
