/* ============================================================
   Nana — Design Tokens (compartidos entre las 4 apps)
   Cada app sobreescribe acentos + tipografía principal.
   ============================================================ */

:root {
  /* Neutrals */
  --neutral-0: #ffffff;
  --neutral-50: #fafaf9;
  --neutral-100: #f5f5f4;
  --neutral-200: #e7e5e4;
  --neutral-300: #d6d3d1;
  --neutral-400: #a8a29e;
  --neutral-500: #78716c;
  --neutral-600: #57534e;
  --neutral-700: #44403c;
  --neutral-800: #292524;
  --neutral-900: #1c1917;

  /* Brand acento Nana (paleta principal de la marca, usada en landing) */
  --nana-coral: #e85d75;
  --nana-coral-soft: #f8b4c0;
  --nana-coral-dark: #c44560;
  --nana-cream: #fdf6f0;
  --nana-warm: #fef3e9;

  /* Semantic */
  --success: #16a34a;
  --warning: #f59e0b;
  --error: #dc2626;
  --info: #2563eb;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 28px 64px rgba(0, 0, 0, 0.18);

  /* Transitions */
  --t-fast: 120ms ease;
  --t-base: 200ms ease;
  --t-slow: 320ms ease;

  /* Layout */
  --container-max: 1280px;
  --header-h: 64px;
  --sidebar-w: 240px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-sans); color: var(--neutral-900); background: var(--neutral-50); -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Common utility classes */
.muted { color: var(--neutral-500); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.col { display: flex; flex-direction: column; gap: var(--s-3); }
.spacer { flex: 1; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600;
  background: var(--neutral-100); color: var(--neutral-700);
  border: 1px solid var(--neutral-200);
}
.badge.success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.badge.warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge.error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.badge.info { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.badge.coral { background: var(--nana-coral-soft); color: var(--nana-coral-dark); border-color: var(--nana-coral-soft); }

/* Toasts */
.toast-host {
  position: fixed; right: var(--s-5); bottom: var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-3);
  z-index: 9999; pointer-events: none;
}
.toast {
  background: var(--neutral-900); color: var(--neutral-0);
  padding: 12px 18px; border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: 14px; max-width: 360px;
  animation: toast-in 200ms ease-out;
  pointer-events: auto;
}
.toast.success { background: var(--success); }
.toast.warning { background: var(--warning); color: #1a1a1a; }
.toast.error { background: var(--error); }
.toast.coral { background: var(--nana-coral); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Modal base */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(28, 25, 23, 0.55);
  display: none; align-items: center; justify-content: center;
  padding: var(--s-5); z-index: 100;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: var(--neutral-0);
  border-radius: var(--r-xl);
  padding: var(--s-6);
  max-width: 520px; width: 100%;
  box-shadow: var(--shadow-xl);
  animation: modal-in 220ms ease-out;
}
@keyframes modal-in { from { transform: translateY(12px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* Buttons base — apps lo extienden con su acento */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--r-md);
  font-weight: 600; font-size: 14px;
  transition: var(--t-base);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary { background: var(--neutral-900); color: var(--neutral-0); }
.btn-primary:hover { background: var(--neutral-700); }
.btn-secondary { background: var(--neutral-0); color: var(--neutral-900); border-color: var(--neutral-300); }
.btn-secondary:hover { background: var(--neutral-100); }
.btn-ghost { background: transparent; color: var(--neutral-700); }
.btn-ghost:hover { background: var(--neutral-100); }
.btn-danger { background: var(--error); color: var(--neutral-0); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Forms */
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 13px; font-weight: 600; color: var(--neutral-700); }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--r-md);
  background: var(--neutral-0);
  font-size: 14px;
  transition: var(--t-fast);
}
.input:focus { outline: 2px solid var(--nana-coral-soft); border-color: var(--nana-coral); }
textarea.input { resize: vertical; min-height: 80px; }

/* Avatars */
.avatar {
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  background: var(--neutral-200);
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-lg { width: 88px; height: 88px; }
.avatar-xl { width: 140px; height: 140px; }

/* Scrollbars discretos */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--neutral-300); border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }
