/* ============================================================
   SHE BY SHERLEY — App Platform CSS v2
   Marca + energía de app moderna + accesible para 40-65 años
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,700;1,400;1,500&family=Nunito:wght@300;400;500;600;700;800&display=swap');

:root {
  /* ── Paleta de marca ── */
  --rose:        #EAD6DC;
  --rose-mid:    #D4A8B4;
  --rose-deep:   #B8828F;
  --brown:       #4A2E2B;
  --brown-mid:   #7A5C59;
  --brown-light: #A08480;
  --ivory:       #F8F6F4;
  --ivory-dark:  #EEE9E5;
  --sage:        #A3B18A;
  --sage-light:  #C8D9B0;
  --sage-dark:   #7A9060;

  /* ── UI ── */
  --bg:          #F5F0ED;
  --white:       #FFFFFF;
  --text:        #2D1A17;
  --text-mid:    #6B5250;
  --text-muted:  #A08480;
  --border:      rgba(74,46,43,0.10);
  --border-mid:  rgba(74,46,43,0.18);

  /* ── Feedback ── */
  --success:     #5B8C5A;
  --success-bg:  #EAF4E9;
  --error:       #B5372A;
  --error-bg:    #FCECEA;
  --warning:     #C07A30;
  --warning-bg:  #FDF2E4;
  --lesson-blue: #DCE8F6;
  --lesson-blue-deep: #7290B2;
  --lesson-lilac: #EEE6F6;
  --lesson-gold: #F4E7C8;

  /* ── Sombras ── */
  --shadow-xs:   0 1px 3px rgba(74,46,43,0.06);
  --shadow-sm:   0 2px 8px rgba(74,46,43,0.08), 0 1px 3px rgba(74,46,43,0.04);
  --shadow-md:   0 8px 24px rgba(74,46,43,0.10), 0 2px 8px rgba(74,46,43,0.06);
  --shadow-lg:   0 20px 60px rgba(74,46,43,0.14), 0 4px 16px rgba(74,46,43,0.08);
  --shadow-glow: 0 0 0 3px rgba(234,214,220,0.5);
  --shadow-soft: 0 14px 36px rgba(74,46,43,0.08);

  /* ── Layout ── */
  --sidebar-w:   248px;
  --topbar-h:    56px;
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-xl:   24px;
  --radius-full: 999px;

  /* ── Transiciones ── */
  --ease:        cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in:     cubic-bezier(0.4, 0, 1, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --t-fast:      0.15s;
  --t-mid:       0.25s;
  --t-slow:      0.4s;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* ── Lucide icons: reset universal ── */
i[data-lucide], i[data-lucide] svg,
.lucide, svg.lucide {
  display: inline-flex !important;
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 1.75 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  vertical-align: middle;
  flex-shrink: 0;
}
/* Tamaños específicos */
.icon-sm, .icon-sm svg.lucide  { width: 14px !important; height: 14px !important; }
.icon-md, .icon-md svg.lucide  { width: 18px !important; height: 18px !important; }
.icon-lg, .icon-lg svg.lucide  { width: 22px !important; height: 22px !important; }
.icon-xl, .icon-xl svg.lucide  { width: 28px !important; height: 28px !important; }
/* Sidebar nav — íconos un poco más visibles */
.nav-icon i[data-lucide], .nav-icon svg.lucide { width: 18px !important; height: 18px !important; }
/* Topbar */
.topbar-btn i[data-lucide], .topbar-btn svg.lucide { width: 18px !important; height: 18px !important; }
/* Botones */
.btn i[data-lucide], .btn svg.lucide { width: 15px !important; height: 15px !important; }
.btn-sm i[data-lucide], .btn-sm svg.lucide { width: 13px !important; height: 13px !important; }
/* Logout */
.logout-btn i[data-lucide], .logout-btn svg.lucide { width: 16px !important; height: 16px !important; }

body {
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ── TIPOGRAFÍA ── */
h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 em, h2 em, h3 em, h4 em, h5 em {
  font-style: italic;
  font-weight: 400;
}
.label-sm {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════
   LAYOUT PRINCIPAL (sidebar + main)
   ══════════════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transition: transform var(--t-slow) var(--ease-out);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.sidebar-logo img { height: 28px; width: auto; }

/* Badge del plan activo */
.sidebar-plan {
  margin: 14px 12px 8px;
  background: var(--rose);
  border: 1px solid var(--rose-mid);
  border-radius: var(--radius-md);
  padding: 14px 15px 18px;
  position: relative;
  overflow: visible;
}
.sidebar-plan::before {
  content: none;
}
.sidebar-plan .plan-tag {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brown-light);
  display: block;
  margin-bottom: 3px;
}
.sidebar-plan .plan-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brown);
  display: block;
}
.sidebar-plan .plan-progress-wrap {
  margin-top: 10px;
  background: rgba(74,46,43,0.12);
  border-radius: var(--radius-full);
  height: 4px;
  overflow: hidden;
}
.sidebar-plan .plan-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose-deep), var(--brown-mid));
  border-radius: var(--radius-full);
  transition: width 1s var(--ease-out);
}
.sidebar-plan .plan-progress-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: block;
  line-height: 1.45;
  padding-bottom: 1px;
}

.sidebar-plan-empty {
  background: var(--white);
  border-color: rgba(74,46,43,0.1);
}

.sidebar-plan-empty::before {
  content: none;
}

.plan-mini-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(74,46,43,0.1);
  color: var(--brown);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}

.plan-mini-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

/* Navegación */
.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0 16px;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.sidebar-nav-section {
  padding: 14px 20px 6px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 1px 6px;
  border-radius: var(--radius-md);
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-mid);
  text-decoration: none;
  transition: all var(--t-fast) var(--ease-out);
}
.sidebar-nav a:hover {
  color: var(--brown);
  background: var(--bg);
}
.sidebar-nav a.active {
  color: var(--brown);
  background: var(--rose);
  font-weight: 700;
}
.sidebar-nav a.active .nav-icon {
  color: var(--rose-deep);
}
.sidebar-nav .nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
}
/* Lucide icons via i tag */
.sidebar-nav a:hover .nav-icon,
.sidebar-nav a.active .nav-icon { color: var(--brown); }
.sidebar-nav .nav-badge {
  margin-left: auto;
  background: var(--rose-deep);
  color: white;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 16px;
}

