@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');
/* ═══════════════════════════════════════════════════════════════════════════
   Nürae — Panel administrativo · estética minimalista skincare
   Tonos neutros, nude/espresso, tipografía sans-serif premium
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Fondos */
  --bg-base: #faf8f6;          /* Marfil muy claro de fondo global */
  --bg-card: #ffffff;          /* Cards blancos */
  --bg-soft: #f6f2ee;          /* Hover muy sutil cálido */
  --bg-elev-1: #ffffff;
  --bg-elev-2: #ffffff;
  --bg-elev-3: #f3eee9;

  /* Bordes */
  --border-soft: #ece6df;
  --border-strong: #ddd3c9;

  /* Texto */
  --text-primary: #2b2522;     /* Casi negro cálido */
  --text-secondary: #6b5f57;   /* Marrón gris medio */
  --text-muted: #a99e94;       /* Topo suave */

  /* Acentos — marca Nürae (espresso + nude) */
  --accent-green: #8a6f5e;     /* Color de marca principal (botones, activos) */
  --accent-green-dark: #5f4b3e;
  --accent-green-soft: #f3ebe4;
  --brand: #2b2522;            /* Casi negro cálido para wordmark */
  --accent-blue: #9c8472;      /* Nude secundario */
  --accent-blue-soft: #f0e8e1;
  --accent-purple: #a78bfa;
  --accent-purple-soft: #ede9fe;
  --accent-red: #f87171;
  --accent-red-soft: #fee2e2;
  --accent-yellow: #fbbf24;
  --accent-yellow-soft: #fef3c7;
  --accent-orange: #fb923c;
  --accent-orange-soft: #ffedd5;
  --accent-pink: #f9a8d4;
  --accent-pink-soft: #fce7f3;
  --accent-cyan: #67e8f9;
  --accent-cyan-soft: #cffafe;

  /* Sombras suaves */
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 4px 12px rgba(17, 24, 39, 0.06);
  --shadow-lg: 0 10px 25px rgba(17, 24, 39, 0.08);
  --shadow-inset: inset 0 0 0 1px rgba(17, 24, 39, 0.04);

  /* Radios */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
}

* { -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg-base);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

h1, h2, h3, .brand-font { font-family: 'Jost', 'Inter', sans-serif; letter-spacing: 0.01em; }

body {
  background-image:
    radial-gradient(at 100% 0%, rgba(156, 132, 114, 0.04) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(138, 111, 94, 0.04) 0px, transparent 50%);
}

/* ─── Scrollbar refinada ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d7dd; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ─── Cards y superficies ─────────────────────────────────────────────────── */
.surface {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.surface-elev {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* ─── Botones modernos ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.18s ease;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent-green);
  color: white;
  box-shadow: 0 2px 8px rgba(138,111,94,0.25);
}
.btn-primary:hover { background: var(--accent-green-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(138,111,94,0.35); }
.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-soft); border-color: #b9bdc7; }
.btn-danger { background: var(--accent-red); color: white; }
.btn-danger:hover { background: #ef4444; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text-primary); }

/* ─── Burbujas de chat estilo pastel ──────────────────────────────────────── */
.bubble-client {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-soft);
  border-radius: 1.1rem 1.1rem 1.1rem 0.3rem;
  max-width: 78%;
  word-break: break-word;
  padding: 0.65rem 0.9rem;
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
  line-height: 1.45;
}
.bubble-bot {
  background: var(--accent-green-soft);
  color: #5f4b3e;
  border-radius: 1.1rem 1.1rem 0.3rem 1.1rem;
  max-width: 78%;
  word-break: break-word;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.45;
}
.bubble-manual {
  background: var(--accent-blue-soft);
  color: #3730a3;
  border-radius: 1.1rem 1.1rem 0.3rem 1.1rem;
  max-width: 78%;
  word-break: break-word;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.45;
}
.msg-time { font-size: 0.65rem; opacity: 0.6; margin-top: 0.2rem; }

