/* ============================================================
   Sistema Peluquería — app.css
   Diseño moderno oscuro con acentos violeta/rosa
   ============================================================ */

:root {
  --primary:        #8B5CF6;
  --primary-dark:   #7C3AED;
  --primary-light:  #A78BFA;
  --accent:         #EC4899;
  --accent-dark:    #DB2777;
  --success:        #10B981;
  --warning:        #F59E0B;
  --danger:         #EF4444;
  --info:           #06B6D4;

  /* Superficies */
  --bg:             #0D0D0D;
  --bg-card:        #161616;
  --bg-card2:       #1E1E1E;
  --bg-input:       #1A1A1A;
  --border:         rgba(255,255,255,0.07);
  --border-focus:   rgba(139,92,246,0.6);

  /* Texto */
  --text:           #F1F1F1;
  --text-muted:     #9CA3AF;
  --text-xs:        #6B7280;

  /* Sidebar */
  --sidebar-w:      260px;
  --sidebar-bg:     #0A0A0A;

  /* Radios / sombras */
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      16px;
  --shadow:         0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.6);
  --glow:           0 0 20px rgba(139,92,246,0.25);

  --transition:     0.2s ease;
}

/* ── Reset base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  font-weight: 600;
}
.card-body { padding: 1.25rem; }
.card-footer {
  background: transparent;
  border-top: 1px solid var(--border);
  padding: 0.875rem 1.25rem;
}

/* ── Formularios ───────────────────────────────────────────── */
.form-control, .form-select, .form-check-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.875rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control::placeholder { color: var(--text-xs); }
.form-control:focus, .form-select:focus {
  background: var(--bg-input);
  color: var(--text);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
  outline: none;
}
.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}
.form-text { color: var(--text-xs); font-size: 0.78rem; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-select option { background: var(--bg-card2); color: var(--text); }

/* Input group */
.input-group-text {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ── Botones ────────────────────────────────────────────────── */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.55rem 1.1rem;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  color: #fff;
  box-shadow: 0 4px 15px rgba(139,92,246,0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--accent-dark));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139,92,246,0.45);
  color: #fff;
}
.btn-outline-primary {
  border: 1px solid var(--primary);
  color: var(--primary-light);
  background: transparent;
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  border-color: var(--danger);  color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #000; }
.btn-secondary {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-secondary:hover { background: var(--bg-card); color: var(--text); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 1.5rem; font-size: 1rem; border-radius: var(--radius); }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 8px; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge { border-radius: 6px; font-weight: 500; letter-spacing: 0.02em; }

/* ── Tablas ─────────────────────────────────────────────────── */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
  --bs-table-hover-bg: rgba(139,92,246,0.07);
  --bs-table-striped-bg: rgba(255,255,255,0.02);
  font-size: 0.875rem;
}
.table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
}
.table td { padding: 0.75rem 1rem; vertical-align: middle; border-color: var(--border); }
.table-hover tbody tr:hover { background: var(--bs-table-hover-bg); }

/* ── Layout principal ──────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}
.sidebar-brand {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-brand-tagline { font-size: 0.7rem; color: var(--text-xs); }
.sidebar-nav { padding: 1rem 0; flex: 1; }
.sidebar-section { padding: 0.5rem 1.25rem 0.25rem; }
.sidebar-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-xs);
  font-weight: 600;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0;
  transition: all var(--transition);
  position: relative;
}
.sidebar-link i { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-link:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.sidebar-link.active {
  color: var(--primary-light);
  background: rgba(139,92,246,0.1);
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(var(--primary), var(--accent));
  border-radius: 0 2px 2px 0;
}
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem;
}
.sidebar-user { display: flex; align-items: center; gap: 0.75rem; }
.sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sidebar-user-name { font-size: 0.85rem; font-weight: 600; }
.sidebar-user-role { font-size: 0.7rem; color: var(--text-xs); text-transform: capitalize; }

/* ── Main content ───────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky; top: 0; z-index: 100;
}
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--text); flex: 1; }
.page-content { padding: 1.5rem; flex: 1; }

/* ── Stats cards ────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.stat-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}
.stat-card-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-card-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }
.stat-card-trend { font-size: 0.75rem; margin-top: 0.5rem; }

/* ── Appointment slots ──────────────────────────────────────── */
.appt-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  transition: all var(--transition);
  cursor: pointer;
}
.appt-card:hover { border-left-color: var(--accent); box-shadow: var(--glow); }
.appt-time { font-size: 0.8rem; color: var(--primary-light); font-weight: 600; }
.appt-client { font-weight: 600; font-size: 0.9rem; }
.appt-service { font-size: 0.78rem; color: var(--text-muted); }