/* Usuario en el fondo del sidebar */
.sidebar-user {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  transition: background var(--t-fast);
  margin: 6px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.sidebar-user:hover { background: var(--bg); }
.sidebar-user .user-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--rose-deep);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem; font-weight: 500;
  color: white;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.sidebar-user .user-avatar img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.sidebar-user .user-name {
  font-size: 0.84rem; font-weight: 700;
  color: var(--text);
  display: block;
}
.sidebar-user .user-plan {
  font-size: 0.67rem;
  color: var(--text-muted);
}
.sidebar-user .logout-btn {
  margin-left: auto;
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all var(--t-fast);
  text-decoration: none;
}
.sidebar-user .logout-btn:hover {
  background: var(--error-bg);
  color: var(--error);
}

.sidebar-utilities {
  margin: 10px 12px 4px;
  display: grid;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-utility-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--brown);
  font-size: 0.78rem;
  font-weight: 700;
}

.sidebar-utility-btn:hover {
  border-color: rgba(184,130,143,0.28);
  background: var(--rose);
}

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

body.sidebar-hidden .sidebar {
  transform: translateX(-100%);
  width: 0;
  border-right: none;
}

body.sidebar-hidden .main-content {
  margin-left: 0;
}

body.sidebar-mobile-open {
  overflow: hidden;
}

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 80;
  gap: 16px;
}
.topbar-breadcrumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 2px;
}
.topbar-breadcrumb .crumb {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-breadcrumb .crumb-current {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-breadcrumb .crumb-sep {
  color: var(--border-mid);
}
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--brown-mid);
  transition: all var(--t-fast);
  position: relative;
}
.topbar-btn:hover { background: var(--rose); color: var(--brown); border-color: var(--rose-mid); }
.topbar-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.topbar-notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 8px; height: 8px;
  background: var(--rose-deep);
  border-radius: 50%;
  border: 2px solid var(--ivory);
}
.mobile-menu-btn {
  display: flex;
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1px solid var(--border);
  align-items: center; justify-content: center;
  color: var(--brown);
}
.mobile-menu-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* Dropdown notificaciones */
.notif-panel {
  position: absolute;
  top: calc(var(--topbar-h) + 4px);
  right: 36px;
  width: 340px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
  display: none;
  animation: slideDown var(--t-mid) var(--ease) both;
}
.notif-panel.open { display: block; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.notif-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notif-header h3 { font-family: 'Nunito', sans-serif; font-size: 0.88rem; font-weight: 700; }
.notif-mark-all { font-size: 0.72rem; color: var(--brown-mid); cursor: pointer; font-weight: 600; }
.notif-mark-all:hover { color: var(--brown); }
.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background var(--t-fast);
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: rgba(234,214,220,0.2); }
.notif-item:last-child { border-bottom: none; }
.notif-item .notif-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--rose);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.notif-item .notif-icon svg { width: 16px; height: 16px; stroke: var(--brown); fill: none; stroke-width: 2; stroke-linecap: round; }
.notif-item .notif-body { flex: 1; min-width: 0; }
.notif-item .notif-msg { font-size: 0.82rem; font-weight: 500; line-height: 1.4; }
.notif-item .notif-date { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }
.notif-empty { padding: 32px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* ── PAGE CONTENT ── */
.page-content {
  padding: 24px 32px;
  flex: 1;
  max-width: 1140px;
  width: 100%;
  margin-inline: auto;
  min-width: 0;
}
.page-content > * { min-width: 0; }
.page-header {
  padding: 4px 0 20px;
  margin-bottom: 20px;
}
.page-header::after,
.page-header::before {
  content: none;
}
.page-header .label-sm { margin-bottom: 4px; display: block; }
.page-header h1 { font-size: 1.65rem; color: var(--text); margin-bottom: 4px; }
.page-header .subtitle { font-size: 0.87rem; color: var(--text-mid); font-weight: 500; max-width: 620px; }

/* ══════════════════════════════════════════════
   COMPONENTES UI
   ══════════════════════════════════════════════ */

/* ── BOTONES ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--t-fast) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--brown);
  color: var(--ivory);
  border-color: var(--brown);
}
.btn-primary:hover {
  background: #3a2220;
  border-color: #3a2220;
  box-shadow: 0 4px 14px rgba(74,46,43,0.3);
  transform: translateY(-1px);
}
.btn-rose {
  background: var(--rose);
  color: var(--brown);
  border-color: transparent;
}
.btn-rose:hover { background: var(--rose-mid); color: var(--brown); transform: translateY(-1px); }
.btn-sage {
  background: var(--sage);
  color: var(--white);
  border-color: transparent;
}
.btn-sage:hover { background: var(--sage-dark); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--brown-mid);
  border-color: var(--border-mid);
}
.btn-ghost:hover { background: var(--white); color: var(--brown); border-color: var(--brown-mid); }
.btn-white {
  background: var(--white);
  color: var(--brown);
  border-color: var(--border-mid);
  box-shadow: var(--shadow-sm);
}
.btn-white:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-danger { background: var(--error); color: white; border-color: var(--error); }

.btn-sm { padding: 8px 16px; font-size: 0.78rem; border-radius: var(--radius-md); }
.btn-lg { padding: 11px 28px; font-size: 0.9rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }
.btn-icon { padding: 10px; border-radius: var(--radius-md); }
.btn-icon-sm { padding: 7px; border-radius: var(--radius-sm); }

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 24px;
  box-shadow: var(--shadow-soft);
}
.card-sm { padding: 20px 24px; border-radius: var(--radius-md); }
.card-hover {
  transition: all var(--t-mid) var(--ease-out);
  cursor: pointer;
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--rose-mid);
}

/* ── STAT CARDS ── */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--t-mid) var(--ease-out);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .stat-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card .stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.stat-card .stat-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.stat-card .stat-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); display: block; margin-bottom: 6px; }
.stat-card .stat-value { font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-card .stat-unit { font-size: 0.82rem; font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.stat-card .stat-delta { font-size: 0.75rem; font-weight: 600; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-card .stat-delta.pos { color: var(--success); }
.stat-card .stat-delta.neg { color: var(--error); }

/* ── PROGRESS BAR ── */
.progress-wrap {
  background: var(--ivory-dark);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--rose-mid), var(--rose-deep));
  transition: width 1s var(--ease-out);
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; right: -1px; bottom: 0;
  width: 6px;
  background: rgba(255,255,255,0.5);
  border-radius: var(--radius-full);
  animation: shimmer 2s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}
.progress-fill.green { background: linear-gradient(90deg, var(--sage), var(--sage-dark)); }
.progress-fill.full { background: linear-gradient(90deg, var(--sage), var(--success)); }

/* ── ALERTAS ── */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 20px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(91,140,90,0.2); }
.alert-error   { background: var(--error-bg);   color: var(--error);   border: 1px solid rgba(181,55,42,0.2); }
.alert-info    { background: var(--rose);        color: var(--brown);   border: 1px solid var(--rose-mid); }
.alert-warning { background: var(--warning-bg);  color: var(--warning); border: 1px solid rgba(192,122,48,0.2); }

