/* ============================================================
   NutriGym — Estilos principales
   assets/css/nutrigym.css
   ============================================================ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --ng-primary:     #0d6efd;
  --ng-sidebar-w:   260px;
  --ng-topbar-h:    60px;
  --ng-bg:          #f4f6fb;
  --ng-card-bg:     #ffffff;
  --ng-text:        #1e293b;
  --ng-muted:       #64748b;
  --ng-border:      #e2e8f0;
  --ng-radius:      10px;
  --ng-shadow:      0 1px 4px rgba(0,0,0,.08);
}

/* ── Reset básico ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--ng-bg); color: var(--ng-text); margin: 0; }
a { text-decoration: none; }

/* ── Layout: topbar + sidebar + main ─────────────────────────── */
.ng-topbar {
  height: var(--ng-topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--ng-border);
  z-index: 1030;
}
.ng-sidebar {
  position: fixed;
  top: var(--ng-topbar-h);
  left: 0;
  width: var(--ng-sidebar-w);
  height: calc(100vh - var(--ng-topbar-h));
  background: #fff;
  border-right: 1px solid var(--ng-border);
  overflow-y: auto;
  z-index: 100;
}
.ng-sidebar-offcanvas { width: var(--ng-sidebar-w) !important; }
.ng-main {
  margin-top: var(--ng-topbar-h);
  padding-left: 0;
  min-height: calc(100vh - var(--ng-topbar-h));
}
@media (min-width: 992px) {
  .ng-main { margin-left: var(--ng-sidebar-w); }
}

/* ── Logo / avatar ───────────────────────────────────────────── */
.ng-logo-initials {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--ng-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.ng-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ng-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.ng-user-btn {
  background: none; border: none; padding: 0;
  color: var(--ng-text);
}
.ng-user-btn:hover { background: #f1f5f9; border-radius: 8px; }

/* ── Token badge ─────────────────────────────────────────────── */
.ng-token-badge {
  display: flex; align-items: center; gap: 5px;
  background: #fef9ec;
  border: 1px solid #fbbf24;
  color: #b45309;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px; font-weight: 600;
}
.ng-token-badge i { font-size: 14px; }

/* ── Sidebar navegación ───────────────────────────────────────── */
.ng-sidenav { overflow-y: auto; }
.ng-nav-section {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ng-muted);
  padding: 0 12px; margin: 0 0 4px;
}
.ng-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--ng-text);
  font-size: 14px;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}