/* ── Status badges ──────────────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
.status-confirmed  { background: rgba(16,185,129,0.15); color: #10B981; }
.status-pending    { background: rgba(245,158,11,0.15);  color: #F59E0B; }
.status-completed  { background: rgba(99,102,241,0.15);  color: #818CF8; }
.status-cancelled  { background: rgba(239,68,68,0.15);   color: #EF4444; }
.status-no_show    { background: rgba(107,114,128,0.15); color: #9CA3AF; }
.status-in_progress{ background: rgba(6,182,212,0.15);   color: #06B6D4; }

/* ── Ficha técnica ──────────────────────────────────────────── */
.formula-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  white-space: pre-wrap;
  color: var(--primary-light);
}
.record-card {
  border-left: 4px solid var(--primary);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
  transition: all var(--transition);
}
.record-card:hover { border-left-color: var(--accent); }
.record-card.color-record { border-left-color: var(--accent); }

/* ── Avatar initials ─────────────────────────────────────────── */
.avatar-initials {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-sm  { width: 32px; height: 32px; font-size: 0.7rem; }
.avatar-lg  { width: 56px; height: 56px; font-size: 1rem; }
.avatar-xl  { width: 80px; height: 80px; font-size: 1.25rem; }

/* ── Toasts / Flash ─────────────────────────────────────────── */
.flash-container {
  position: fixed; top: 1rem; right: 1rem;
  z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem;
  max-width: 360px;
}
.flash-msg {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  animation: slideIn 0.3s ease;
}
.flash-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #10B981; }
.flash-error   { background: rgba(239,68,68,0.15);  border: 1px solid rgba(239,68,68,0.3);  color: #EF4444; }
.flash-warning { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); color: #F59E0B; }
.flash-info    { background: rgba(6,182,212,0.15);  border: 1px solid rgba(6,182,212,0.3);  color: #06B6D4; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Navbar toggle (móvil) ──────────────────────────────────── */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1039;
  backdrop-filter: blur(2px);
}

/* ── Pagination ─────────────────────────────────────────────── */
.page-link {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm) !important;
}
.page-link:hover, .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Modals ─────────────────────────────────────────────────── */
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
}
.modal-footer { border-top: 1px solid var(--border); }
.btn-close { filter: invert(1); }

/* ── Stars rating ───────────────────────────────────────────── */
.stars { color: #F59E0B; }
.star-empty { color: var(--border); }

/* ── Dropzone foto ──────────────────────────────────────────── */
.photo-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.photo-drop:hover, .photo-drop.dragover {
  border-color: var(--primary);
  background: rgba(139,92,246,0.05);
  color: var(--primary-light);
}

/* ── Public home ────────────────────────────────────────────── */
.public-nav {
  position: fixed; top: 0; width: 100%;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  padding: 0.75rem 0;
}
.hero {
  min-height: 100vh;
  background: linear-gradient(135deg, #0D0D0D 0%, #1a0533 50%, #0D0D0D 100%);
  display: flex; align-items: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(139,92,246,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, var(--primary-light) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle { font-size: 1.15rem; color: var(--text-muted); max-width: 520px; }
.services-section { padding: 5rem 0; }
.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}
.service-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--glow);
}
.service-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1rem;
}

/* ── Swiper override ────────────────────────────────────────── */
.swiper-pagination-bullet-active { background: var(--primary) !important; }
.swiper-button-next::after, .swiper-button-prev::after { color: var(--primary-light) !important; font-size: 1.2rem !important; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 1040;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .sidebar-toggle { display: block; }
  .main-content { margin-left: 0; }
  .page-content { padding: 1rem; }
  .topbar { padding: 0.75rem 1rem; }
}
@media (max-width: 575.98px) {
  .stat-card-value { font-size: 1.4rem; }
  .page-content { padding: 0.75rem; }
}

/* ── Calendar ───────────────────────────────────────────────── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day {
  min-height: 80px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  transition: all var(--transition);
}
.cal-day:hover { border-color: var(--primary); }
.cal-day.today { border-color: var(--primary); box-shadow: var(--glow); }
.cal-day.other-month { opacity: 0.35; }
.cal-day-num { font-size: 0.8rem; font-weight: 600; }
.cal-appt-dot {
  display: block;
  font-size: 0.65rem;
  border-radius: 3px;
  padding: 1px 4px;
  margin-top: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ── Utilities extra ────────────────────────────────────────── */
.text-primary  { color: var(--primary-light) !important; }
.text-accent   { color: var(--accent) !important; }
.text-muted    { color: var(--text-muted) !important; }
.bg-primary-soft { background: rgba(139,92,246,0.1) !important; }
.border-primary  { border-color: var(--primary) !important; }
.divider { border-color: var(--border); }
.rounded-xl { border-radius: var(--radius-lg) !important; }
.fw-semibold { font-weight: 600; }
.loading-spinner { display: inline-block; width:20px; height:20px; border:2px solid var(--border); border-top-color:var(--primary); border-radius:50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Gradient text util ─────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