/* ── FORMULARIOS ── */
.form-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.form-group .label-hint { font-weight: 400; color: var(--text-muted); font-size: 0.75rem; }
.form-group .label-link { color: var(--brown-mid); font-size: 0.75rem; font-weight: 600; }
.form-group .label-link:hover { color: var(--brown); }

input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=url],
textarea, select {
  width: 100%;
  background: var(--ivory);
  border: 1.5px solid var(--border-mid);
  padding: 13px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--rose-deep);
  background: var(--white);
  box-shadow: var(--shadow-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); font-weight: 400; }
textarea { resize: vertical; min-height: 100px; }
select { appearance: none; cursor: pointer; }

.input-wrap { position: relative; }
.input-wrap input { padding-right: 46px; }
.input-action {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color var(--t-fast);
  display: flex; align-items: center; justify-content: center;
}
.input-action:hover { color: var(--brown); }
.input-action svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ── BADGE ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.badge-rose   { background: var(--rose); color: var(--brown); }
.badge-sage   { background: var(--sage-light); color: var(--sage-dark); }
.badge-brown  { background: var(--brown); color: var(--ivory); }
.badge-green  { background: var(--success-bg); color: var(--success); }
.badge-orange { background: var(--warning-bg); color: var(--warning); }
.badge-muted  { background: var(--ivory-dark); color: var(--text-muted); }

/* ── AVATAR ── */
.avatar {
  border-radius: var(--radius-full);
  background: var(--rose-deep);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  color: var(--white);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.avatar-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-sm  { width: 32px; height: 32px; font-size: 0.82rem; }
.avatar-md  { width: 44px; height: 44px; font-size: 1rem; }
.avatar-lg  { width: 64px; height: 64px; font-size: 1.3rem; }
.avatar-xl  { width: 88px; height: 88px; font-size: 1.8rem; }

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brown-mid);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.learning-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.learning-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
}

.learning-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.learning-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

.learning-card-title em {
  font-style: normal;
  font-weight: 500;
}

.learning-card-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.micro-policy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-full);
  background: rgba(248,246,244,0.92);
  border: 1px solid rgba(74,46,43,0.08);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
}

.micro-policy i[data-lucide] {
  width: 14px !important;
  height: 14px !important;
}

.community-soft-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brown-light);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.65;
}

.community-soft-note i[data-lucide] {
  width: 18px !important;
  height: 18px !important;
  color: var(--rose-deep);
  stroke-width: 1.8 !important;
}

.support-card {
  padding: 30px;
  display: grid;
  gap: 18px;
}

.support-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 24px;
  align-items: start;
}

.support-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.support-helper-list {
  display: grid;
  gap: 12px;
}

.support-helper-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-mid);
  font-size: 0.84rem;
  line-height: 1.75;
}

.support-helper-item i[data-lucide] {
  width: 16px !important;
  height: 16px !important;
  margin-top: 2px;
}

.composer-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.composer-form-wrap {
  display: none;
  padding-top: 8px;
}

.composer-form-wrap.is-open {
  display: block;
}

.learning-hero {
  position: relative;
  overflow: hidden;
  padding: 34px 36px 32px;
  border-radius: var(--radius-xl);
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.learning-hero::before { display: none; }

.learning-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 22px;
  align-items: center;
}

.learning-hero-copy h2 {
  font-size: 1.9rem;
  line-height: 1.2;
  margin: 10px 0 10px;
}

.learning-hero-copy p {
  max-width: 640px;
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.75;
}

.learning-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric-chip {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(74,46,43,0.08);
  border-radius: 22px;
  padding: 18px 18px 16px;
}

.metric-chip-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.metric-chip-value {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--brown);
}

.metric-chip-note {
  display: block;
  margin-top: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-mid);
}

.lesson-panel {
  padding: 26px;
  border-radius: 26px;
  background: var(--ivory);
  border: 1px solid rgba(74,46,43,0.09);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.lesson-panel-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  background: var(--rose);
  color: var(--brown);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.lesson-panel h3 {
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 12px 0 8px;
}

.lesson-panel p {
  color: var(--text-mid);
  font-size: 0.86rem;
  line-height: 1.75;
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.lesson-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(74,46,43,0.08);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-mid);
}

.lesson-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
}

.lesson-stack {
  display: grid;
  gap: 16px;
}

.lesson-card {
  padding: 24px 24px 22px;
}

.lesson-card.highlight {
  background: var(--white);
  border-color: var(--rose-mid);
}

.timeline-list {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.76);
  border: 1px solid rgba(74,46,43,0.08);
}

.timeline-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(234,214,220,0.7);
  color: var(--brown);
}

.timeline-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
}

.timeline-copy {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-mid);
  margin-top: 2px;
}

.learning-empty {
  text-align: center;
  padding: 44px 32px;
}

.programa-empty-state {
  max-width: 760px;
  margin: 0 auto;
}

.programa-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  margin: 0 auto 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  background: var(--rose);
  border: 1px solid var(--rose-mid);
  box-shadow: var(--shadow-xs);
}

.programa-empty-icon i[data-lucide],
.programa-empty-icon svg.lucide {
  width: 24px !important;
  height: 24px !important;
}

.learning-empty h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.learning-empty p {
  color: var(--text-mid);
  max-width: 460px;
  margin: 0 auto 22px;
}

.academy-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.academy-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.academy-summary .metric-chip {
  min-height: 118px;
}

.program-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 6px;
}

.program-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(74,46,43,0.1);
  background: rgba(255,255,255,0.9);
  color: var(--text-mid);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 800;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}

.program-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(184,130,143,0.28);
  color: var(--brown);
}

.program-pill.active {
  background: var(--rose);
  border-color: rgba(184,130,143,0.3);
  color: var(--brown);
  box-shadow: var(--shadow-sm);
}

.academy-path {
  display: grid;
  gap: 16px;
  margin-top: 6px;
}

.academy-module {
  border-radius: 28px;
  border: 1px solid rgba(74,46,43,0.1);
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

.academy-module.open {
  border-color: rgba(184,130,143,0.28);
  box-shadow: 0 22px 46px rgba(108,76,72,0.1);
}

.academy-module-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 22px;
  cursor: pointer;
  transition: background-color var(--t-fast), transform var(--t-fast), padding var(--t-fast);
  user-select: none;
}

.academy-module.open .academy-module-head {
  background: var(--rose);
}

.academy-module-head:hover {
  background: rgba(247, 240, 236, 0.86);
}

.academy-module-head:active {
  transform: translateY(1px);
}

.academy-module-head:focus-visible {
  outline: 2px solid rgba(184,130,143,0.35);
  outline-offset: -2px;
}

