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

:root {
  --bg-primary   : #0F1117;
  --bg-card      : #1A1D27;
  --bg-input     : #0F1117;
  --border       : #2D2F3E;
  --purple       : #7C3AED;
  --blue         : #3B82F6;
  --purple-light : #A78BFA;
  --blue-light   : #60A5FA;
  --text-primary : #F8FAFC;
  --text-muted   : #94A3B8;
  --gradient     : linear-gradient(90deg, #7C3AED, #3B82F6);
  --radius-sm    : 8px;
  --radius-md    : 12px;
  --radius-lg    : 16px;
}

body {
  font-family    : 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background     : var(--bg-primary);
  color          : var(--text-primary);
  min-height     : 100vh;
  font-size      : 15px;
  line-height    : 1.6;
}

/* ── Tipografía ────────────────────────────────────────────── */
h1 { font-size: 2rem;   font-weight: 600; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 500; }
p  { color: var(--text-muted); }

.gradient-text {
  background             : var(--gradient);
  -webkit-background-clip: text;
  background-clip        : text;
  -webkit-text-fill-color: transparent;
}

/* ── Layout ────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.section   { padding: 60px 0; }

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  background    : rgba(26, 29, 39, 0.95);
  border-bottom : 0.5px solid var(--border);
  padding       : 14px 0;
  position      : sticky;
  top           : 0;
  z-index       : 100;
  backdrop-filter: blur(10px);
}

.navbar .container {
  display         : flex;
  align-items     : center;
  justify-content : space-between;
  gap             : 20px;
}

.logo {
  font-size  : 22px;
  font-weight: 700;
  background : var(--gradient);
  -webkit-background-clip: text;
  background-clip        : text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.nav-links {
  display : flex;
  gap     : 28px;
  list-style: none;
}

.nav-links a {
  color          : var(--text-muted);
  text-decoration: none;
  font-size      : 14px;
  transition     : color 0.2s;
}

.nav-links a:hover { color: var(--text-primary); }

.nav-actions { display: flex; gap: 10px; align-items: center; }

/* ── Botones ───────────────────────────────────────────────── */
.btn {
  padding        : 10px 22px;
  border-radius  : var(--radius-sm);
  font-size      : 14px;
  font-weight    : 500;
  cursor         : pointer;
  border         : none;
  transition     : opacity 0.2s, transform 0.1s;
  text-decoration: none;
  display        : inline-block;
}

.btn:hover   { opacity: 0.9; }
.btn:active  { transform: scale(0.98); }

.btn-primary {
  background: var(--gradient);
  color     : #fff;
}

.btn-outline {
  background: transparent;
  border    : 0.5px solid var(--purple);
  color     : var(--purple-light);
}

.btn-ghost {
  background: transparent;
  color     : var(--text-muted);
}

.btn-full  { width: 100%; text-align: center; }
.btn-sm    { padding: 7px 16px; font-size: 13px; }
.btn-lg    { padding: 14px 32px; font-size: 16px; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background   : var(--bg-card);
  border       : 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding      : 20px;
}

.card:hover { border-color: var(--purple); transition: border-color 0.2s; }

/* ── Formularios ───────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display      : block;
  font-size    : 13px;
  color        : var(--text-muted);
  margin-bottom: 7px;
}

.form-input {
  width        : 100%;
  background   : var(--bg-input);
  border       : 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding      : 11px 14px;
  color        : var(--text-primary);
  font-size    : 14px;
  transition   : border-color 0.2s;
}

.form-input:focus {
  outline      : none;
  border-color : var(--purple);
}

.form-select {
  width        : 100%;
  background   : var(--bg-input);
  border       : 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding      : 11px 14px;
  color        : var(--text-primary);
  font-size    : 14px;
  cursor       : pointer;
}

/* ── Grid ──────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display      : inline-block;
  font-size    : 11px;
  padding      : 3px 10px;
  border-radius: 20px;
  font-weight  : 500;
}

.badge-purple { background: #1E1533; color: var(--purple-light); border: 0.5px solid #4C1D95; }
.badge-blue   { background: #0C1F3A; color: var(--blue-light);   border: 0.5px solid #1E3A5F; }
.badge-green  { background: #052E16; color: #4ADE80; border: 0.5px solid #14532D; }
.badge-gray   { background: #1E2030; color: var(--text-muted);   border: 0.5px solid var(--border); }

/* ── Avatar ────────────────────────────────────────────────── */
.avatar {
  width          : 44px;
  height         : 44px;
  border-radius  : 50%;
  background     : var(--gradient);
  display        : flex;
  align-items    : center;
  justify-content: center;
  font-weight    : 600;
  font-size      : 15px;
  color          : #fff;
  flex-shrink    : 0;
}

/* ── Estrellas ─────────────────────────────────────────────── */
.stars { color: #FBBF24; font-size: 13px; }

/* ── Alertas ───────────────────────────────────────────────── */
.alert {
  padding      : 12px 16px;
  border-radius: var(--radius-sm);
  font-size    : 14px;
  margin-bottom: 16px;
}

.alert-error   { background: #1F0B0B; border: 0.5px solid #7F1D1D; color: #FCA5A5; }
.alert-success { background: #052E16; border: 0.5px solid #14532D; color: #4ADE80; }
.alert-info    { background: #0C1F3A; border: 0.5px solid #1E3A5F; color: var(--blue-light); }

/* ── Spinner ───────────────────────────────────────────────── */
.spinner {
  width        : 20px;
  height       : 20px;
  border       : 2px solid var(--border);
  border-top   : 2px solid var(--purple);
  border-radius: 50%;
  animation    : spin 0.8s linear infinite;
  display      : inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ────────────────────────────────────────────── */

/* Tablets */
@media (max-width: 1024px) {
  .container { padding: 0 16px; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.3rem; }
}

/* Celulares */
@media (max-width: 768px) {
  body { font-size: 14px; }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1rem; }

  .section { padding: 30px 0; }
  .container { padding: 0 14px; }

  /* Navbar móvil */
  .navbar { padding: 10px 0; }
  .nav-links { display: none; }
  .navbar .container { gap: 10px; flex-wrap: wrap; }
  .nav-actions { gap: 6px; }
  .logo { font-size: 20px; }

  /* Botones */
  .btn    { padding: 9px 16px; font-size: 13px; }
  .btn-sm { padding: 6px 12px; font-size: 12px; }
  .btn-lg { padding: 11px 22px; font-size: 14px; }

  /* Cards */
  .card { padding: 16px; }

  /* Grids */
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Forms */
  .form-input, .form-select { padding: 10px 12px; font-size: 14px; }

  /* Toasts en móvil */
  .toast-container {
    top: 70px;
    right: 10px;
    left: 10px;
  }
  .toast {
    min-width: auto;
    max-width: 100%;
  }

  /* Modal confirmación */
  .confirm-box {
    padding: 20px;
    margin: 10px;
  }

  /* Avatares más pequeños */
  .avatar {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }
}

/* Móviles pequeños */
@media (max-width: 480px) {
  h1 { font-size: 1.3rem; }

  .container { padding: 0 12px; }

  .grid-4 { grid-template-columns: 1fr; }

  /* Botones full width en móvil */
  .nav-actions .btn:not(.btn-ghost) {
    padding: 7px 12px;
    font-size: 12px;
  }

  /* Tabs scrolleables */
  .flex.gap-1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .flex.gap-1::-webkit-scrollbar { display: none; }
  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* ── Utilidades ────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mt-1 { margin-top: 8px;  }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px;  }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex        { display: flex; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none; }

/* ── Toast Notifications ──────────────────────────────────── */
.toast-container {
  position : fixed;
  top      : 80px;
  right    : 20px;
  z-index  : 9999;
  display  : flex;
  flex-direction: column;
  gap      : 10px;
  pointer-events: none;
}

.toast {
  background   : var(--bg-card);
  border       : 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding      : 14px 18px;
  min-width    : 280px;
  max-width    : 380px;
  display      : flex;
  align-items  : center;
  gap          : 12px;
  box-shadow   : 0 8px 24px rgba(0,0,0,0.4);
  pointer-events: auto;
  animation    : toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left  : 3px solid var(--purple);
}

.toast.success { border-left-color: #4ADE80; }
.toast.error   { border-left-color: #FCA5A5; }
.toast.warning { border-left-color: #FBBF24; }
.toast.info    { border-left-color: #60A5FA; }

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-content { flex: 1; font-size: 14px; line-height: 1.4; }

.toast-close {
  background: transparent;
  border    : none;
  color     : var(--text-muted);
  cursor    : pointer;
  font-size : 16px;
  padding   : 0;
  opacity   : 0.6;
}

.toast-close:hover { opacity: 1; }

.toast.salida { animation: toast-out 0.3s ease-in forwards; }

@keyframes toast-in {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

@keyframes toast-out {
  to { transform: translateX(120%); opacity: 0; }
}

/* ── Animaciones generales ────────────────────────────────── */
.card { transition: all 0.2s ease; }
.btn  { transition: all 0.15s ease; }

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

/* Fade in al cargar contenido */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fade-in-up 0.4s ease-out; }

/* Skeleton loader */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

.skeleton {
  background: linear-gradient(90deg, #1A1D27, #252836, #1A1D27);
  background-size: 200% 100%;
  animation: skeleton-shine 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shine {
  to { background-position: -200% 0; }
}

/* Modales con animación */
.modal-overlay {
  animation: fade-in 0.2s ease-out;
}

.modal-content {
  animation: modal-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Confirmación modal */
.confirm-overlay {
  position: fixed;
  inset   : 0;
  background: rgba(0,0,0,0.7);
  z-index : 9998;
  display : flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.2s ease-out;
}

.confirm-box {
  background: var(--bg-card);
  border    : 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding   : 24px;
  max-width : 400px;
  margin    : 20px;
  text-align: center;
  animation : modal-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

/* ── Campos deshabilitados ────────────────────────────────── */
.form-input:disabled,
.form-select:disabled {
  opacity       : 0.5;
  cursor        : not-allowed;
  user-select   : none;
}

/* ── Validaciones en formularios ──────────────────────────── */
.form-input.error, .form-select.error {
  border-color: #FCA5A5;
}

.form-input.success {
  border-color: #4ADE80;
}

.form-hint {
  font-size : 12px;
  color     : var(--text-muted);
  margin-top: 4px;
  display   : flex;
  align-items: center;
  gap       : 4px;
}

.form-hint.error   { color: #FCA5A5; }
.form-hint.success { color: #4ADE80; }

/* Strength bar para contraseña */
.password-strength {
  height       : 4px;
  background   : var(--border);
  border-radius: 2px;
  margin-top   : 6px;
  overflow     : hidden;
  transition   : all 0.3s ease;
}

.password-strength-bar {
  height    : 100%;
  width     : 0%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.password-strength-bar.weak   { width: 33%;  background: #FCA5A5; }
.password-strength-bar.medium { width: 66%;  background: #FBBF24; }
.password-strength-bar.strong { width: 100%; background: #4ADE80; }