/* ============================================================
   assets/css/app.css  —  Salon PRO Admin Panel
   ============================================================ */

/* ── Fuentes ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Variables ───────────────────────────────────────────── */
:root {
  --sidebar-w:    240px;
  --sidebar-bg:   #0f1117;
  --sidebar-txt:  #8b92a5;
  --sidebar-act:  #ffffff;
  --accent:       #6c63ff;
  --accent-light: #8b84ff;
  --accent-dim:   rgba(108,99,255,.12);
  --surface:      #ffffff;
  --bg:           #f4f5fa;
  --border:       #e8eaf0;
  --text:         #1a1d2e;
  --text-muted:   #6b7280;
  --danger:       #ef4444;
  --success:      #10b981;
  --warning:      #f59e0b;
  --info:         #3b82f6;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 2px 12px rgba(0,0,0,.06);
  --shadow-md:    0 4px 24px rgba(0,0,0,.10);
  --transition:   .18s ease;
}

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

body {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}

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

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-brand .brand-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.sidebar-brand .brand-name {
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  letter-spacing: -.3px;
}

.sidebar-brand .brand-version {
  font-size: 10px;
  color: var(--sidebar-txt);
  font-family: 'JetBrains Mono', monospace;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(139,146,165,.5);
  padding: 8px 10px 4px;
  margin-top: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-txt);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  transition: all var(--transition);
  margin-bottom: 2px;
}

.nav-link:hover {
  color: var(--sidebar-act);
  background: rgba(255,255,255,.06);
}

.nav-link.active {
  color: var(--sidebar-act);
  background: var(--accent-dim);
  color: var(--accent-light);
}

.nav-link .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 15px;
  opacity: .85;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.04);
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: var(--sidebar-txt); }

/* ── Contenido principal ─────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-body {
  padding: 28px;
  flex: 1;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-weight: 600;
  font-size: 15px;
  margin: 0;
}

/* ── Stat cards ──────────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.purple  { background: rgba(108,99,255,.12); color: var(--accent); }
.stat-icon.green   { background: rgba(16,185,129,.12);  color: var(--success); }
.stat-icon.red     { background: rgba(239,68,68,.12);   color: var(--danger); }
.stat-icon.blue    { background: rgba(59,130,246,.12);  color: var(--info); }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Tabla ───────────────────────────────────────────────── */
.table-custom {
  width: 100%;
  border-collapse: collapse;
}

.table-custom thead th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table-custom tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13.5px;
}

.table-custom tbody tr:last-child td { border-bottom: none; }

.table-custom tbody tr:hover { background: rgba(108,99,255,.03); }

/* ── Badge de rol ────────────────────────────────────────── */
.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
}

/* ── Status dot ──────────────────────────────────────────── */
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.status-dot::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-dot.active  { color: var(--success); }
.status-dot.inactive { color: var(--text-muted); }

/* ── Botones ─────────────────────────────────────────────── */
.btn-primary-custom {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
  font-family: 'Sora', sans-serif;
}

.btn-primary-custom:hover { background: var(--accent-light); color: #fff; transform: translateY(-1px); }

.btn-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-icon.edit   { background: rgba(245,158,11,.12); color: var(--warning); }
.btn-icon.delete { background: rgba(239,68,68,.12);  color: var(--danger); }
.btn-icon.edit:hover   { background: var(--warning); color: #fff; }
.btn-icon.delete:hover { background: var(--danger);  color: #fff; }

/* ── Formularios ─────────────────────────────────────────── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  max-width: 560px;
}

.form-label-custom {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: block;
}

.form-control-custom {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Sora', sans-serif;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control-custom:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.role-check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.role-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
  font-weight: 500;
}

.role-check-item:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent-light);
}

.role-check-item input { cursor: pointer; }

/* ── Alerts / Flash ──────────────────────────────────────── */
.flash-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 20px;
  animation: slideDown .2s ease;
}

.flash-msg.success { background: rgba(16,185,129,.1);  color: #065f46; border: 1px solid rgba(16,185,129,.3); }
.flash-msg.error   { background: rgba(239,68,68,.1);   color: #991b1b; border: 1px solid rgba(239,68,68,.3); }

@keyframes slideDown {
  from { opacity:0; transform: translateY(-8px); }
  to   { opacity:1; transform: translateY(0); }
}

/* ── Paginación ──────────────────────────────────────────── */
.pagination-custom {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
}

.page-btn {
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: all var(--transition);
}

.page-btn:hover, .page-btn.current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.page-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ── Login page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,99,255,.2) 0%, transparent 70%);
  top: -200px; right: -200px;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,99,255,.12) 0%, transparent 70%);
  bottom: -100px; left: -100px;
}

.login-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  padding: 42px;
  width: 100%;
  max-width: 400px;
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 1;
}

.login-logo {
  width: 52px; height: 52px;
  background: var(--accent);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin: 0 auto 22px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-bottom: 6px;
}

.login-sub {
  font-size: 13px;
  color: rgba(255,255,255,.4);
  text-align: center;
  margin-bottom: 28px;
}

.login-input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  outline: none;
  margin-bottom: 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.login-input::placeholder { color: rgba(255,255,255,.3); }

.login-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,.2);
}

.login-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  margin-top: 6px;
}

.login-btn:hover { background: var(--accent-light); transform: translateY(-1px); }

.login-error {
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .role-check-grid { grid-template-columns: 1fr; }
}

/* ── Modal de confirmación ───────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}

.modal-overlay.show { opacity: 1; pointer-events: all; }

.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-md);
  transform: scale(.96);
  transition: transform .2s;
}

.modal-overlay.show .modal-box { transform: scale(1); }

.modal-icon {
  width: 52px; height: 52px;
  background: rgba(239,68,68,.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin: 0 auto 16px;
}

.modal-title { font-size: 17px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.modal-desc  { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 22px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions button { flex: 1; padding: 10px; border-radius: var(--radius-sm); font-family: 'Sora', sans-serif; font-weight: 600; font-size: 13px; cursor: pointer; border: none; }
.btn-cancel  { background: var(--bg); color: var(--text); border: 1px solid var(--border) !important; }
.btn-confirm { background: var(--danger); color: #fff; }