.academy-module-num {
  width: 46px;
  height: 46px;
  border-radius: 18px;
  background: var(--brown);
  color: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  transition: transform var(--t-fast), border-radius var(--t-fast), background-color var(--t-fast);
}

.academy-module-title {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text);
}

.academy-module-copy {
  font-size: 0.82rem;
  color: var(--text-mid);
  margin-top: 4px;
  line-height: 1.6;
}

.academy-module-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.academy-module-chevron {
  transition: transform var(--t-fast), color var(--t-fast);
}

.academy-module.open .academy-module-chevron {
  transform: rotate(180deg);
  color: var(--brown);
}

.academy-module.open .academy-module-num {
  transform: translateY(-1px);
  border-radius: 16px;
}

.academy-module-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-full);
  padding: 8px 12px;
  background: rgba(245,240,237,0.95);
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-mid);
}

.academy-module-progress {
  color: var(--success);
  background: rgba(91,140,90,0.12);
}

.academy-lessons {
  border-top: 1px solid rgba(74,46,43,0.08);
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  padding: 0 14px;
  transition: grid-template-rows 240ms ease, opacity 180ms ease, padding 240ms ease;
}

.academy-module.open .academy-lessons {
  grid-template-rows: 1fr;
  opacity: 1;
  padding: 14px;
}

.academy-lessons-inner {
  min-height: 0;
  overflow: hidden;
  display: grid;
  gap: 10px;
}

.academy-lesson {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(74,46,43,0.08);
  text-decoration: none;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}

.academy-lesson:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(184,130,143,0.34);
  background: rgba(255,255,255,0.98);
}

.academy-lesson:active {
  transform: translateY(0);
}

.academy-lesson-status {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(238,233,229,0.9);
  color: var(--text-muted);
}

.academy-lesson-status.done {
  background: #f5e7ec;
  color: #9a5d66;
}

.academy-lesson-status.progress {
  background: rgba(192,122,48,0.12);
  color: var(--warning);
}

.academy-lesson-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
}

.academy-lesson-copy {
  font-size: 0.76rem;
  color: var(--text-mid);
  margin-top: 3px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.academy-lesson-tail {
  display: flex;
  align-items: center;
  gap: 10px;
}

.academy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  background: rgba(220,232,246,0.6);
  color: var(--lesson-blue-deep);
  font-size: 0.72rem;
  font-weight: 800;
}

/* Dashboard compacto */
body.dashboard-page .page-content {
  max-width: 1240px;
  padding-left: 38px;
  padding-right: 38px;
}

body.dashboard-page .learning-shell {
  gap: 14px;
}

body.dashboard-page .learning-hero {
  padding: 28px 30px 26px;
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
}

body.dashboard-page .learning-hero::before {
  inset: auto -30px -58px auto;
  width: 210px;
  height: 210px;
}

body.dashboard-page .learning-hero-grid {
  grid-template-columns: minmax(0, 1.24fr) minmax(310px, 0.76fr);
  gap: 18px;
  align-items: center;
}

body.dashboard-page .learning-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.dashboard-page .section-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

body.dashboard-page .learning-hero-copy h2 {
  font-size: 1.72rem;
  line-height: 1.17;
  margin: 8px 0 10px;
  max-width: 760px;
}

body.dashboard-page .learning-hero-copy p {
  font-size: 0.86rem;
  line-height: 1.72;
  max-width: 720px;
}

body.dashboard-page .learning-actions {
  gap: 10px;
  margin-top: 16px;
}

body.dashboard-page .learning-actions .btn-lg {
  padding: 10px 20px;
  font-size: 0.82rem;
}

body.dashboard-page .lesson-panel {
  padding: 18px 18px 16px;
  border-radius: 22px;
}

body.dashboard-page .lesson-panel-badge {
  padding: 6px 11px;
  font-size: 0.66rem;
}

body.dashboard-page .lesson-panel h3 {
  font-size: 0.98rem;
  line-height: 1.28;
  margin: 10px 0 6px;
}

body.dashboard-page .lesson-panel p {
  font-size: 0.8rem;
  line-height: 1.68;
}

body.dashboard-page .lesson-meta {
  gap: 8px;
  margin-top: 14px;
}

body.dashboard-page .lesson-meta span {
  padding: 7px 10px;
  font-size: 0.7rem;
}

body.dashboard-page .metric-strip {
  gap: 12px;
}

body.dashboard-page .metric-chip {
  border-radius: 18px;
  padding: 14px 14px 13px;
}

body.dashboard-page .metric-chip-label {
  font-size: 0.62rem;
  margin-bottom: 6px;
}

body.dashboard-page .metric-chip-value {
  font-size: 1.58rem;
}

body.dashboard-page .metric-chip-note {
  margin-top: 5px;
  font-size: 0.72rem;
  font-weight: 600;
}

body.dashboard-page .lesson-grid {
  gap: 16px;
}

body.dashboard-page .lesson-stack {
  gap: 14px;
}

body.dashboard-page .lesson-card {
  padding: 18px 20px 17px;
}

body.dashboard-page .learning-card-head {
  gap: 10px;
  margin-bottom: 12px;
}

body.dashboard-page .learning-card-title {
  font-size: 0.94rem;
}

body.dashboard-page .learning-card-subtitle {
  font-size: 0.78rem;
}

body.dashboard-page .academy-pill {
  padding: 7px 10px;
  font-size: 0.68rem;
}

body.dashboard-page .timeline-list {
  gap: 10px;
}

body.dashboard-page .timeline-item {
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
}

body.dashboard-page .timeline-dot {
  width: 32px;
  height: 32px;
}

body.dashboard-page .timeline-title {
  font-size: 0.82rem;
}

body.dashboard-page .timeline-copy {
  font-size: 0.74rem;
}

.planner-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
}

.progress-shell {
  display: grid;
  gap: 22px;
}

.profile-layout,
.recipe-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.profile-layout.profile-layout-single {
  grid-template-columns: 1fr;
  max-width: 960px;
}

.recipe-categories {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.recipe-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}

.recipe-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 18px;
}

.profile-summary {
  padding: 26px;
  background: var(--white);
}

.rich-editor {
  border: 1.5px solid var(--border-mid);
  border-radius: 18px;
  overflow: hidden;
  background: var(--white);
}

.rich-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--ivory);
}

.rich-toolbar button {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(74,46,43,0.08);
  background: var(--white);
  color: var(--brown);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rich-toolbar button:hover {
  background: var(--rose);
  border-color: rgba(184,130,143,0.35);
}

.rich-surface {
  min-height: 150px;
  padding: 16px;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.75;
  outline: none;
}

.rich-surface:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
}