.ng-nav-link i { font-size: 16px; width: 20px; text-align: center; color: var(--ng-muted); }
.ng-nav-link:hover { background: #f1f5f9; color: var(--ng-primary); }
.ng-nav-link:hover i { color: var(--ng-primary); }
.ng-nav-link.active { background: #eef4ff; color: var(--ng-primary); font-weight: 600; }
.ng-nav-link.active i { color: var(--ng-primary); }

/* ── Cards ───────────────────────────────────────────────────── */
.ng-card {
  background: var(--ng-card-bg);
  border: 1px solid var(--ng-border);
  border-radius: var(--ng-radius);
  box-shadow: var(--ng-shadow);
  padding: 1.25rem;
}
.ng-card-header {
  font-size: 14px; font-weight: 600; color: var(--ng-muted);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: .5rem;
}

/* ── Stat cards (dashboard KPIs) ─────────────────────────────── */
.ng-stat {
  background: var(--ng-card-bg);
  border: 1px solid var(--ng-border);
  border-radius: var(--ng-radius);
  padding: 1.1rem 1.25rem;
  display: flex; align-items: center; gap: 14px;
}
.ng-stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.ng-stat-label { font-size: 12px; color: var(--ng-muted); margin-bottom: 2px; }
.ng-stat-value { font-size: 26px; font-weight: 700; line-height: 1; }

/* ── Tabla estilo NutriGym ───────────────────────────────────── */
.ng-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ng-table th {
  background: #f8fafc; border-bottom: 2px solid var(--ng-border);
  padding: 10px 14px; font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .05em; color: var(--ng-muted);
}
.ng-table td { padding: 12px 14px; border-bottom: 1px solid var(--ng-border); vertical-align: middle; }
.ng-table tr:hover td { background: #f8fafc; }
.ng-table tr:last-child td { border-bottom: none; }

/* ── Formularios ─────────────────────────────────────────────── */
.ng-form-label { font-size: 13px; font-weight: 600; color: var(--ng-text); margin-bottom: 4px; }
.ng-section-title {
  font-size: 13px; font-weight: 700; color: var(--ng-muted);
  text-transform: uppercase; letter-spacing: .07em;
  border-bottom: 2px solid var(--ng-border);
  padding-bottom: 6px; margin: 1.5rem 0 1rem;
}

/* ── Badges de estado ────────────────────────────────────────── */
.ng-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}
.ng-badge-success  { background: #dcfce7; color: #16a34a; }
.ng-badge-warning  { background: #fef9c3; color: #a16207; }
.ng-badge-danger   { background: #fee2e2; color: #dc2626; }
.ng-badge-info     { background: #dbeafe; color: #1d4ed8; }
.ng-badge-secondary{ background: #f1f5f9; color: #475569; }

/* ── Menú nutricional (tarjeta A/B) ─────────────────────────── */
.ng-menu-tab { border-radius: 12px; overflow: hidden; border: 1px solid var(--ng-border); }
.ng-menu-tab-header {
  padding: 12px 16px; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; gap: 8px;
}
.ng-menu-a .ng-menu-tab-header { background: #eef4ff; color: #1d4ed8; }
.ng-menu-b .ng-menu-tab-header { background: #f0fdf4; color: #15803d; }
.ng-comida-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--ng-border);
}
.ng-comida-row:last-child { border-bottom: none; }
.ng-comida-icon { font-size: 22px; width: 30px; text-align: center; }
.ng-comida-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--ng-muted); }
.ng-comida-nombre { font-weight: 600; font-size: 14px; }
.ng-comida-prep { font-size: 13px; color: var(--ng-muted); }
.ng-comida-cal { font-size: 13px; font-weight: 700; color: #ea580c; white-space: nowrap; margin-left: auto; }

/* ── Rutina card ─────────────────────────────────────────────── */
.ng-dia-card { border-radius: 10px; border: 1px solid var(--ng-border); margin-bottom: 12px; overflow: hidden; }
.ng-dia-header {
  background: #f8fafc; padding: 10px 16px;
  font-weight: 700; font-size: 14px;
  border-bottom: 1px solid var(--ng-border);
  display: flex; align-items: center; gap: 8px;
}
.ng-ejercicio-row { padding: 10px 16px; border-bottom: 1px solid #f0f4f8; font-size: 14px; }
.ng-ejercicio-row:last-child { border-bottom: none; }

/* ── Botones ─────────────────────────────────────────────────── */
.btn-ng-primary { background: var(--ng-primary); color: #fff; border: none; border-radius: 8px; }
.btn-ng-primary:hover { background: #0b5ed7; color: #fff; }

/* ── Generando IA (spinner overlay) ─────────────────────────── */
.ng-ia-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,.92);
  z-index: 9999; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
}
.ng-ia-overlay .spinner-border { width: 3rem; height: 3rem; color: var(--ng-primary); }
.ng-ia-overlay p { font-size: 16px; font-weight: 600; color: var(--ng-primary); }

/* ── Print (reportes) ────────────────────────────────────────── */
@media print {
  .ng-sidebar, .ng-topbar, .no-print { display: none !important; }
  .ng-main { margin-left: 0 !important; margin-top: 0 !important; }
  body { background: #fff; }
  .ng-card { box-shadow: none; border: 1px solid #ccc; }
}

/* ── Responsive tweaks ────────────────────────────────────────── */
@media (max-width: 576px) {
  .ng-stat-value { font-size: 20px; }
  .ng-table { font-size: 12px; }
  .ng-table th, .ng-table td { padding: 8px 10px; }
}