/* ─── Animaciones ─────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.22s ease-out; }

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.pulse { animation: pulse-soft 1.8s ease-in-out infinite; }

/* ─── Badge / pills pastel ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  white-space: nowrap;
}
.badge-success { background: var(--accent-green-soft); color: #065f46; }
.badge-danger { background: var(--accent-red-soft); color: #991b1b; }
.badge-warning { background: var(--accent-yellow-soft); color: #92400e; }
.badge-info { background: var(--accent-blue-soft); color: #3730a3; }
.badge-purple { background: var(--accent-purple-soft); color: #5b21b6; }
.badge-pink { background: var(--accent-pink-soft); color: #9d174d; }
.badge-muted { background: #f3f4f6; color: #6b7280; }

/* ─── Unread badge ────────────────────────────────────────────────────────── */
.unread-badge {
  min-width: 22px; height: 22px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-green);
  color: white;
  padding: 0 6px;
  box-shadow: 0 2px 4px rgba(138,111,94,0.3);
}

/* ─── Contact item ────────────────────────────────────────────────────────── */
.contact-item {
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background 0.15s;
}
.contact-item:hover { background: var(--bg-soft); }
.contact-item.active {
  background: var(--accent-green-soft);
  border-left-color: var(--accent-green);
}
.contact-item.active .contact-name { color: var(--accent-green-dark); }

/* ─── Toggle switch ───────────────────────────────────────────────────────── */
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  inset: 0;
  background: #d1d5db;
  border-radius: 26px;
  transition: 0.25s;
}
.toggle-slider:before {
  position: absolute; content: "";
  height: 20px; width: 20px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%;
  transition: 0.25s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
input:checked + .toggle-slider { background: var(--accent-green); }
input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ─── Bottom nav móvil ────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0 calc(env(safe-area-inset-bottom, 0px) + 0.5rem);
  z-index: 40;
  box-shadow: 0 -2px 12px rgba(17,24,39,0.04);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.4rem;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}
.bottom-nav a.active { color: var(--accent-green); }
.bottom-nav a:hover { color: var(--text-primary); }
.bottom-nav .nav-icon { font-size: 1.35rem; line-height: 1; }

/* ─── App bar móvil ───────────────────────────────────────────────────────── */
.app-bar {
  position: sticky; top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
  padding: 0.75rem 1rem;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 56px;
}
.app-bar h1 { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }

/* ─── Stat cards pastel estilo HRMS ───────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat-card.pastel-purple { background: var(--accent-purple-soft); border-color: transparent; }
.stat-card.pastel-green { background: var(--accent-green-soft); border-color: transparent; }
.stat-card.pastel-yellow { background: var(--accent-yellow-soft); border-color: transparent; }
.stat-card.pastel-orange { background: var(--accent-orange-soft); border-color: transparent; }
.stat-card.pastel-pink { background: var(--accent-pink-soft); border-color: transparent; }
.stat-card.pastel-blue { background: var(--accent-blue-soft); border-color: transparent; }
.stat-card.pastel-red { background: var(--accent-red-soft); border-color: transparent; }
.stat-card .stat-label { color: var(--text-secondary); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1.1; margin-top: 0.5rem; color: var(--text-primary); }
.stat-card .stat-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: rgba(255,255,255,0.6);
}

/* ─── Input ───────────────────────────────────────────────────────────────── */
.input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  transition: all 0.15s;
}
.input:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(138,111,94,0.14);
}
.input::placeholder { color: var(--text-muted); }
select.input { cursor: pointer; }

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}
.sidebar a:hover { background: var(--bg-soft); color: var(--text-primary); }
.sidebar a.active {
  background: var(--accent-green-soft);
  color: var(--accent-green-dark);
  font-weight: 600;
}
.sidebar .nav-icon { font-size: 1.2rem; }

/* ─── Tabs ────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0.25rem;
  background: #f3f4f6;
  padding: 0.25rem;
  border-radius: var(--radius-md);
}
.tabs button, .tab-btn, .filter-btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius-md) - 0.25rem);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.tabs button:hover, .tab-btn:hover, .filter-btn:hover { color: var(--text-primary); }
.tabs button.active, .tab-btn.active, .filter-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ─── Avatar ──────────────────────────────────────────────────────────────── */
.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  flex-shrink: 0;
  background: linear-gradient(135deg, #b89a86 0%, #8a6f5e 100%);
}
.avatar-sm { width: 34px; height: 34px; font-size: 0.85rem; }

/* ─── Mobile adjustments ──────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .desktop-only { display: none !important; }
  .mobile-pad-bottom { padding-bottom: 5.5rem; }
}
@media (min-width: 768px) {
  .mobile-only { display: none !important; }
  .bottom-nav { display: none; }
}

/* ─── Slide panels mobile ─────────────────────────────────────────────────── */
.slide-panel {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.slide-panel.open { transform: translateX(0); }