.rich-surface p { margin: 0 0 10px; }
.rich-surface ul,
.rich-surface ol { padding-left: 22px; margin: 10px 0; }

.upload-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1.5px dashed rgba(184,130,143,0.45);
  background: rgba(234,214,220,0.22);
  color: var(--brown);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.avatar-photo-picker {
  display: inline-flex;
  cursor: pointer;
}

.avatar-photo-frame {
  width: 112px;
  height: 112px;
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(180deg, rgba(234,214,220,0.48), rgba(248,246,244,0.96));
  border: 1px solid rgba(184,130,143,0.28);
  box-shadow: var(--shadow-sm);
}

.avatar-photo-media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--brown);
  background: rgba(234,214,220,0.32);
}

.avatar-photo-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-photo-overlay {
  position: absolute;
  inset: auto 10px 10px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(74,46,43,0.82);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  transform: translateY(6px);
  opacity: 0;
  transition: opacity var(--t-fast), transform var(--t-fast), background-color var(--t-fast);
}

.avatar-photo-picker:hover .avatar-photo-overlay,
.avatar-photo-picker:focus-within .avatar-photo-overlay {
  opacity: 1;
  transform: translateY(0);
}

.avatar-photo-picker:hover .avatar-photo-frame,
.avatar-photo-picker:focus-within .avatar-photo-frame {
  border-color: rgba(184,130,143,0.48);
  box-shadow: 0 14px 30px rgba(108,76,72,0.16);
}

.profile-section-card {
  display: grid;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid rgba(74,46,43,0.08);
}

.profile-panel-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  margin: 6px 0 18px;
  border-radius: 999px;
  background: rgba(234,214,220,0.22);
  border: 1px solid rgba(184,130,143,0.16);
}

.profile-panel-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}

.profile-panel-btn.active {
  background: var(--white);
  color: var(--brown);
  box-shadow: 0 10px 24px rgba(74,46,43,0.08);
}

.profile-tab-panel {
  display: none;
}

.profile-tab-panel.active {
  display: block;
}

.profile-section-card:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.profile-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-security-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-billing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-billing-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(248,246,244,0.9);
  border: 1px solid rgba(74,46,43,0.08);
  display: grid;
  gap: 6px;
}

.profile-billing-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.profile-billing-item strong {
  font-size: 0.92rem;
  color: var(--text);
}

.profile-billing-note {
  margin-top: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(234,214,220,0.18);
  color: var(--text-mid);
  font-size: 0.82rem;
  line-height: 1.7;
}

.profile-save-bar {
  display: flex;
  justify-content: flex-start;
  margin-top: 18px;
}

@media (max-width: 900px) {
  .profile-security-grid,
  .profile-billing-grid {
    grid-template-columns: 1fr;
  }

  .profile-panel-nav {
    width: 100%;
    flex-wrap: wrap;
    border-radius: 24px;
  }

  .profile-panel-btn {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
  }
}

.upload-pill input {
  display: none;
}

.upload-file-name {
  display: block;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
}

.upload-helper {
  margin-top: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.upload-preview-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(74,46,43,0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,246,244,.94));
  display: none;
  gap: 12px;
}

.upload-preview-card.has-image {
  display: grid;
}

.upload-preview-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.upload-preview-media {
  border-radius: 18px;
  overflow: hidden;
  background: var(--ivory);
  border: 1px solid rgba(74,46,43,0.08);
}

.upload-preview-media img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  display: block;
}

.upload-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.upload-preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(74,46,43,0.12);
  background: var(--white);
  color: var(--brown);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.upload-preview-btn:hover {
  background: var(--rose);
  border-color: rgba(184,130,143,0.3);
}

.image-crop-modal {
  width: min(960px, calc(100vw - 36px));
}

.image-crop-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 280px;
  gap: 18px;
}

.image-crop-stage {
  min-height: 420px;
  border-radius: 22px;
  overflow: hidden;
  background: #221312;
}

.image-crop-stage img {
  max-width: 100%;
  display: block;
}

.image-crop-side {
  display: grid;
  align-content: start;
  gap: 14px;
}

.image-crop-side p {
  font-size: 0.84rem;
  color: var(--text-mid);
  line-height: 1.75;
  margin: 0;
}

.image-crop-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(74,46,43,0.08);
  background: var(--ivory);
}

.image-crop-preview.rect {
  aspect-ratio: 4 / 5;
}

.image-crop-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .image-crop-shell {
    grid-template-columns: 1fr;
  }

  .image-crop-stage {
    min-height: 300px;
  }
}

.composer-image-preview {
  margin-top: 16px;
}

.composer-image-stage {
  position: relative;
  background: var(--brown);
  border: 1px solid rgba(74,46,43,0.18);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), var(--shadow-sm);
}

.composer-image-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(248,246,244,0.14);
  border: 1px solid rgba(248,246,244,0.18);
  color: var(--ivory);
  backdrop-filter: blur(10px);
  transition: transform var(--t-fast), background var(--t-fast);
}

.composer-image-remove:hover {
  transform: scale(1.04);
  background: rgba(248,246,244,0.22);
}

.composer-image-stage img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: calc(var(--radius-lg) - 6px);
  background: rgba(248,246,244,0.06);
}

.plan-card.selected {
  border-color: rgba(184,130,143,0.56);
  box-shadow: 0 0 0 4px rgba(234,214,220,0.7), var(--shadow-lg);
  transform: translateY(-4px);
}

/* ── VIDEO CARDS ── */
.video-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  display: block;
  transition: all var(--t-mid) var(--ease-out);
}
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--rose-mid); }
.video-thumb {
  aspect-ratio: 16/9;
  position: relative;
  background: var(--brown);
  overflow: hidden;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow); opacity: 0.85; }
.video-card:hover .video-thumb img { transform: scale(1.04); opacity: 1; }
.play-btn-wrap {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.play-btn {
  width: 54px; height: 54px;
  background: var(--white);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transition: transform var(--t-fast) var(--ease);
}
.play-btn svg { width: 20px; height: 20px; fill: var(--brown); stroke: none; margin-left: 3px; }
.video-card:hover .play-btn { transform: scale(1.12); }
.video-status {
  position: absolute;
  top: 10px; right: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.video-done { background: var(--success); color: white; }
.video-progress { background: var(--sage); color: white; }
.video-preview { background: var(--rose-mid); color: white; }
.video-info { padding: 16px 18px; }
.video-title { font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 6px; line-height: 1.3; }
.video-meta { font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 10px; font-weight: 600; }
.video-meta svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; flex-shrink: 0; }

/* ── MÓDULOS (accordion) ── */
.modulo-block { margin-bottom: 10px; }
.modulo-header {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all var(--t-fast);
  user-select: none;
}
.modulo-header:hover { border-color: var(--rose-mid); background: var(--ivory); }
.modulo-header.open {
  background: var(--brown);
  border-color: var(--brown);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: none;
}
.modulo-num {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--rose);
  color: var(--brown);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.modulo-header.open .modulo-num { background: rgba(234,214,220,0.2); color: var(--ivory); }
.modulo-title-wrap { flex: 1; }
.modulo-title { font-size: 0.95rem; font-weight: 700; color: var(--text); transition: color var(--t-fast); }
.modulo-header.open .modulo-title { color: var(--ivory); }
.modulo-subtitle { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; font-weight: 500; transition: color var(--t-fast); }
.modulo-header.open .modulo-subtitle { color: rgba(248,246,244,0.5); }
.modulo-chevron {
  width: 24px; height: 24px;
  color: var(--text-muted);
  transition: all var(--t-mid) var(--ease-out);
}
.modulo-chevron svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; }
.modulo-header.open .modulo-chevron { transform: rotate(180deg); color: var(--ivory); }
.modulo-videos {
  display: none;
  border: 1px solid var(--brown);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 14px;
  background: rgba(74,46,43,0.03);
}
.modulo-videos.open {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

/* ══════════════════════════════════════════════
   AUTH PAGES
   ══════════════════════════════════════════════ */

.auth-page {
  min-height: 100vh;
  background: var(--brown);
  display: flex;
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: none;
}
.auth-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 70px;
  position: relative;
  z-index: 1;
}
.auth-left-logo { margin-bottom: 48px; }
.auth-left-logo img { height: 32px; }
.auth-left h1 {
  font-size: 3rem;
  color: var(--ivory);
  margin-bottom: 16px;
  line-height: 1.15;
}
.auth-left h1 em { color: var(--rose-mid); font-style: italic; }
.auth-left p {
  font-size: 1rem;
  color: rgba(248,246,244,0.55);
  max-width: 380px;
  line-height: 1.7;
  font-weight: 400;
}
.auth-features { margin-top: 48px; display: flex; flex-direction: column; gap: 16px; }
.auth-feature {
  display: flex; align-items: center; gap: 14px;
}
.auth-feature .feat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: rgba(234,214,220,0.12);
  border: 1px solid rgba(234,214,220,0.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: rgba(255,255,255,0.85);
}
.auth-feature .feat-icon svg { width: 18px; height: 18px; fill: none; stroke-width: 2; stroke-linecap: round; }
.auth-feature .feat-text { font-size: 0.88rem; color: rgba(248,246,244,0.65); font-weight: 500; }

.auth-right {
  width: 480px;
  background: var(--ivory);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 52px;
  position: relative;
  z-index: 1;
  box-shadow: -40px 0 80px rgba(0,0,0,0.15);
}
.auth-form-title { font-size: 1.9rem; margin-bottom: 6px; }
.auth-form-sub { font-size: 0.9rem; color: var(--text-mid); margin-bottom: 36px; font-weight: 400; }
.auth-form-sub a { color: var(--brown); font-weight: 700; }
.auth-divider { text-align: center; margin: 20px 0; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; position: relative; }
.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%; width: 35%; height: 1px;
  background: var(--border-mid);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-switch { text-align: center; margin-top: 24px; font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.auth-switch a { color: var(--brown); font-weight: 700; }
.auth-terms { font-size: 0.75rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 8px; }
.auth-terms a { color: var(--brown); font-weight: 600; }

/* ══════════════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════════════ */

/* Hero saludo */
.dash-hero {
  background: var(--brown);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.dash-hero::before {
  content: none;
}
.dash-hero::after {
  content: '';
  position: absolute;
  bottom: -40px; right: -20px;
  width: 200px; height: 200px;
  border-radius: 50%;
  border: 40px solid rgba(234,214,220,0.06);
}
.dash-hero-text { position: relative; z-index: 1; }
.dash-hero-text .greeting {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rose-mid);
  display: block;
  margin-bottom: 10px;
}
.dash-hero-text h2 {
  font-size: 1.9rem;
  color: var(--ivory);
  margin-bottom: 10px;
}
.dash-hero-text h2 em { color: var(--rose-mid); font-style: italic; }
.dash-hero-text p { font-size: 0.9rem; color: rgba(248,246,244,0.55); font-weight: 400; max-width: 380px; }
.dash-hero-actions { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.dash-streak {
  background: rgba(234,214,220,0.12);
  border: 1px solid rgba(234,214,220,0.15);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  text-align: center;
}
.dash-streak .streak-num {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--rose-mid);
  display: block;
  line-height: 1;
}
.dash-streak .streak-label { font-size: 0.65rem; font-weight: 700; color: rgba(248,246,244,0.45); letter-spacing: 0.08em; text-transform: uppercase; }

/* Sección "Continuar" */
.continue-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all var(--t-mid) var(--ease-out);
  margin-bottom: 28px;
}
.continue-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--rose-mid); }
.continue-thumb {
  width: 220px;
  flex-shrink: 0;
  position: relative;
  background: var(--brown);
  overflow: hidden;
}
.continue-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.continue-thumb .play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.continue-info { padding: 28px 32px; display: flex; flex-direction: column; justify-content: center; flex: 1; }
.continue-info .continue-tag { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.continue-info h3 { font-size: 1.3rem; margin-bottom: 10px; line-height: 1.3; }
.continue-info p { font-size: 0.85rem; color: var(--text-mid); margin-bottom: 20px; font-weight: 400; }
.continue-info .continue-meta { display: flex; align-items: center; gap: 16px; font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.continue-info .continue-meta svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; }

/* ══════════════════════════════════════════════
   COMUNIDAD (estilo Skool)
   ══════════════════════════════════════════════ */

.community-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}

/* Sidebar derecho de categorías */
.community-sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
}
.category-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.category-card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.category-card-header h3 { font-family: 'Nunito', sans-serif; font-size: 0.85rem; font-weight: 800; }
.category-list { padding: 8px; }
.category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  color: inherit;
}
.category-item:hover, .category-item.active { background: var(--rose); }
.category-item .cat-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.category-item .cat-name { font-size: 0.85rem; font-weight: 600; flex: 1; }
.category-item .cat-count { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }

/* Top members */
.top-member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  transition: background var(--t-fast);
  text-decoration: none;
  color: inherit;
}
.top-member:hover { background: var(--bg); }
.top-member .rank { font-size: 0.72rem; font-weight: 800; color: var(--text-muted); width: 18px; text-align: center; }
.top-member .member-info { flex: 1; min-width: 0; }
.top-member .member-name { font-size: 0.85rem; font-weight: 700; }
.top-member .member-pts { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }

/* Post cards grandes */
.post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  margin-bottom: 16px;
  transition: all var(--t-mid) var(--ease-out);
}
.post-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-mid); }
.post-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.post-author { flex: 1; min-width: 0; }
.post-author-name { font-size: 0.92rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.post-author-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; font-weight: 500; }
.post-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--text);
  line-height: 1.35;
}
.post-content { font-size: 0.88rem; color: var(--text-mid); line-height: 1.75; font-weight: 400; }
.post-img {
  margin: 16px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  max-height: 360px;
}
.post-img img { width: 100%; object-fit: cover; cursor: zoom-in; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(24, 12, 11, 0.84);
  backdrop-filter: blur(8px);
  z-index: 500;
}

.lightbox-overlay.open {
  display: flex;
}

.lightbox-stage {
  position: relative;
  width: min(92vw, 1100px);
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  width: auto;
  max-width: 100%;
  max-height: 88vh;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  background: rgba(248,246,244,0.04);
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(248,246,244,0.16);
  border: 1px solid rgba(248,246,244,0.18);
  color: var(--ivory);
  backdrop-filter: blur(12px);
  transition: transform var(--t-fast), background var(--t-fast);
}

.lightbox-close:hover {
  transform: scale(1.05);
  background: rgba(248,246,244,0.26);
}
.post-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.post-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  border: none; background: none;
}
.post-action svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.post-action:hover { background: var(--rose); color: var(--brown); }
.post-action.liked { color: var(--rose-deep); }
.post-action.liked svg { fill: var(--rose-deep); stroke: var(--rose-deep); }
.post-spacer { flex: 1; }
.post-report { font-size: 0.7rem; color: var(--text-muted); cursor: pointer; padding: 4px 8px; }
.post-report:hover { color: var(--error); }

/* Composer de nuevo post */
.post-composer {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.composer-trigger {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
.composer-input {
  flex: 1;
  background: var(--bg);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-full);
  padding: 12px 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: 'Nunito', sans-serif;
  font-weight: 500;
}
.composer-input:hover { border-color: var(--rose-mid); background: var(--rose); }

/* Modal de post */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(45,26,23,0.55);
  backdrop-filter: blur(4px);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn var(--t-mid) var(--ease-out); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp var(--t-mid) var(--ease) both;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 { font-family: 'Nunito', sans-serif; font-size: 1rem; font-weight: 800; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted);
  transition: all var(--t-fast);
}
.modal-close:hover { background: var(--rose); color: var(--brown); }
.modal-close svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; }
.modal-body { padding: 24px 28px; }

/* Tipo de post pills */
.tipo-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.tipo-pill {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-mid);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--white);
  color: var(--text-mid);
  transition: all var(--t-fast);
}
.tipo-pill:hover { border-color: var(--rose-mid); background: var(--rose); color: var(--brown); }
.tipo-pill.selected { background: var(--brown); color: var(--ivory); border-color: var(--brown); }

/* ══════════════════════════════════════════════
   PROGRESO — Medidas
   ══════════════════════════════════════════════ */

.medidas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.medida-mini {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
}
.medida-mini .medida-label { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); display: block; margin-bottom: 4px; }
.medida-mini .medida-val { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 500; color: var(--text); }
.medida-mini .medida-unit { font-size: 0.72rem; color: var(--text-muted); font-weight: 400; }
.medida-mini .medida-delta { font-size: 0.7rem; font-weight: 700; display: block; margin-top: 4px; }
.medida-mini .medida-delta.pos { color: var(--success); }
.medida-mini .medida-delta.neg { color: var(--error); }

/* Fila del historial de progreso */
.progreso-row {
  display: flex;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.progreso-row:last-child { border-bottom: none; }
.progreso-week { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); width: 60px; flex-shrink: 0; }
.progreso-fecha { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; width: 80px; }
.progreso-datos { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; }
.progreso-dato { font-size: 0.82rem; font-weight: 600; }
.progreso-actions { display: flex; gap: 8px; }

/* ══════════════════════════════════════════════
   ADMIN
   ══════════════════════════════════════════════ */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.admin-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  background: var(--bg);
}
.admin-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.admin-table th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.admin-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: var(--bg); }
.admin-table tr:last-child td { border-bottom: none; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Árbol de programas */
.prog-tree { display: flex; flex-direction: column; gap: 12px; }
.prog-block { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.prog-block-header {
  background: var(--brown);
  padding: 16px 22px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.prog-block-header .prog-name { font-size: 0.95rem; font-weight: 700; color: var(--ivory); }
.prog-block-header .prog-plan { font-size: 0.72rem; color: rgba(248,246,244,0.5); margin-top: 2px; }
.mod-block { border-left: 3px solid var(--rose-mid); margin: 10px 14px; border-radius: var(--radius-md); overflow: hidden; background: var(--white); border: 1px solid var(--border); border-left: 3px solid var(--rose-mid); }
.mod-block-header { background: rgba(234,214,220,0.2); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
.mod-block-header .mod-name { font-size: 0.88rem; font-weight: 700; }
.vid-row { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; font-size: 0.82rem; }
.vid-row:first-child { border-top: none; }

/* Equipamiento por clase */
.eq-section {
  margin: 24px 0 10px;
  max-width: 760px;
}

.eq-section-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--brown);
  font-size: 0.98rem;
  font-weight: 800;
}

.eq-section-title i[data-lucide],
.eq-section-title svg.lucide {
  width: 18px !important;
  height: 18px !important;
}

.eq-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
}

.eq-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(74,46,43,0.1);
  background: rgba(255,255,255,0.92);
  color: var(--text-mid);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  cursor: default;
}

.eq-chip:disabled {
  opacity: 1;
}

.eq-chip.eq-chip-alt {
  background: rgba(255,255,255,0.92);
  border-color: rgba(74,46,43,0.14);
  color: var(--text-mid);
  cursor: pointer;
}

.eq-chip.eq-chip-alt:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
  border-color: rgba(184,130,143,0.28);
}

.eq-chip-hint {
  color: var(--rose-deep);
  opacity: 0.9;
  width: 14px !important;
  height: 14px !important;
}

.eq-popup {
  position: fixed;
  z-index: 40;
  width: min(280px, calc(100vw - 40px));
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(184,130,143,0.22);
  background: rgba(255,255,255,0.98);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}

.eq-popup.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.eq-popup-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brown-light);
  margin-bottom: 6px;
}

.eq-popup-text {
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.65;
}

/* ══════════════════════════════════════════════
   ANIMACIONES DE ENTRADA
   ══════════════════════════════════════════════ */

.fade-in { animation: fadeInUp 0.5s var(--ease-out) both; }
.fade-in-1 { animation-delay: 0.05s; }
.fade-in-2 { animation-delay: 0.10s; }
.fade-in-3 { animation-delay: 0.15s; }
.fade-in-4 { animation-delay: 0.20s; }
.fade-in-5 { animation-delay: 0.25s; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */

@media (max-width: 1024px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    transform: translateX(-110%);
    width: min(290px, calc(100vw - 36px));
    max-width: 290px;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; min-width: 0; }
  .mobile-menu-btn { display: flex !important; flex-shrink: 0; }
  .topbar { padding: 0 18px; gap: 12px; }
  .page-content { padding: 24px 20px; max-width: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }
  .learning-card-head { flex-direction: column; align-items: flex-start; }
  .learning-card-head > * { min-width: 0; }
  .learning-hero-grid,
  .lesson-grid,
  .planner-layout,
  .profile-layout,
  .recipe-layout { grid-template-columns: 1fr; }
  .academy-summary,
  .metric-strip { grid-template-columns: 1fr; }
  .community-layout { grid-template-columns: 1fr; }
  .community-sidebar { position: static; display: flex; gap: 16px; flex-wrap: wrap; width: 100%; }
  .category-card { flex: 1; min-width: 240px; }
  .composer-topline { align-items: flex-start; flex-direction: column; }
  .auth-page { background: var(--ivory); }
  .auth-left { display: none; }
  .auth-right {
    width: 100%;
    max-width: 680px;
    min-height: 100vh;
    margin: 0 auto;
    box-shadow: none;
    padding: 48px 36px;
  }
  .notif-panel { right: 16px; width: min(360px, calc(100vw - 32px)); }
  .btn { max-width: 100%; white-space: normal; text-align: center; }
}

@media (max-width: 820px) {
  .topbar { padding: 0 20px; }
  .page-content { padding: 24px 20px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .dash-hero { flex-direction: column; align-items: flex-start; }
  .dash-hero-actions { align-items: flex-start; flex-direction: row; }
  .continue-card { flex-direction: column; }
  .continue-thumb { width: 100%; height: 180px; }
  .academy-module-head,
  .academy-lesson { grid-template-columns: 1fr; align-items: flex-start; }
  .academy-module-stats,
  .academy-lesson-tail { justify-content: flex-start; }
  .post-header,
  .post-footer,
  .progreso-row { flex-wrap: wrap; }
  .post-spacer { display: none; }
  .progreso-week,
  .progreso-fecha { width: auto; }
  .progreso-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .support-grid { grid-template-columns: 1fr; }

  body.dashboard-page .page-content {
    padding: 22px 18px 30px;
  }
  body.dashboard-page .learning-shell {
    gap: 16px;
  }
  body.dashboard-page .learning-hero {
    padding: 24px 22px 22px;
    border-radius: 24px;
  }
  body.dashboard-page .learning-hero-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: stretch;
  }
  body.dashboard-page .learning-hero-copy h2 {
    font-size: 1.56rem;
    max-width: none;
  }
  body.dashboard-page .learning-hero-copy p {
    max-width: none;
    font-size: 0.92rem;
  }
  body.dashboard-page .learning-actions {
    flex-direction: column;
    align-items: stretch;
  }
  body.dashboard-page .learning-actions .btn,
  body.dashboard-page .learning-actions .btn-lg {
    width: 100%;
    justify-content: center;
  }
  body.dashboard-page .lesson-panel {
    padding: 18px 18px 16px;
  }
  body.dashboard-page .lesson-meta {
    flex-direction: column;
    align-items: stretch;
  }
  body.dashboard-page .lesson-meta span {
    width: 100%;
    justify-content: center;
  }
  body.dashboard-page .metric-strip {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  body.dashboard-page .lesson-grid,
  body.dashboard-page .lesson-stack {
    gap: 14px;
  }
  body.dashboard-page .lesson-card {
    padding: 18px 18px 16px;
  }
  body.dashboard-page .timeline-item {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .topbar {
    height: auto;
    min-height: var(--topbar-h);
    align-items: flex-start;
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .topbar-breadcrumb {
    order: 3;
    width: 100%;
  }
  .topbar-breadcrumb .crumb,
  .topbar-breadcrumb .crumb-sep {
    display: none;
  }
  .topbar-breadcrumb .crumb-current {
    display: block;
    font-size: 0.82rem;
  }
  .auth-right { padding: 36px 24px; }
  .page-content { padding: 20px 16px; }
  .card { padding: 20px; }
  .dash-hero { padding: 24px; }
  .learning-hero { padding: 24px 20px; border-radius: 24px; }
  .metric-chip,
  .lesson-panel,
  .recipe-card,
  .profile-summary { padding: 20px; }
  .academy-lessons { padding: 10px; }
  .category-card { min-width: 100%; }
  .post-card,
  .post-composer,
  .modal-body,
  .modal-header { padding-left: 20px; padding-right: 20px; }
  .program-switch { display: grid; grid-template-columns: 1fr; }
  .program-pill { justify-content: center; }
  .recipe-categories {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .recipe-categories .btn { width: 100%; }
  .post-footer { gap: 10px; }
  .post-action { padding: 8px 12px; }
  .post-report {
    width: 100%;
    padding: 0;
    text-align: left;
  }
  .progreso-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .progreso-datos { width: 100%; }

  body.dashboard-page .page-content {
    padding: 18px 14px 28px;
  }
  body.dashboard-page .learning-hero {
    padding: 22px 18px 20px;
    border-radius: 22px;
  }
  body.dashboard-page .learning-hero::before {
    width: 150px;
    height: 150px;
    right: -20px;
    bottom: -40px;
  }
  body.dashboard-page .section-kicker {
    font-size: 0.58rem;
    letter-spacing: 0.11em;
  }
  body.dashboard-page .learning-hero-copy h2 {
    font-size: 1.34rem;
    line-height: 1.18;
  }
  body.dashboard-page .learning-hero-copy p {
    font-size: 0.9rem;
    line-height: 1.74;
  }
  body.dashboard-page .lesson-panel h3 {
    font-size: 0.94rem;
  }
  body.dashboard-page .metric-chip {
    padding: 16px;
  }
  body.dashboard-page .metric-chip-value {
    font-size: 1.42rem;
  }
  body.dashboard-page .lesson-card {
    padding: 16px;
  }
  body.dashboard-page .learning-card-head {
    gap: 8px;
  }
  body.dashboard-page .academy-pill {
    width: 100%;
    justify-content: center;
  }
  body.dashboard-page .timeline-item {
    gap: 10px;
    padding: 12px;
  }
  body.dashboard-page .timeline-dot {
    width: 30px;
    height: 30px;
  }
}
